Fish · 296 bytes Raw Blame History
1 ## restart a system service
2 #
3 function sysrs
4 set -l unit (systemctl list-units --type=service --no-legend --no-pager \
5 | awk '{print $1}' | fzf --preview 'systemctl status {1} --no-pager' --preview-window=right,70%)
6 test -n "$unit"; or return
7 sudo systemctl restart $unit
8 end