summaryrefslogtreecommitdiff
path: root/hyprhide
blob: 28c864cdd2171605a4c106feaf20867a6a2abfd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

stack_file="/tmp/hidden_pid_stack"


function hide_window(){
	pid=$(hyprctl activewindow -j | jq '.pid')
	hyprctl dispatch movetoworkspacesilent special:minimized, pid:$pid
	echo $pid >> $stack_file
}

function show_window(){
	current_workspace=$(hyprctl activeworkspace -j | jq '.id')	
    for i in $(cat $stack_file)
    do
        hyprctl dispatch movetoworkspacesilent $current_workspace,pid:$i
    done
    rm $stack_file
}


if [ ! -z $1 ]
then
	if [ "$1" == "h" ]
	then
		hide_window
	else
		show_window
	fi
fi