summaryrefslogtreecommitdiff
path: root/hyprhide
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-09-06 10:34:05 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-09-06 10:34:05 +0800
commit01abbff07781d55101f5a347634de49631709579 (patch)
tree6069e2ea6e007ff932cdfa917d922b9b1c186230 /hyprhide
parent582c7ad0569e4bc52a86b38e9a51f07f41842e15 (diff)
more hyprland scripts
Diffstat (limited to 'hyprhide')
-rwxr-xr-xhyprhide30
1 files changed, 30 insertions, 0 deletions
diff --git a/hyprhide b/hyprhide
new file mode 100755
index 0000000..93ddaf2
--- /dev/null
+++ b/hyprhide
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+stack_file="/tmp/hidden_pid_stack"
+
+
+function hide_window(){
+ pid=$(hyprctl activewindow -j | jq '.pid')
+ hyprctl dispatch movetoworkspacesilent 88,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