This commit is contained in:
Zastian Pretorius
2022-10-04 22:11:27 +01:00
parent f6474124b6
commit 2fc4c45890
5 changed files with 198 additions and 167 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
monitors=/tmp/hypr/monitors_temp
hyprctl monitors > $monitors
if [[ -z $1 ]]; then
workspace=$(grep -B 4 "focused: no" "$monitors" | awk 'NR==1 {print $3}')
else
workspace=$1
fi
activemonitor=$(grep -B 6 "focused: yes" "$monitors" | awk 'NR==1 {print $2}')
passivemonitor=$(grep -B 2 "($workspace)" "$monitors" | awk 'NR==1 {print $2}')
#activews=$(grep -A 2 "$activemonitor" "$monitors" | awk 'NR==3 {print $1}' RS='(' FS=')')
passivews=$(grep -A 2 "$passivemonitor" "$monitors" | awk 'NR==3 {print $1}' RS='(' FS=')')
if [[ $workspace -eq $passivews ]] && [[ $activemonitor != "$passivemonitor" ]]; then
hyprctl dispatch swapactiveworkspaces "$activemonitor" "$passivemonitor"
else
hyprctl dispatch moveworkspacetomonitor "$workspace $activemonitor" && hyprctl dispatch workspace "$workspace"
fi
exit 0

View File

@@ -2,4 +2,4 @@
swayidle -w \
timeout 600 'systemctl suspend' \
before-sleep 'swaylock -i $HOME/Pictures/Wallpapers/130.jpg --ring-color 8218c4 --key-hl-color 3e0c60'
before-sleep 'swaylock -i $HOME/Pictures/Wallpapers/133.png --ring-color 8218c4 --key-hl-color 3e0c60'