mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2025-07-16 07:39:40 +03:00
Update hyprland config
This commit is contained in:
22
scripts/smart-exec
Executable file
22
scripts/smart-exec
Executable 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
21
scripts/smart-switch
Executable 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
16
scripts/smart-tab
Executable 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
|
||||
|
Reference in New Issue
Block a user