- added custom systemd config for sleep and login.
Those scripts should be placed in /etc/systemd/ in case of a restore on the laptop - strengthened the lid_close and lid_open scripts to debounce and not handle sleep - switched from deep sleep to s2idle, so that resume is not immediate - hibernating after 30 minutes of s2idle state - themed fuzzel with dracula - cleaned up hyprland comments on lid close/open - removed splash from hyprpaper config
This commit is contained in:
5
.config/etc_systemd/logind.conf.d/10-hybrid.conf
Normal file
5
.config/etc_systemd/logind.conf.d/10-hybrid.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[Login]
|
||||||
|
HandleLidSwitch=suspend-then-hibernate
|
||||||
|
HandleLidSwitchExternalPower=suspend-then-hibernate
|
||||||
|
HandleLidSwitchDocked=ignore
|
||||||
|
|
||||||
5
.config/etc_systemd/sleep.conf.d/10-hybrid.conf
Normal file
5
.config/etc_systemd/sleep.conf.d/10-hybrid.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[Sleep]
|
||||||
|
AllowSuspendThenHibernate=yes
|
||||||
|
MemorySleepMode=s2idle
|
||||||
|
HibernateDelaySec=30min
|
||||||
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#Sourced from https://github.com/dracula/fuzzel
|
||||||
|
#dracula themed fuzzel
|
||||||
|
|
||||||
# output=<not set>
|
# output=<not set>
|
||||||
font=JetBrainsMono Nerd Font Mono:size=15
|
font=JetBrainsMono Nerd Font Mono:size=15
|
||||||
match-counter = on
|
match-counter = on
|
||||||
@@ -11,7 +14,7 @@
|
|||||||
# password-character=*
|
# password-character=*
|
||||||
# fuzzy=yes
|
# fuzzy=yes
|
||||||
show-actions=yes
|
show-actions=yes
|
||||||
list-executables-in-path=yes
|
list-executables-in-path=no
|
||||||
# terminal=$TERMINAL -e # Note: you cannot actually use environment variables here
|
# terminal=$TERMINAL -e # Note: you cannot actually use environment variables here
|
||||||
terminal=wezterm {cmd}
|
terminal=wezterm {cmd}
|
||||||
# launch-prefix=<not set>
|
# launch-prefix=<not set>
|
||||||
|
|||||||
@@ -193,10 +193,9 @@ bind = , XF86MonBrightnessUp, exec, sudo brightnessctl s "+10%"
|
|||||||
bind = , XF86MonBrightnessDown, exec, sudo brightnessctl s "10%-"
|
bind = , XF86MonBrightnessDown, exec, sudo brightnessctl s "10%-"
|
||||||
|
|
||||||
#lid binds
|
#lid binds
|
||||||
#bindl = , switch:on:Lid Switch, exec, swaylock --screenshots --effect-blur 7x5 --clock
|
# trigger when the lid is opened
|
||||||
# trigger when the switch is turning off
|
|
||||||
bindl = , switch:off:Lid Switch,exec,~/bin/lid_open.sh
|
bindl = , switch:off:Lid Switch,exec,~/bin/lid_open.sh
|
||||||
# # trigger when the switch is turning on
|
# trigger when the lid is closed
|
||||||
bindl = , switch:on:Lid Switch,exec,~/bin/lid_close.sh
|
bindl = , switch:on:Lid Switch,exec,~/bin/lid_close.sh
|
||||||
|
|
||||||
# Desktop zooming or magnifier
|
# Desktop zooming or magnifier
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#ipc = off
|
#ipc = off
|
||||||
|
|
||||||
#wallpaper = , /home/thierry/Pictures/bg/IMG_20210913_142249.jpg
|
#wallpaper = , /home/thierry/Pictures/bg/IMG_20210913_142249.jpg
|
||||||
|
splash = false
|
||||||
wallpaper {
|
wallpaper {
|
||||||
monitor = eDP-1
|
monitor = eDP-1
|
||||||
path = /home/thierry/Pictures/bg/
|
path = /home/thierry/Pictures/bg/
|
||||||
|
|||||||
@@ -3,24 +3,27 @@ set -euo pipefail
|
|||||||
|
|
||||||
INTERNAL="eDP-1"
|
INTERNAL="eDP-1"
|
||||||
|
|
||||||
# Count non-internal monitors reported by Hyprland
|
sleep 0.2
|
||||||
external_count=$(
|
|
||||||
hyprctl monitors | awk -v internal="$INTERNAL" '
|
external_on_count=$(
|
||||||
$1 == "Monitor" {
|
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
|
||||||
name = $2
|
[ .[]
|
||||||
sub(":", "", name) # strip trailing colon
|
| select(.name != $internal)
|
||||||
if (name != internal) {
|
| select(.disabled != true)
|
||||||
print name
|
| select(.dpmsStatus == true)
|
||||||
}
|
] | length
|
||||||
}
|
'
|
||||||
' | wc -l
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Always turn off the laptop panel on lid close
|
if [ "$external_on_count" -eq 0 ]; then
|
||||||
hyprctl keyword monitor "$INTERNAL, disable"
|
# no external screen, we sleep
|
||||||
|
#systemctl hybrid-sleep
|
||||||
|
#systemctl suspend-then-hibernate
|
||||||
|
|
||||||
# Only lock if there is NO external monitor
|
#debounce hyprlock
|
||||||
if [ "$external_count" -eq 0 ]; then
|
pgrep -x hyprlock >/dev/null || hyprlock
|
||||||
hyprlock
|
else
|
||||||
systemctl suspend
|
# docked, we turn off internal screen
|
||||||
|
hyprctl keyword monitor "$INTERNAL, disable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
hyprctl keyword monitor "eDP-1, preferred, 0x0, 1"
|
set -euo pipefail
|
||||||
swayosd-server &
|
|
||||||
hyprpaper &
|
|
||||||
|
|
||||||
|
INTERNAL="eDP-1"
|
||||||
|
|
||||||
|
sleep 0.2
|
||||||
|
hyprctl keyword monitor "$INTERNAL, preferred, 0x0, 1"
|
||||||
|
|
||||||
|
pgrep -x swayosd-server >/dev/null || swayosd-server &
|
||||||
|
pgrep -x hyprpaper >/dev/null || hyprpaper &
|
||||||
|
|||||||
Reference in New Issue
Block a user