Autorotate + Suspend change

This commit is contained in:
Aleksandr Lebedev 2026-02-06 15:58:35 +01:00
parent d0fc98ca4f
commit 0eb1620a5a
4 changed files with 46 additions and 7 deletions

View file

@ -1,7 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# check if any player has status "Playing" set -e
playerctl -a status | pkgs.ripgrep Playing -q
# only suspend if nothing is playing # 1. Видео / музыка
if [ $? == 1 ]; then if playerctl -a status 2>/dev/null | rg -q Playing; then
bash -c $1 exit 0
fi fi
# 2. Звонки / микрофон
if pactl list sources 2>/dev/null | rg -q "State: RUNNING"; then
exit 0
fi
bash -c "$1"

View file

@ -280,7 +280,11 @@ spawn-sh-at-startup "kunifiedpush-distributor"
spawn-sh-at-startup "wl-paste --watch cliphist store &" spawn-sh-at-startup "wl-paste --watch cliphist store &"
spawn-sh-at-startup "nextcloud --background" spawn-sh-at-startup "nextcloud --background"
spawn-sh-at-startup "wvkbd --hidden || notify-send 'wvkbd crashed'" spawn-sh-at-startup "wvkbd --hidden || notify-send 'wvkbd crashed'"
spawn-sh-at-startup "lisgd || notify-send 'lisgd crashed'" spawn-sh-at-startup "lisgd"
spawn-sh-at-startup "autorotate.sh"
spawn-sh-at-startup "start-searxng.sh"
spawn-sh-at-startup "/usr/libexec/hyprpolkitagent"
spawn-sh-at-startup "hypridle"
config-notification { config-notification {
disable-failed disable-failed
@ -630,6 +634,10 @@ binds {
Mod+Shift+P { power-off-monitors; } Mod+Shift+P { power-off-monitors; }
} }
recent-windows {
off //disables Alt+Tab behaviour
}
cursor { cursor {
hide-after-inactive-ms 10000 hide-after-inactive-ms 10000
} }

24
niri/bin/autorotate.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
transform="normal"
monitor-sensor | while read -r line; do
case "$line" in
*normal*)
new_transform="180"
;;
*bottom-up*)
new_transform="normal"
;;
*)
continue
;;
esac
if [[ "$new_transform" != "$transform" ]]; then
transform="$new_transform"
echo "Transform: $transform"
niri msg output eDP-1 transform "$transform"
pkill lisgd
niri msg action spawn -- lisgd
fi
done

View file

@ -109,7 +109,7 @@ Item {
SystemClock { SystemClock {
id: systemClock id: systemClock
precision: SystemClock.Minutes precision: SystemClock.Seconds
} }
Rectangle { Rectangle {