Update hyprland config

This commit is contained in:
2024-01-09 00:21:05 +03:00
parent d4ea79d054
commit 5097686b8a
11 changed files with 514 additions and 84 deletions

22
scripts/smart-exec Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Get the currently focused workspace
current_workspace=$(hyprctl monitors -j | jq '.[] | .activeWorkspace.id' )
# Define preferred apps based on workspace
case $current_workspace in
1) app="kitty --single-instance";;
2) app="default";;
3) app="thunderbird";;
4) app="firefox";;
5) app="default";;
esac
if [[ "$app" == "default" ]]; then
hyprctl dispatch exec "wofi --show drun --normal-window"
else
notify-send -t 500 "opening $app"
hyprctl dispatch exec "$app"
fi

21
scripts/smart-switch Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
monitors=$(hyprctl monitors -j | jq '.[] | .name')
edp=$(echo "$monitors" | grep eDP)
hdmi=$(echo "$monitors" | grep HDMI)
if [[ "$1" == "close" ]]; then # lid is closing
if [[ -n "$hdmi" ]]; then # -n means if string is not empty
hyprctl keyword monitor "eDP-1, disable"
else
hyprctl dispatch exec lock-screen
fi
else
if [[ -z "$edp" ]]; then # -z means if string is empty
hyprctl keyword monitor eDP-1,preferred,0x1107,2.0
killall ags
ags
fi
fi

16
scripts/smart-tab Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
focusedClient=$(hyprctl clients -j | jq '[.[] | select(.focusHistoryID|contains(0))][0]')
if [[ -n "$focusedClient" ]]; then
clientClass=$(echo "$focusedClient" | jq '.class' )
case "$clientClass" in
kitty) hyprctl pass "" # cannot pass arbitrary keys to applications atm. abort mission
;;
d|D) exit 0
;;
*) exit 1
esac
fi