From 0eb1620a5a44429e7c1add92bacc2282268cfe07 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Fri, 6 Feb 2026 15:58:35 +0100 Subject: [PATCH] Autorotate + Suspend change --- hypridle/.config/hypr/suspend-script.sh | 17 +++++++++---- niri/.config/niri/config.kdl | 10 +++++++- niri/bin/autorotate.sh | 24 +++++++++++++++++++ .../Modules/Lock/LockScreenContent.qml | 2 +- 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100755 niri/bin/autorotate.sh diff --git a/hypridle/.config/hypr/suspend-script.sh b/hypridle/.config/hypr/suspend-script.sh index 3b9f9ea..022ce6e 100755 --- a/hypridle/.config/hypr/suspend-script.sh +++ b/hypridle/.config/hypr/suspend-script.sh @@ -1,7 +1,14 @@ #!/usr/bin/env bash - # check if any player has status "Playing" -playerctl -a status | pkgs.ripgrep Playing -q -# only suspend if nothing is playing -if [ $? == 1 ]; then - bash -c $1 +set -e + +# 1. Видео / музыка +if playerctl -a status 2>/dev/null | rg -q Playing; then + exit 0 fi + +# 2. Звонки / микрофон +if pactl list sources 2>/dev/null | rg -q "State: RUNNING"; then + exit 0 +fi + +bash -c "$1" diff --git a/niri/.config/niri/config.kdl b/niri/.config/niri/config.kdl index aec99e4..46647bc 100644 --- a/niri/.config/niri/config.kdl +++ b/niri/.config/niri/config.kdl @@ -280,7 +280,11 @@ spawn-sh-at-startup "kunifiedpush-distributor" spawn-sh-at-startup "wl-paste --watch cliphist store &" spawn-sh-at-startup "nextcloud --background" 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 { disable-failed @@ -630,6 +634,10 @@ binds { Mod+Shift+P { power-off-monitors; } } +recent-windows { + off //disables Alt+Tab behaviour +} + cursor { hide-after-inactive-ms 10000 } \ No newline at end of file diff --git a/niri/bin/autorotate.sh b/niri/bin/autorotate.sh new file mode 100755 index 0000000..0c30ae7 --- /dev/null +++ b/niri/bin/autorotate.sh @@ -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 diff --git a/quickshell/.config/quickshell/Modules/Lock/LockScreenContent.qml b/quickshell/.config/quickshell/Modules/Lock/LockScreenContent.qml index feaf561..4a0f2d0 100644 --- a/quickshell/.config/quickshell/Modules/Lock/LockScreenContent.qml +++ b/quickshell/.config/quickshell/Modules/Lock/LockScreenContent.qml @@ -109,7 +109,7 @@ Item { SystemClock { id: systemClock - precision: SystemClock.Minutes + precision: SystemClock.Seconds } Rectangle {