From c8d1e94c0f675535a8fd783e65d1991cb7c14bc5 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 02:11:41 +0100 Subject: [PATCH 1/6] Move to swaync (from dunst) --- home/.config/hypr/hyprland.d/keybinds.conf | 8 +- home/.config/swaync/config.json | 85 +++ home/.config/swaync/style.css | 611 ++++++++++++++++++ home/.config/systemd/user/swaync.service | 10 + .../user/wm-ready.target.wants/dunst.service | 1 - .../gui/{hyprland => }/toggle-notifications | 0 install_gui.sh | 4 +- 7 files changed, 712 insertions(+), 7 deletions(-) create mode 100644 home/.config/swaync/config.json create mode 100644 home/.config/swaync/style.css create mode 100644 home/.config/systemd/user/swaync.service delete mode 120000 home/.config/systemd/user/wm-ready.target.wants/dunst.service rename home/.local/bin/scripts/gui/{hyprland => }/toggle-notifications (100%) diff --git a/home/.config/hypr/hyprland.d/keybinds.conf b/home/.config/hypr/hyprland.d/keybinds.conf index 6a55750..d794599 100644 --- a/home/.config/hypr/hyprland.d/keybinds.conf +++ b/home/.config/hypr/hyprland.d/keybinds.conf @@ -70,10 +70,10 @@ bind = SUPER, 164, exec, quick-record toggle # ### NOTIFICATIONS ### # ##################### -bind = CTRL, grave, exec, dunstctl close -bind = CTRL_SHIFT, grave, exec, dunstctl close-all -bind = CTRL, period, exec, dunstctl history-pop -bind = CTRL_SHIFT, period, exec, dunstctl context +bind = CTRL, grave, exec, swaync-client --close-latest +bind = CTRL_SHIFT, grave, exec, swaync-client --close-all +bind = CTRL_ALT, grave, exec, swaync-client --hide-latest +bind = CTRL, period, exec, swaync-client --toggle-panel bind = SUPER_SHIFT, D, exec, toggle-notifications # ############################ diff --git a/home/.config/swaync/config.json b/home/.config/swaync/config.json new file mode 100644 index 0000000..4149f10 --- /dev/null +++ b/home/.config/swaync/config.json @@ -0,0 +1,85 @@ +{ + "$schema": "/etc/xdg/swaync/configSchema.json", + "positionX": "right", + "positionY": "top", + "layer": "overlay", + "control-center-layer": "top", + "layer-shell": true, + "cssPriority": "application", + "control-center-margin-top": 0, + "control-center-margin-bottom": 0, + "control-center-margin-right": 0, + "control-center-margin-left": 0, + "notification-2fa-action": true, + "notification-inline-replies": false, + "notification-icon-size": 48, + "notification-body-image-height": 100, + "notification-body-image-width": 200, + "timeout": 8, + "timeout-low": 5, + "timeout-critical": 0, + "fit-to-screen": true, + "relative-timestamps": true, + "control-center-width": 300, + "control-center-height": 600, + "notification-window-width": 300, + "keyboard-shortcuts": true, + "image-visibility": "when-available", + "transition-time": 200, + "hide-on-clear": false, + "hide-on-action": true, + "script-fail-notify": true, + "scripts": { + "example-script": { + "exec": "echo 'Do something...'", + "urgency": "Normal" + }, + "example-action-script": { + "exec": "echo 'Do something actionable!'", + "urgency": "Normal", + "run-on": "action" + } + }, + "notification-visibility": { + "example-name": { + "state": "enabled", + "urgency": "Low", + "app-name": "Spotify" + } + }, + "widgets": ["inhibitors", "title", "dnd", "notifications", "mpris"], + "widget-config": { + "inhibitors": { + "text": "Inhibitors", + "button-text": "Clear All", + "clear-all-button": true + }, + "title": { + "text": "Notifications", + "clear-all-button": true, + "button-text": "Clear All" + }, + "dnd": { + "text": "Do Not Disturb" + }, + "label": { + "max-lines": 5, + "text": "Label Text" + }, + "mpris": { + "image-size": 96, + "image-radius": 12 + }, + "buttons-grid": { + "actions": [ + { + "label": "яки", + "type": "toggle", + "active": true, + "command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'", + "update_command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'" + } + ] + } + } +} diff --git a/home/.config/swaync/style.css b/home/.config/swaync/style.css new file mode 100644 index 0000000..f6ac076 --- /dev/null +++ b/home/.config/swaync/style.css @@ -0,0 +1,611 @@ +@define-color cc-bg rgba(46, 46, 46, 0.7); +@define-color noti-border-color rgba(255, 255, 255, 0.15); +@define-color noti-bg rgba(48, 48, 48, 0.8); +@define-color noti-bg-opaque rgb(48, 48, 48); +@define-color noti-bg-darker rgb(38, 38, 38); +@define-color noti-bg-hover rgb(56, 56, 56); +@define-color noti-bg-hover-opaque rgb(56, 56, 56); +@define-color noti-bg-focus rgba(68, 68, 68, 0.6); +@define-color noti-close-bg rgba(255, 255, 255, 0.1); +@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15); +@define-color text-color rgb(255, 255, 255); +@define-color text-color-disabled rgb(150, 150, 150); +@define-color bg-selected rgb(0, 128, 255); +.notification-row { + outline: none; +} + +.notification-row:focus, +.notification-row:hover { + background: @noti-bg-focus; +} + +.notification-row .notification-background { + padding: 6px 12px; +} + +.notification-row .notification-background .close-button { + /* The notification Close Button */ + background: @noti-close-bg; + color: @text-color; + text-shadow: none; + padding: 0; + border-radius: 100%; + margin-top: 5px; + margin-right: 5px; + box-shadow: none; + border: none; + min-width: 24px; + min-height: 24px; +} + +.notification-row .notification-background .close-button:hover { + box-shadow: none; + background: @noti-close-bg-hover; + transition: background 0.15s ease-in-out; + border: none; +} + +.notification-row .notification-background .notification { + /* The actual notification */ + border-radius: 12px; + border: 1px solid @noti-border-color; + padding: 0; + transition: background 0.15s ease-in-out; + background: @noti-bg; +} + +.notification-row .notification-background .notification.low { + /* Low Priority Notification */ +} + +.notification-row .notification-background .notification.normal { + /* Normal Priority Notification */ +} + +.notification-row .notification-background .notification.critical { + /* Critical Priority Notification */ +} + +.notification-row .notification-background .notification .notification-action, +.notification-row + .notification-background + .notification + .notification-default-action { + padding: 4px; + margin: 0; + box-shadow: none; + background: transparent; + border: none; + color: @text-color; + transition: background 0.15s ease-in-out; +} + +.notification-row + .notification-background + .notification + .notification-action:hover, +.notification-row + .notification-background + .notification + .notification-default-action:hover { + -gtk-icon-effect: none; + background: @noti-bg-hover; +} + +.notification-row + .notification-background + .notification + .notification-default-action { + /* The large action that also displays the notification summary and body */ + border-radius: 12px; +} + +.notification-row + .notification-background + .notification + .notification-default-action:not(:only-child) { + /* When alternative actions are visible */ + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content { + background: transparent; + border-radius: 12px; + padding: 4px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .image { + /* Notification Primary Image */ + -gtk-icon-effect: none; + border-radius: 100px; + /* Size in px */ + margin: 4px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .app-icon { + /* Notification app icon (only visible when the primary image is set) */ + -gtk-icon-effect: none; + -gtk-icon-shadow: 0 1px 4px black; + margin: 6px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .text-box + .summary { + /* Notification summary/title */ + font-size: 16px; + font-weight: bold; + background: transparent; + color: @text-color; + text-shadow: none; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .text-box + .time { + /* Notification time-ago */ + font-size: 16px; + font-weight: bold; + background: transparent; + color: @text-color; + text-shadow: none; + margin-right: 30px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .text-box + .body { + /* Notification body */ + font-size: 15px; + font-weight: normal; + background: transparent; + color: @text-color; + text-shadow: none; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + progressbar { + /* The optional notification progress bar */ + margin-top: 4px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .body-image { + /* The "extra" optional bottom notification image */ + margin-top: 4px; + background-color: white; + border-radius: 12px; + -gtk-icon-effect: none; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .inline-reply { + /* The inline reply section */ + margin-top: 4px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .inline-reply + .inline-reply-entry { + background: @noti-bg-darker; + color: @text-color; + caret-color: @text-color; + border: 1px solid @noti-border-color; + border-radius: 12px; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .inline-reply + .inline-reply-button { + margin-left: 4px; + background: @noti-bg; + border: 1px solid @noti-border-color; + border-radius: 12px; + color: @text-color; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .inline-reply + .inline-reply-button:disabled { + background: initial; + color: @text-color-disabled; + border: 1px solid @noti-border-color; + border-color: transparent; +} + +.notification-row + .notification-background + .notification + .notification-default-action + .notification-content + .inline-reply + .inline-reply-button:hover { + background: @noti-bg-hover; +} + +.notification-row .notification-background .notification .notification-action { + /* The alternative actions below the default action */ + border-top: 1px solid @noti-border-color; + border-radius: 0px; + border-right: 1px solid @noti-border-color; +} + +.notification-row + .notification-background + .notification + .notification-action:first-child { + /* add bottom border radius to eliminate clipping */ + border-bottom-left-radius: 12px; +} + +.notification-row + .notification-background + .notification + .notification-action:last-child { + border-bottom-right-radius: 12px; + border-right: none; +} + +.notification-group { + /* Styling only for Grouped Notifications */ +} + +.notification-group.low { + /* Low Priority Group */ +} + +.notification-group.normal { + /* Low Priority Group */ +} + +.notification-group.critical { + /* Low Priority Group */ +} + +.notification-group .notification-group-buttons, +.notification-group .notification-group-headers { + margin: 0 16px; + color: @text-color; +} + +.notification-group .notification-group-headers { + /* Notification Group Headers */ +} + +.notification-group .notification-group-headers .notification-group-icon { + color: @text-color; +} + +.notification-group .notification-group-headers .notification-group-header { + color: @text-color; +} + +.notification-group .notification-group-buttons { + /* Notification Group Buttons */ +} + +.notification-group.collapsed .notification-row .notification { + background-color: @noti-bg-opaque; +} + +.notification-group.collapsed .notification-row:not(:last-child) { + /* Top notification in stack */ + /* Set lower stacked notifications opacity to 0 */ +} + +.notification-group.collapsed + .notification-row:not(:last-child) + .notification-action, +.notification-group.collapsed + .notification-row:not(:last-child) + .notification-default-action { + opacity: 0; +} + +.notification-group.collapsed:hover + .notification-row:not(:only-child) + .notification { + background-color: @noti-bg-hover-opaque; +} + +.control-center { + /* The Control Center which contains the old notifications + widgets */ + background: @cc-bg; + color: @text-color; + border-radius: 12px; +} + +.control-center .control-center-list-placeholder { + /* The placeholder when there are no notifications */ + opacity: 0.5; +} + +.control-center .control-center-list { + /* List of notifications */ + background: transparent; +} + +.control-center .control-center-list .notification { + box-shadow: + 0 0 0 1px rgba(0, 0, 0, 0.3), + 0 1px 3px 1px rgba(0, 0, 0, 0.7), + 0 2px 6px 2px rgba(0, 0, 0, 0.3); +} + +.control-center .control-center-list .notification .notification-default-action, +.control-center .control-center-list .notification .notification-action { + transition: + opacity 400ms ease-in-out, + background 0.15s ease-in-out; +} + +.control-center + .control-center-list + .notification + .notification-default-action:hover, +.control-center .control-center-list .notification .notification-action:hover { + background-color: @noti-bg-hover; +} + +.blank-window { + /* Window behind control center and on all other monitors */ + background: transparent; +} + +.floating-notifications { + background: transparent; +} + +.floating-notifications .notification { + box-shadow: none; +} + +/*** Widgets ***/ +/* Title widget */ +.widget-title { + color: @text-color; + margin: 8px; + font-size: 1.5rem; +} + +.widget-title > button { + font-size: initial; + color: @text-color; + text-shadow: none; + background: @noti-bg; + border: 1px solid @noti-border-color; + box-shadow: none; + border-radius: 12px; +} + +.widget-title > button:hover { + background: @noti-bg-hover; +} + +/* DND widget */ +.widget-dnd { + color: @text-color; + margin: 8px; + font-size: 1.1rem; +} + +.widget-dnd > switch { + font-size: initial; + border-radius: 12px; + background: @noti-bg; + border: 1px solid @noti-border-color; + box-shadow: none; +} + +.widget-dnd > switch:checked { + background: @bg-selected; +} + +.widget-dnd > switch slider { + background: @noti-bg-hover; + border-radius: 12px; +} + +/* Label widget */ +.widget-label { + margin: 8px; +} + +.widget-label > label { + font-size: 1.1rem; +} + +/* Mpris widget */ +@define-color mpris-album-art-overlay rgba(0, 0, 0, 0.55); +@define-color mpris-button-hover rgba(0, 0, 0, 0.50); +.widget-mpris { + /* The parent to all players */ +} + +.widget-mpris .widget-mpris-player { + padding: 8px; + padding: 16px; + margin: 16px 20px; + background-color: @mpris-album-art-overlay; + border-radius: 12px; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); +} + +.widget-mpris .widget-mpris-player button:hover { + /* The media player buttons (play, pause, next, etc...) */ + background: @noti-bg-hover; +} + +.widget-mpris .widget-mpris-player .widget-mpris-album-art { + border-radius: 12px; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); +} + +.widget-mpris .widget-mpris-player .widget-mpris-title { + font-weight: bold; + font-size: 1.25rem; +} + +.widget-mpris .widget-mpris-player .widget-mpris-subtitle { + font-size: 1.1rem; +} + +.widget-mpris .widget-mpris-player > box > button { + /* Change player control buttons */ +} + +.widget-mpris .widget-mpris-player > box > button:hover { + background-color: @mpris-button-hover; +} + +.widget-mpris > box > button { + /* Change player side buttons */ +} + +.widget-mpris > box > button:disabled { + /* Change player side buttons insensitive */ +} + +/* Buttons widget */ +.widget-buttons-grid { + padding: 8px; + margin: 8px; + border-radius: 12px; + background-color: @noti-bg; +} + +.widget-buttons-grid > flowbox > flowboxchild > button { + background: @noti-bg; + border-radius: 12px; +} + +.widget-buttons-grid > flowbox > flowboxchild > button.toggle:checked { + /* style given to the active toggle button */ +} + +/* Menubar widget */ +.widget-menubar > box > .menu-button-bar > button { + border: none; + background: transparent; +} + +/* .AnyName { Name defined in config after # + background-color: @noti-bg; + padding: 8px; + margin: 8px; + border-radius: 12px; +} + +.AnyName>button { + background: transparent; + border: none; +} + +.AnyName>button:hover { + background-color: @noti-bg-hover; +} */ +.topbar-buttons > button { + /* Name defined in config after # */ + border: none; + background: transparent; +} + +/* Volume widget */ +.widget-volume { + background-color: @noti-bg; + padding: 8px; + margin: 8px; + border-radius: 12px; +} + +.widget-volume > box > button { + background: transparent; + border: none; +} + +.per-app-volume { + background-color: @noti-bg-alt; + padding: 4px 8px 8px 8px; + margin: 0px 8px 8px 8px; + border-radius: 12px; +} + +/* Backlight widget */ +.widget-backlight { + background-color: @noti-bg; + padding: 8px; + margin: 8px; + border-radius: 12px; +} + +/* Inhibitors widget */ +.widget-inhibitors { + margin: 8px; + font-size: 1.5rem; +} + +.widget-inhibitors > button { + font-size: initial; + color: @text-color; + text-shadow: none; + background: @noti-bg; + border: 1px solid @noti-border-color; + box-shadow: none; + border-radius: 12px; +} + +.widget-inhibitors > button:hover { + background: @noti-bg-hover; +} diff --git a/home/.config/systemd/user/swaync.service b/home/.config/systemd/user/swaync.service new file mode 100644 index 0000000..e26d41e --- /dev/null +++ b/home/.config/systemd/user/swaync.service @@ -0,0 +1,10 @@ +[Unit] +Description="Swaync daemon" +PartOf=graphical-session.target + +[Service] +ExecStart=/usr/bin/swaync +Restart=on-failure + +[Install] +WantedBy=wayland-session.target diff --git a/home/.config/systemd/user/wm-ready.target.wants/dunst.service b/home/.config/systemd/user/wm-ready.target.wants/dunst.service deleted file mode 120000 index 5afdbc1..0000000 --- a/home/.config/systemd/user/wm-ready.target.wants/dunst.service +++ /dev/null @@ -1 +0,0 @@ -/home/itsdrike/.config/systemd/user/dunst.service \ No newline at end of file diff --git a/home/.local/bin/scripts/gui/hyprland/toggle-notifications b/home/.local/bin/scripts/gui/toggle-notifications similarity index 100% rename from home/.local/bin/scripts/gui/hyprland/toggle-notifications rename to home/.local/bin/scripts/gui/toggle-notifications diff --git a/install_gui.sh b/install_gui.sh index 2ab9ba5..43eacaa 100755 --- a/install_gui.sh +++ b/install_gui.sh @@ -47,7 +47,7 @@ cp -ra home/.config/wireplumber ~/.config cp -ra home/.config/alacritty ~/.config cp -ra home/.config/kitty ~/.config cp -ra home/.config/systemd ~/.config -cp -ra home/.config/dunst ~/.config +cp -ra home/.config/swaync ~/.config cp -ra home/.config/eww ~/.config cp -ra home/.config/hypr ~/.config cp home/.config/chromium-flags.conf ~/.config @@ -95,7 +95,7 @@ paru -S --noconfirm --needed \ # WM Essentials paru -S --noconfirm --needed \ - dunst udisks2 udiskie gvfs gvfs-mtp gnome-keyring xorg-xinput polkit-gnome brightnessctl + swaync udisks2 udiskie gvfs gvfs-mtp gnome-keyring xorg-xinput polkit-gnome brightnessctl # Wayland WM essentials paru -S --noconfirm --needed \ From ffd352074f7da9a9df7d9f3a8bb3f479d0c97504 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 03:58:13 +0100 Subject: [PATCH 2/6] Inhibit swaync when session is locked --- home/.config/hypr/hypridle.conf | 11 +++++------ .../lock.target.wants/swaync-inhibit-lock.service | 1 + home/.config/systemd/user/swaync-inhibit-lock.service | 11 +++++++++++ .../systemd/user/swaync-inhibit-unlock.service | 11 +++++++++++ .../unlock.target.wants/swaync-inhibit-unlock.service | 1 + 5 files changed, 29 insertions(+), 6 deletions(-) create mode 120000 home/.config/systemd/user/lock.target.wants/swaync-inhibit-lock.service create mode 100644 home/.config/systemd/user/swaync-inhibit-lock.service create mode 100644 home/.config/systemd/user/swaync-inhibit-unlock.service create mode 120000 home/.config/systemd/user/unlock.target.wants/swaync-inhibit-unlock.service diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf index df583f6..7feb48c 100644 --- a/home/.config/hypr/hypridle.conf +++ b/home/.config/hypr/hypridle.conf @@ -1,8 +1,8 @@ general { - unlock-cmd = killall -s SIGUSR1 hyprlock && dunstctl set-paused false - before_sleep_cmd = loginctl lock-session && dunstctl set-paused true && sleep 2 + unlock-cmd = killall -s SIGUSR1 hyprlock + before_sleep_cmd = loginctl lock-session ignore_dbus_inhibit = false ignore_systemd_inhibit = false; } @@ -10,16 +10,15 @@ general { # Warn about going idle (5 mins) listener { timeout = 300 - # use hyprland notifications, in case dunst notifs are paused or whatever + # use hyprland notifications, in case regular notifs are paused or whatever on-timeout = hyprctl notify 0 10000 "rgb(ff0000)" "fontsize:20 System going idle in 10 seconds..." on-resume = hyprctl dismissnotify 1 } -# Lock the session & disable dunst notifications +# Lock the session listener { timeout = 310 - on-timeout = loginctl lock-session && dunstctl set-paused true - on-resume = dunstctl set-paused false + on-timeout = loginctl lock-session } # Turn off the screen after another 50s diff --git a/home/.config/systemd/user/lock.target.wants/swaync-inhibit-lock.service b/home/.config/systemd/user/lock.target.wants/swaync-inhibit-lock.service new file mode 120000 index 0000000..bf1d322 --- /dev/null +++ b/home/.config/systemd/user/lock.target.wants/swaync-inhibit-lock.service @@ -0,0 +1 @@ +/home/itsdrike/.config/systemd/user/swaync-inhibit-lock.service \ No newline at end of file diff --git a/home/.config/systemd/user/swaync-inhibit-lock.service b/home/.config/systemd/user/swaync-inhibit-lock.service new file mode 100644 index 0000000..8361f71 --- /dev/null +++ b/home/.config/systemd/user/swaync-inhibit-lock.service @@ -0,0 +1,11 @@ +[Unit] +Description=Inhibit swaync notifications on lock dbus event (using systemd-lock-handler) +Requisite=swaync.service +Before=lock.target + +[Service] +ExecStart=/usr/bin/swaync-client --inhibitor-add screen-locker +Type=oneshot + +[Install] +WantedBy=lock.target diff --git a/home/.config/systemd/user/swaync-inhibit-unlock.service b/home/.config/systemd/user/swaync-inhibit-unlock.service new file mode 100644 index 0000000..6b36c81 --- /dev/null +++ b/home/.config/systemd/user/swaync-inhibit-unlock.service @@ -0,0 +1,11 @@ +[Unit] +Description=Uninhibit swaync notifications on unlock event +Requisite=swaync.service +After=unlock.target + +[Service] +ExecStart=/usr/bin/swaync-client --inhibitor-remove screen-locker +Type=oneshot + +[Install] +WantedBy=unlock.target diff --git a/home/.config/systemd/user/unlock.target.wants/swaync-inhibit-unlock.service b/home/.config/systemd/user/unlock.target.wants/swaync-inhibit-unlock.service new file mode 120000 index 0000000..5bf3a7d --- /dev/null +++ b/home/.config/systemd/user/unlock.target.wants/swaync-inhibit-unlock.service @@ -0,0 +1 @@ +/home/itsdrike/.config/systemd/user/swaync-inhibit-unlock.service \ No newline at end of file From 4b37fb8fb3fd502557942f1c2db2bc0b1012cc8f Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 04:37:44 +0100 Subject: [PATCH 3/6] Rewrite the hyprlock (systemd-lock-handler) service --- home/.config/hypr/hypridle.conf | 1 - home/.config/systemd/user/hyprlock.service | 17 +++++++++++++++++ .../user/lock.target.wants/hyprlock.service | 1 + .../systemd-lock-handler-hyprlock.service | 1 - .../user/systemd-lock-handler-hyprlock.service | 15 --------------- 5 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 home/.config/systemd/user/hyprlock.service create mode 120000 home/.config/systemd/user/lock.target.wants/hyprlock.service delete mode 120000 home/.config/systemd/user/lock.target.wants/systemd-lock-handler-hyprlock.service delete mode 100644 home/.config/systemd/user/systemd-lock-handler-hyprlock.service diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf index 7feb48c..ac2bfbd 100644 --- a/home/.config/hypr/hypridle.conf +++ b/home/.config/hypr/hypridle.conf @@ -1,7 +1,6 @@ general { - unlock-cmd = killall -s SIGUSR1 hyprlock before_sleep_cmd = loginctl lock-session ignore_dbus_inhibit = false ignore_systemd_inhibit = false; diff --git a/home/.config/systemd/user/hyprlock.service b/home/.config/systemd/user/hyprlock.service new file mode 100644 index 0000000..7e408c9 --- /dev/null +++ b/home/.config/systemd/user/hyprlock.service @@ -0,0 +1,17 @@ +[Unit] +Description=Run hyprlock screenlocker on lock dbus event (using systemd-lock-handler) +Requisite=wm-ready.target +# if hyprlock exists cleanly, enter a 'unlock' target +OnSuccess=unlock.target +# When lock.target is stopped, stop this unit too +PartOf=lock.target + +[Service] +ExecStart=/usr/bin/hyprlock +StandardOutput=journal +ExecStop=/bin/kill -s SIGUSR1 $MAINPID +ExecStopPost=/bin/loginctl unlock-session +Restart=on-failure + +[Install] +WantedBy=lock.target diff --git a/home/.config/systemd/user/lock.target.wants/hyprlock.service b/home/.config/systemd/user/lock.target.wants/hyprlock.service new file mode 120000 index 0000000..6db6455 --- /dev/null +++ b/home/.config/systemd/user/lock.target.wants/hyprlock.service @@ -0,0 +1 @@ +/home/itsdrike/.config/systemd/user/hyprlock.service \ No newline at end of file diff --git a/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-hyprlock.service b/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-hyprlock.service deleted file mode 120000 index 1e92b30..0000000 --- a/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-hyprlock.service +++ /dev/null @@ -1 +0,0 @@ -/home/itsdrike/.config/systemd/user/systemd-lock-handler-hyprlock.service \ No newline at end of file diff --git a/home/.config/systemd/user/systemd-lock-handler-hyprlock.service b/home/.config/systemd/user/systemd-lock-handler-hyprlock.service deleted file mode 100644 index 9cf81e7..0000000 --- a/home/.config/systemd/user/systemd-lock-handler-hyprlock.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Run hyprlock screenlocker on lock dbus event (using systemd-lock-handler) -# if swaylock exists cleanly, unlock this session -OnSuccess=unlock.target -# When lock.target is stopped, stop this too -PartOf=lock.target -# Delay lock.target until this service is ready -After=lock.target - -[Service] -ExecStart=/usr/bin/stdbuf -oL /usr/bin/hyprlock -Restart=on-failure - -[Install] -WantedBy=lock.target From 9931adaec52ec83001a77b74e4c767b3139bc84e Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 05:09:44 +0100 Subject: [PATCH 4/6] hypridle: Dim the screen & keyboard backlight --- home/.config/hypr/hypridle.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf index ac2bfbd..96fb218 100644 --- a/home/.config/hypr/hypridle.conf +++ b/home/.config/hypr/hypridle.conf @@ -14,6 +14,22 @@ listener { on-resume = hyprctl dismissnotify 1 } +# Dim the screen +listener { + timeout = 300 + # Set the brightness to minimum (not exactly to 0 though for OLED screens) + on-timeout = brightnessctl -s set 10 + on-resume = brightnessctl -r +} + +# Turn off keyboard backlight +listener { + timeout = 300 + # Attempt to find the keyboard backlight device, only proceeding if it exists + on-timeout = sh -c 'device=$(brightnessctl -l -m | grep -i kbd | cut -d"," -f1 | head -n 1) && [ -n "$device" ] && brightnessctl -s -d "$device" set 0' + on-resume = sh -c 'device=$(brightnessctl -l -m | grep -i kbd | cut -d"," -f1 | head -n 1) && [ -n "$device" ] && brightnessctl -r -d "$device"' +} + # Lock the session listener { timeout = 310 From 6fc5d3a03d12403e9919833c026a762b7c30af19 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 05:10:11 +0100 Subject: [PATCH 5/6] hypridle: fix typo - remove semicolon --- home/.config/hypr/hypridle.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf index 96fb218..63be9da 100644 --- a/home/.config/hypr/hypridle.conf +++ b/home/.config/hypr/hypridle.conf @@ -3,7 +3,7 @@ general { before_sleep_cmd = loginctl lock-session ignore_dbus_inhibit = false - ignore_systemd_inhibit = false; + ignore_systemd_inhibit = false } # Warn about going idle (5 mins) From 9e946c761115e32b56435ae0aacac43e1c89f892 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 22 Dec 2024 05:12:56 +0100 Subject: [PATCH 6/6] hyprlock: add disabled fingerprint reader support --- home/.config/hypr/hyprlock.conf | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/home/.config/hypr/hyprlock.conf b/home/.config/hypr/hyprlock.conf index 797fcc2..63d7392 100644 --- a/home/.config/hypr/hyprlock.conf +++ b/home/.config/hypr/hyprlock.conf @@ -8,6 +8,12 @@ general { grace = 3 } +auth { + pam:enabled = true + #fingerprint:enabled = true +} + + background { path = ~/Media/Pictures/Wallpapers/Categories/Extra/origami.png blur_passes = 3 @@ -123,6 +129,24 @@ label { valign = center } +# Fingerprint scan status +label { + text = $FPRINTMESSAGE + color = rgba(153, 153, 153, 1.0) # gray + + font_size = 14 + font_family = Noto Sans + + shadow_passes = 1 + shadow_size = 1 + shadow_boost = 1.0 + + position = 0, 0 + halign = center + valign = bottom +} + + # Splash text label { text = Session Locked @@ -189,7 +213,7 @@ label { color = rgba(129, 162, 190, 1.0) font_size = 11 font_family = Noto Sans - + shadow_passes = 1 shadow_size = 5 shadow_boost = 1.8