mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 22:07:59 +00:00
[polybar] Add minimizing to task_manager module
This commit is contained in:
parent
5265b8ebf1
commit
15f87b9cbd
@ -64,6 +64,11 @@ print_task_name()
|
|||||||
printf "%s%s" "${name^}" "$icon"
|
printf "%s%s" "${name^}" "$icon"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_active_window()
|
||||||
|
{
|
||||||
|
echo 0x0"$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2 | cut -f 2 -d 'x')"
|
||||||
|
}
|
||||||
|
|
||||||
get_task_id()
|
get_task_id()
|
||||||
{
|
{
|
||||||
sed "${1}q;d" $STATUS_FILE | cut -f 2 -d " "
|
sed "${1}q;d" $STATUS_FILE | cut -f 2 -d " "
|
||||||
@ -87,7 +92,12 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
--show-window)
|
--show-window)
|
||||||
id=$(get_task_id "$2")
|
id=$(get_task_id "$2")
|
||||||
|
|
||||||
|
if [ "$id" = "$(get_active_window)" ]; then
|
||||||
|
xdotool getactivewindow windowminimize
|
||||||
|
else
|
||||||
wmctrl -ia "$id"
|
wmctrl -ia "$id"
|
||||||
|
fi
|
||||||
print_task_name "$2"
|
print_task_name "$2"
|
||||||
;;
|
;;
|
||||||
--close-window)
|
--close-window)
|
||||||
|
Loading…
Reference in New Issue
Block a user