mirror of
https://github.com/mrfluffy-dev/dotfiles.git
synced 2026-01-17 13:50:34 +00:00
more
This commit is contained in:
25
script/.config/script/hyprland.sh
Normal file
25
script/.config/script/hyprland.sh
Normal 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
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user