Autocompletion of journal command
This commit is contained in:
parent
8943274eac
commit
d3f9d1abe0
13
.zsh/functions/_journal
Normal file
13
.zsh/functions/_journal
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#compdef journal
|
||||||
|
|
||||||
|
__systemctl () {
|
||||||
|
systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
(( $+functions[_journal_units] )) || _systemctl_get_non_template_names () {
|
||||||
|
echo -E - ${^${(R)${(f)"$(
|
||||||
|
__systemctl $mode list-unit-files "$PREFIX*"
|
||||||
|
__systemctl $mode list-units --all "$PREFIX*"
|
||||||
|
)"}:#*@.*}%%[[:space:]]*}
|
||||||
|
}
|
||||||
|
_wanted systemd-units expl unit compadd "$@" - $(_systemctl_get_non_template_names)
|
11
.zshrc
11
.zshrc
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Oh my zsh
|
# Oh my zsh
|
||||||
export ZSH="/r/arisu/.oh-my-zsh"
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
plugins=(git)
|
plugins=(git)
|
||||||
COMPLETION_WAITING_DOTS="true"
|
COMPLETION_WAITING_DOTS="true"
|
||||||
ZSH_THEME="powerlevel10k/powerlevel10k" # `p10k configure`
|
ZSH_THEME="powerlevel10k/powerlevel10k" # `p10k configure`
|
||||||
@ -18,6 +18,7 @@ export LANG=en_US.UTF-8
|
|||||||
|
|
||||||
|
|
||||||
# Auto completion
|
# Auto completion
|
||||||
|
fpath=(~/.zsh/functions $fpath)
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
zstyle ':completion:*' menu select
|
zstyle ':completion:*' menu select
|
||||||
zmodload zsh/complist
|
zmodload zsh/complist
|
||||||
@ -38,10 +39,16 @@ VISUAL=$EDITOR
|
|||||||
|
|
||||||
|
|
||||||
## Aliases ##
|
## Aliases ##
|
||||||
|
setopt complete_aliases
|
||||||
|
|
||||||
alias dotgit='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
|
alias dotgit='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
|
||||||
alias authy="/usr/bin/electron4 --app /usr/lib/authy/app.asar"
|
alias authy="/usr/bin/electron4 --app /usr/lib/authy/app.asar"
|
||||||
|
|
||||||
|
alias syslog="sudo journalctl -f | ccze"
|
||||||
|
journal() {
|
||||||
|
sudo journalctl -f -u $1 | ccze
|
||||||
|
}
|
||||||
|
|
||||||
# Random chars
|
# Random chars
|
||||||
rndanchars() {
|
rndanchars() {
|
||||||
openssl rand -base64 $1 | sed ':a;N;$!ba;s/\n//g' | sed 's/[+\/=]//g' | head -c $1
|
openssl rand -base64 $1 | sed ':a;N;$!ba;s/\n//g' | sed 's/[+\/=]//g' | head -c $1
|
||||||
|
Loading…
Reference in New Issue
Block a user