hyprctl completions: Use only awk rather than grep + awk

Using "awk '/<exp>/{ print $n }'" is more minimal and slightly faster
than using "grep '<exp>' | awk '{ print $n }'".

Signed-off-by: Lincoln Yuji <lincolnyuji@hotmail.com>
This commit is contained in:
Lincoln Yuji 2024-07-02 16:04:14 -03:00 committed by Mihai Fufezan
parent 6247a6b537
commit 8bb75a223d
3 changed files with 9 additions and 9 deletions

View file

@ -1,13 +1,13 @@
_hyprctl_cmd_2 () {
hyprctl monitors | grep Monitor | awk '{ print $2 }'
hyprctl monitors | awk '/Monitor/{ print $2 }'
}
_hyprctl_cmd_3 () {
hyprpm list | grep "Plugin" | awk '{print $4}'
hyprpm list | awk '/Plugin/{ print $4 }'
}
_hyprctl_cmd_0 () {
hyprctl clients | grep class | awk '{print $2}'
hyprctl clients | awk '/class/{ print $2 }'
}
_hyprctl_cmd_1 () {

View file

@ -1,16 +1,16 @@
function _hyprctl_3
set 1 $argv[1]
hyprctl monitors | grep Monitor | awk '{ print $2 }'
hyprctl monitors | awk '/Monitor/{ print $2 }'
end
function _hyprctl_4
set 1 $argv[1]
hyprpm list | grep "Plugin" | awk '{print $4}'
hyprpm list | awk '/Plugin/{ print $4 }'
end
function _hyprctl_1
set 1 $argv[1]
hyprctl clients | grep class | awk '{print $2}'
hyprctl clients | awk '/class/{ print $2 }'
end
function _hyprctl_2

View file

@ -1,15 +1,15 @@
#compdef hyprctl
_hyprctl_cmd_2 () {
hyprctl monitors | grep Monitor | awk '{ print $2 }'
hyprctl monitors | awk '/Monitor/{ print $2 }'
}
_hyprctl_cmd_3 () {
hyprpm list | grep "Plugin" | awk '{print $4}'
hyprpm list | awk '/Plugin/{ print $4 }'
}
_hyprctl_cmd_0 () {
hyprctl clients | grep class | awk '{print $2}'
hyprctl clients | awk '/class/{ print $2 }'
}
_hyprctl_cmd_1 () {