refactor(hypr): update to match upstream breaking changes

This commit is contained in:
Price Hiller 2024-03-20 07:40:03 -05:00
parent 8ee2fb5a7d
commit 5257f4b46a
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
7 changed files with 33 additions and 15 deletions

View File

@ -1,9 +1,9 @@
### GROMIT-MPX ### # --- GROMIT-MPX ---
workspace = special:gromit,gapsin:0,gapsout:0,decorate:false,border:false,on-created-empty:gromit-mpx -a workspace = special:gromit,gapsin:0,gapsout:0,decorate:false,border:false,on-created-empty:gromit-mpx -a
windowrulev2 = noblur,class:^(Gromit-mpx)$ windowrulev2 = noblur,class:^(Gromit-mpx)$
windowrulev2 = opacity 1 override, 1 override,class:^(Gromit-mpx)$ windowrulev2 = opacity 1 override, 1 override,class:^(Gromit-mpx)$
windowrulev2 = noshadow,class:^(Gromit-mpx)$ windowrulev2 = noshadow,class:^(Gromit-mpx)$
windowrulev2 = nofullscreenrequest,class:^(Gromit-mpx)$ windowrulev2 = suppressevent fullscreen,class:^(Gromit-mpx)$
windowrulev2 = noanim,class:^(Gromit-mpx)$ windowrulev2 = noanim,class:^(Gromit-mpx)$
windowrulev2 = size 100% 100%,class:^(Gromit-mpx)$ windowrulev2 = size 100% 100%,class:^(Gromit-mpx)$

View File

@ -17,11 +17,11 @@ gestures {
workspace_swipe_fingers = 3 workspace_swipe_fingers = 3
} }
### MOUSE ### # --- MOUSE ---
bindm = SUPER,mouse:272,movewindow bindm = SUPER,mouse:272,movewindow
bindm = SUPER,mouse:273,resizewindow bindm = SUPER,mouse:273,resizewindow
### RESIZE ### # --- RESIZE ---
bind = SUPER,R,submap,resize # will switch to a submap called resize bind = SUPER,R,submap,resize # will switch to a submap called resize
submap = resize # will start a submap called "resize" submap = resize # will start a submap called "resize"
@ -39,7 +39,7 @@ binde = ,j,resizeactive,0 50
bind = ,escape,submap,reset # use reset to go back to the global submap bind = ,escape,submap,reset # use reset to go back to the global submap
submap = reset # will reset the submap, meaning end the current one and return to the global one. submap = reset # will reset the submap, meaning end the current one and return to the global one.
### Move Window ### # --- Move Window ---
bind = SUPER,M,submap,move_window bind = SUPER,M,submap,move_window
submap = move_window submap = move_window
@ -69,7 +69,7 @@ bind = SUPER,D,exec,makoctl dismiss -a
bind = SUPERSHIFT,Q,exec,swaylock bind = SUPERSHIFT,Q,exec,swaylock
bind = SUPERSHIFT,M,exit bind = SUPERSHIFT,M,exit
### Screen Captures ### # --- Screen Captures ---
# May be videos or screenshots # May be videos or screenshots
bind = SUPER,S,exec,grim -g "$(slurp)" - | swappy -f - bind = SUPER,S,exec,grim -g "$(slurp)" - | swappy -f -
bind = CTRLSUPER,S,exec,grim -g "$(slurp)" - | wl-copy --type image/png bind = CTRLSUPER,S,exec,grim -g "$(slurp)" - | wl-copy --type image/png
@ -96,7 +96,7 @@ bind = SUPER,l,movefocus,r
bind = SUPER,k,movefocus,u bind = SUPER,k,movefocus,u
bind = SUPER,j,movefocus,d bind = SUPER,j,movefocus,d
### Workspaces ### # --- Workspaces ---
bind = SUPERSHIFT,left,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 )) bind = SUPERSHIFT,left,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') - 1 ))
bind = SUPERSHIFT,right,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 )) bind = SUPERSHIFT,right,exec,~/.config/hypr/scripts/focus-workspace-mon.bash $(( $(hyprctl monitors -j | jq -c '.[] | select(.focused) | .activeWorkspace.id') + 1 ))

View File

@ -1,6 +1,6 @@
source = ./colors.conf source = ./colors.conf
### General Configuration ### # --- General Configuration ---
general { general {
gaps_in = 5 gaps_in = 5
gaps_out = 10 gaps_out = 10

View File

@ -1,4 +1,2 @@
monitor = , preferred, auto, 1 monitor = , preferred, auto, 1
monitor=eDP-1,preferred,auto,1.35 monitor=eDP-1,preferred,auto,1.35
bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1"
bindl=,switch:on:Lid Switch,exec,~/.config/hypr/scripts/disable-laptop-screen.bash

View File

@ -1,6 +1,6 @@
$configDir = ~/.config/hypr/conf $configDir = ~/.config/hypr/conf
### Core Config ### # --- Core Config ---
source = $configDir/core/env.conf source = $configDir/core/env.conf
source = $configDir/core/general.conf source = $configDir/core/general.conf
source = $configDir/core/bindings.conf source = $configDir/core/bindings.conf
@ -8,5 +8,5 @@ source = $configDir/core/appearance.conf
source = $configDir/core/monitors.conf source = $configDir/core/monitors.conf
source = $configDir/core/window-rules.conf source = $configDir/core/window-rules.conf
### Application Specific ### # --- Application Specific ---
source = $configDir/application/gromit-mpx.conf source = $configDir/application/gromit-mpx.conf

View File

@ -4,7 +4,7 @@ main() {
local mon_count local mon_count
mon_count="$(hyprctl monitors -j | jq length)" mon_count="$(hyprctl monitors -j | jq length)"
if ((mon_count > 1)); then if ((mon_count > 1)); then
hyprctl keyword monitor "eDP-1, disable" hyprctl dpms off eDP-1
fi fi
} }

View File

@ -40,15 +40,36 @@ monitor-ssid() {
monitor-laptop-lid() { monitor-laptop-lid() {
local laptop_lid_state local laptop_lid_state
local laptop_lid_last_state
while :; do while :; do
sleep 1
laptop_lid_state="$(</proc/acpi/button/lid/LID0/state)" laptop_lid_state="$(</proc/acpi/button/lid/LID0/state)"
laptop_lid_state="${laptop_lid_state##* }" laptop_lid_state="${laptop_lid_state##* }"
laptop_lid_state="${laptop_lid_state^^}" laptop_lid_state="${laptop_lid_state^^}"
if [[ "${laptop_lid_state}" == "${laptop_lid_last_state}" ]]; then
continue
fi
case "${laptop_lid_state}" in case "${laptop_lid_state}" in
"OPEN")
if hyprctl monitors -j | jq -er '.[] | select(.name=="eDP-1") | .name' >/dev/null; then
printf "Laptop screen was opened, attempting to enable it...\n"
if hyprctl dispatch dpms on eDP-1; then
laptop_lid_last_state="${laptop_lid_state}"
local msg="Laptop screen successfully enabled"
log "Laptop Clamshell" "${msg}"
notify-send "Laptop Clamshell" "${msg}" -a "Laptop Clamshell"
else
local msg="Received an error when enabling the laptop screen!\n"
log "Laptop Clamshell" "${msg}"
notify-send "Laptop Clamshell Error" "${msg}" -a "Laptop Clamshell"
fi
fi
;;
"CLOSED") "CLOSED")
if hyprctl monitors -j | jq -er '.[] | select(.name=="eDP-1") | .name' >/dev/null; then if hyprctl monitors -j | jq -er '.[] | select(.name=="eDP-1") | .name' >/dev/null; then
printf "Laptop screen was shut, attempting to disable it...\n" printf "Laptop screen was shut, attempting to disable it...\n"
if hyprctl keyword monitor "eDP-1, disable"; then if hyprctl dispatch dpms off eDP-1; then
laptop_lid_last_state="${laptop_lid_state}"
local msg="Laptop screen successfully disabled" local msg="Laptop screen successfully disabled"
log "Laptop Clamshell" "${msg}" log "Laptop Clamshell" "${msg}"
notify-send "Laptop Clamshell" "${msg}" -a "Laptop Clamshell" notify-send "Laptop Clamshell" "${msg}" -a "Laptop Clamshell"
@ -60,7 +81,6 @@ monitor-laptop-lid() {
fi fi
;; ;;
esac esac
sleep 1
done done
} }
monitor-ssid & monitor-ssid &