add waybar
This commit is contained in:
25
users/alice/home/hypr/show-hide.sh
Normal file
25
users/alice/home/hypr/show-hide.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
stack_file="/tmp/hide_window_pid_stack.txt"
|
||||
|
||||
function hide_window() {
|
||||
pid=$(hyprctl activewindow -j | jq '.pid')
|
||||
hyprctl dispatch movetoworkspacesilent "88,pid:$pid"
|
||||
echo "$pid" >>$stack_file
|
||||
}
|
||||
|
||||
function show_window() {
|
||||
pid=$(tail -1 $stack_file && sed -i '$d' $stack_file)
|
||||
[ -z "$pid" ] && exit
|
||||
|
||||
current_workspace=$(hyprctl activeworkspace -j | jq '.id')
|
||||
hyprctl dispatch movetoworkspacesilent "$current_workspace,pid:$pid"
|
||||
}
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
if [ "$1" == "h" ]; then
|
||||
hide_window >>/dev/null
|
||||
else
|
||||
show_window >>/dev/null
|
||||
fi
|
||||
fi
|
Reference in New Issue
Block a user