diff options
| -rw-r--r-- | raveos-gnome-theme/00-raveos | 2 | ||||
| -rw-r--r-- | raveos-gnome-theme/99_raveos-gnome.gschema.override | 2 | ||||
| -rw-r--r-- | raveos-gnome-theme/PKGBUILD | 2 | ||||
| -rw-r--r-- | raveos-gnome-theme/raveos-gnome-idle-blank | 23 | ||||
| -rw-r--r-- | raveos-gnome-theme/raveos-gnome-theme.install | 6 | ||||
| -rw-r--r-- | raveos-hyprland-theme/PKGBUILD | 2 | ||||
| -rw-r--r-- | raveos-hyprland-theme/raveos-hyprland-apply.sh | 8 | ||||
| -rw-r--r-- | raveos-hyprland-theme/theme-data/hypr/hypridle.conf | 9 | ||||
| -rw-r--r-- | raveos-hyprland-theme/theme-data/hypr/hyprland.lua | 1 | ||||
| -rw-r--r-- | raveos-plasma-theme/PKGBUILD | 3 | ||||
| -rw-r--r-- | raveos-plasma-theme/kscreenlockerrc | 5 | ||||
| -rw-r--r-- | raveos-plasma-theme/powermanagementprofilesrc | 9 | ||||
| -rwxr-xr-x | raveos-plasma-theme/raveos-plasma-apply.sh | 26 |
13 files changed, 93 insertions, 5 deletions
diff --git a/raveos-gnome-theme/00-raveos b/raveos-gnome-theme/00-raveos index 7ee8320..9bef8d5 100644 --- a/raveos-gnome-theme/00-raveos +++ b/raveos-gnome-theme/00-raveos @@ -71,7 +71,7 @@ primary-color='#241f31' secondary-color='#000000' [org/gnome/desktop/session] -idle-delay=uint32 60 +idle-delay=uint32 300 [org/gnome/desktop/wm/keybindings] close=['<Super>q'] diff --git a/raveos-gnome-theme/99_raveos-gnome.gschema.override b/raveos-gnome-theme/99_raveos-gnome.gschema.override index cdcaa58..285826a 100644 --- a/raveos-gnome-theme/99_raveos-gnome.gschema.override +++ b/raveos-gnome-theme/99_raveos-gnome.gschema.override @@ -35,7 +35,7 @@ dynamic-workspaces=true numlock-state=true [org.gnome.desktop.session] -idle-delay=uint32 900 +idle-delay=uint32 300 [org.gnome.settings-daemon.plugins.power] power-button-action='interactive' diff --git a/raveos-gnome-theme/PKGBUILD b/raveos-gnome-theme/PKGBUILD index 2fc26c0..ffbdf9c 100644 --- a/raveos-gnome-theme/PKGBUILD +++ b/raveos-gnome-theme/PKGBUILD @@ -2,7 +2,7 @@ pkgname=raveos-gnome-theme pkgver=1.0.0 -pkgrel=9 +pkgrel=10 pkgdesc="RaveOS GNOME theme payload and installer" arch=('any') url="https://raveos.local" diff --git a/raveos-gnome-theme/raveos-gnome-idle-blank b/raveos-gnome-theme/raveos-gnome-idle-blank index 06ee224..44425f9 100644 --- a/raveos-gnome-theme/raveos-gnome-idle-blank +++ b/raveos-gnome-theme/raveos-gnome-idle-blank @@ -11,6 +11,9 @@ DISPLAY_BUS = "org.gnome.Mutter.DisplayConfig" DISPLAY_PATH = "/org/gnome/Mutter/DisplayConfig" IDLE_BUS = "org.gnome.Mutter.IdleMonitor" IDLE_PATH = "/org/gnome/Mutter/IdleMonitor/Core" +SESSION_BUS = "org.gnome.SessionManager" +SESSION_PATH = "/org/gnome/SessionManager" +IDLE_INHIBIT_FLAG = 8 POLL_MS = 2000 WAKE_MS = 1500 @@ -33,6 +36,24 @@ def name_has_owner(bus, name): return False +def is_idle_inhibited(bus): + try: + res = bus.call_sync( + SESSION_BUS, + SESSION_PATH, + SESSION_BUS, + "IsInhibited", + GLib.Variant("(u)", (IDLE_INHIBIT_FLAG,)), + None, + Gio.DBusCallFlags.NONE, + 2000, + None, + ) + return bool(res.unpack()[0]) + except GLib.Error: + return False + + def main(): if "GNOME" not in os.environ.get("XDG_CURRENT_DESKTOP", ""): return 0 @@ -83,6 +104,8 @@ def main(): delay = settings.get_uint("idle-delay") idle = get_idle_ms() if delay > 0 and idle >= delay * 1000 and not state["off"]: + if is_idle_inhibited(bus): + return True set_power(3) state["off"] = True elif state["off"] and idle < WAKE_MS: diff --git a/raveos-gnome-theme/raveos-gnome-theme.install b/raveos-gnome-theme/raveos-gnome-theme.install index dedef0b..796b2b4 100644 --- a/raveos-gnome-theme/raveos-gnome-theme.install +++ b/raveos-gnome-theme/raveos-gnome-theme.install @@ -13,14 +13,20 @@ _enable_apply_service() { fi } +_restart_idle_blank() { + pkill -f '/usr/lib/raveos-gnome-theme/idle-blank' >/dev/null 2>&1 || true +} + post_install() { _update_system_configs _enable_apply_service + _restart_idle_blank } post_upgrade() { _update_system_configs _enable_apply_service + _restart_idle_blank } post_remove() { diff --git a/raveos-hyprland-theme/PKGBUILD b/raveos-hyprland-theme/PKGBUILD index 3612be4..0eb6ea6 100644 --- a/raveos-hyprland-theme/PKGBUILD +++ b/raveos-hyprland-theme/PKGBUILD @@ -2,7 +2,7 @@ pkgname=raveos-hyprland-theme pkgver=1.0.0 -pkgrel=10 +pkgrel=11 pkgdesc="RaveOS Hyprland theme payload and installer" arch=('any') url="https://raveos.local" diff --git a/raveos-hyprland-theme/raveos-hyprland-apply.sh b/raveos-hyprland-theme/raveos-hyprland-apply.sh index 0dacda7..6262fc9 100644 --- a/raveos-hyprland-theme/raveos-hyprland-apply.sh +++ b/raveos-hyprland-theme/raveos-hyprland-apply.sh @@ -248,6 +248,14 @@ while IFS=: read -r user _ uid gid _ home shell; do fi fi + if [[ -f "${home}/.config/hypr/hyprland.lua" && -f "${PAYLOAD}/hypr/hypridle.conf" ]]; then + install -Dm644 "${PAYLOAD}/hypr/hypridle.conf" "${home}/.config/hypr/hypridle.conf" + if ! grep -q 'hypridle' "${home}/.config/hypr/hyprland.lua"; then + sed -i 's|hl.exec_cmd("raveswitch run")|hl.exec_cmd("raveswitch run")\n hl.exec_cmd("hypridle")|' "${home}/.config/hypr/hyprland.lua" + fi + chown "${uid}:${gid}" "${home}/.config/hypr/hypridle.conf" "${home}/.config/hypr/hyprland.lua" 2>/dev/null || true + fi + if [[ -f "${home}/.config/hypr/config/windowrules.lua" && -f "${PAYLOAD}/hypr/config/windowrules.lua" ]] \ && grep -q 'fix-xwayland-drags' "${home}/.config/hypr/config/windowrules.lua" 2>/dev/null \ && ! grep -q 'windowrule-14' "${home}/.config/hypr/config/windowrules.lua" 2>/dev/null; then diff --git a/raveos-hyprland-theme/theme-data/hypr/hypridle.conf b/raveos-hyprland-theme/theme-data/hypr/hypridle.conf new file mode 100644 index 0000000..703a1ff --- /dev/null +++ b/raveos-hyprland-theme/theme-data/hypr/hypridle.conf @@ -0,0 +1,9 @@ +general { + after_sleep_cmd = hyprctl dispatch dpms on +} + +listener { + timeout = 300 + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} diff --git a/raveos-hyprland-theme/theme-data/hypr/hyprland.lua b/raveos-hyprland-theme/theme-data/hypr/hyprland.lua index 2011427..b44bb93 100644 --- a/raveos-hyprland-theme/theme-data/hypr/hyprland.lua +++ b/raveos-hyprland-theme/theme-data/hypr/hyprland.lua @@ -14,6 +14,7 @@ hl.monitor({ hl.on("hyprland.start", function() hl.exec_cmd("dms run") hl.exec_cmd("raveswitch run") + hl.exec_cmd("hypridle") hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") hl.exec_cmd("dbus-update-activation-environment --systemd --all") hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") diff --git a/raveos-plasma-theme/PKGBUILD b/raveos-plasma-theme/PKGBUILD index 02abd4a..54897c0 100644 --- a/raveos-plasma-theme/PKGBUILD +++ b/raveos-plasma-theme/PKGBUILD @@ -2,7 +2,7 @@ pkgname=raveos-plasma-theme pkgver=1.0.0 -pkgrel=7 +pkgrel=8 pkgdesc="RaveOS Plasma theme payload and installer" arch=('any') url="https://raveos.local" @@ -50,6 +50,7 @@ package() { install -Dm644 "${startdir}/kwalletrc" "${pkgdir}/etc/xdg/kwalletrc" install -Dm644 "${startdir}/ksplashrc" "${pkgdir}/etc/xdg/ksplashrc" install -Dm644 "${startdir}/kscreenlockerrc" "${pkgdir}/etc/xdg/kscreenlockerrc" + install -Dm644 "${startdir}/powermanagementprofilesrc" "${pkgdir}/etc/xdg/powermanagementprofilesrc" install -Dm644 "${startdir}/konsolerc" "${pkgdir}/etc/xdg/konsolerc" install -Dm755 "${startdir}/theme-data/profile.d/raveos-fastfetch.sh" \ diff --git a/raveos-plasma-theme/kscreenlockerrc b/raveos-plasma-theme/kscreenlockerrc index 3a51502..5c7b317 100644 --- a/raveos-plasma-theme/kscreenlockerrc +++ b/raveos-plasma-theme/kscreenlockerrc @@ -1,3 +1,8 @@ +[Daemon] +Autolock=true +LockGrace=5 +Timeout=300 + [Greeter][Wallpaper][org.kde.image][General] FillMode=2 Image=file:///usr/share/backgrounds/raveos/raveos-main-bg.jpeg diff --git a/raveos-plasma-theme/powermanagementprofilesrc b/raveos-plasma-theme/powermanagementprofilesrc new file mode 100644 index 0000000..60ad930 --- /dev/null +++ b/raveos-plasma-theme/powermanagementprofilesrc @@ -0,0 +1,9 @@ +[AC][DimDisplay] +idleTime=180000 + +[AC][DPMSControl] +idleTime=300000 + +[AC][SuspendSession] +idleTime=0 +suspendType=1 diff --git a/raveos-plasma-theme/raveos-plasma-apply.sh b/raveos-plasma-theme/raveos-plasma-apply.sh index c73bb64..d077fce 100755 --- a/raveos-plasma-theme/raveos-plasma-apply.sh +++ b/raveos-plasma-theme/raveos-plasma-apply.sh @@ -51,12 +51,33 @@ write_kscreenlockerrc() { local target_home="$1" mkdir -p "${target_home}/.config" cat > "${target_home}/.config/kscreenlockerrc" <<KLEOF +[Daemon] +Autolock=true +LockGrace=5 +Timeout=300 + [Greeter][Wallpaper][org.kde.image][General] FillMode=2 Image=file://${wallpaper_dst} KLEOF } +write_powermanagementprofilesrc() { + local target_home="$1" + mkdir -p "${target_home}/.config" + cat > "${target_home}/.config/powermanagementprofilesrc" <<PMPEOF +[AC][DimDisplay] +idleTime=180000 + +[AC][DPMSControl] +idleTime=300000 + +[AC][SuspendSession] +idleTime=0 +suspendType=1 +PMPEOF +} + write_ksplashrc() { local target_home="$1" mkdir -p "${target_home}/.config" @@ -137,6 +158,7 @@ done write_konsolerc /etc/skel write_kscreenlockerrc /etc/skel +write_powermanagementprofilesrc /etc/skel write_ksplashrc /etc/skel write_kdeglobals /etc/skel write_plasmarc /etc/skel @@ -192,6 +214,10 @@ while IFS=: read -r user _ uid gid _ home shell; do write_plasmarc "${home}" fi + if [[ ! -f "${home}/.config/powermanagementprofilesrc" ]]; then + write_powermanagementprofilesrc "${home}" + fi + if [[ ! -f "${home}/.config/autostart/kmix_autostart.desktop" ]]; then disable_kmix_autostart "${home}" fi |