aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-02-13 00:35:29 +0000
committerLeonardo Bishop <me@leonardobishop.com>2025-02-13 00:35:29 +0000
commit0351672b509d3db2074474641bf23b2a1a5894f1 (patch)
tree80f303738e42aacfb23100ccb5e74c21e214c893
parent0e05994530deb53982ee8559c9fbf99845e15ee7 (diff)
Change screenlocker and update screenshot program
-rwxr-xr-xbin/exit-menu-sway.sh9
-rw-r--r--hyprland/hyprlock.conf18
-rw-r--r--sway/conf.d/01-system-vars.conf11
-rw-r--r--sway/conf.d/10-environment.conf4
-rw-r--r--sway/conf.d/20-binds.conf8
-rw-r--r--sway/conf.d/21-rules.conf97
-rw-r--r--systemd/system-user/swayidle.service6
7 files changed, 137 insertions, 16 deletions
diff --git a/bin/exit-menu-sway.sh b/bin/exit-menu-sway.sh
index 9c9f7ab..bd48e92 100755
--- a/bin/exit-menu-sway.sh
+++ b/bin/exit-menu-sway.sh
@@ -1,18 +1,17 @@
#!/bin/bash
-entries=" Lock\n󰹆 Suspend\n󰹆 Suspend-then-Hibernate\n󰒲 Hibernate\n󰍃 Logout\n󰜉 Reboot\n󰐥 Shutdown"
+#entries=" Lock\n󰹆 Suspend\n󰹆 Suspend-then-Hibernate\n󰒲 Hibernate\n󰍃 Logout\n󰜉 Reboot\n󰐥 Shutdown"
+entries=" Lock\n󰹆 Suspend\n󰒲 Hibernate\n󰍃 Logout\n󰜉 Reboot\n󰐥 Shutdown"
selected=$(echo -e $entries|wofi --width 100 --height 212 --dmenu --cache-file /dev/null --define content_halign=center --define prompt="Exit menu" | awk '{print tolower($2)}')
case $selected in
lock)
- swaylock;;
+ hyprlock;;
logout)
hyprctl dispatch exit;;
- suspend-then-hibernate)
- exec systemctl suspend-then-hibernate;;
suspend)
- exec systemctl suspend;;
+ exec systemctl suspend-then-hibernate;;
hibernate)
exec systemctl hibernate;;
reboot)
diff --git a/hyprland/hyprlock.conf b/hyprland/hyprlock.conf
index bcaa496..575a504 100644
--- a/hyprland/hyprlock.conf
+++ b/hyprland/hyprlock.conf
@@ -18,6 +18,22 @@ general {
fractional_scaling = 0
}
+auth {
+ fingerprint:enabled = true
+ fingerprint:ready_message = <i>Enter password or scan fingerprint</i>
+}
+
+# INPUT FIELD
+label {
+ text = $FPRINTPROMPT
+ color = rgba(255, 255, 255, 0.8)
+ font_size = 20
+ font_family = Iosevka Nerd Font
+ position = 0, -60
+ halign = center
+ valign = center
+}
+
# INPUT FIELD
input-field {
size = 300, 50
@@ -35,7 +51,7 @@ input-field {
placeholder_text = <i><span foreground="##cdd6f4">Password</span></i>
fail_text = $FAIL
hide_input = false
- position = 0, -120
+ position = 0, -140
halign = center
valign = center
}
diff --git a/sway/conf.d/01-system-vars.conf b/sway/conf.d/01-system-vars.conf
index f93a6ac..c02e223 100644
--- a/sway/conf.d/01-system-vars.conf
+++ b/sway/conf.d/01-system-vars.conf
@@ -1,7 +1,10 @@
-set $screenshot_area /usr/bin/grimshot --notify save area - | swappy -f -
-set $screenshot_area_clipboard /usr/bin/grimshot --notify copy area
-set $screenshot_screen /usr/bin/grimshot --notify save screen - | swappy -f -
-set $screenshot_screen_clipboard /usr/bin/grimshot --notify copy screen
+#set $screenshot_area env XDG_CURRENT_DESKTOP=Sway /usr/bin/flameshot gui
+set $screenshot_area /usr/bin/grim -t ppm - | /usr/bin/satty --fullscreen --early-exit --copy-command "wl-copy" -f -
+#set $screenshot_area /usr/bin/shotman -C -a top-right --capture region
+#set $screenshot_window /usr/bin/shotman -C -a top-right ---capture window
+#set $screenshot_screen /usr/bin/shotman -C -a top-right ---capture output
+
+set $clipboard_hist cliphist list | wofi -S dmenu | cliphist decode | wl-copy
set $sink_volume pactl get-sink-volume @DEFAULT_SINK@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//'
set $sink_volume_mute pactl get-sink-mute @DEFAULT_SINK@ | sed -En "/no/ s/.*/$($sink_volume)/p; /yes/ s/.*/0/p"
diff --git a/sway/conf.d/10-environment.conf b/sway/conf.d/10-environment.conf
index 3c97e57..758d3a8 100644
--- a/sway/conf.d/10-environment.conf
+++ b/sway/conf.d/10-environment.conf
@@ -1,5 +1,9 @@
exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target"
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
+exec wl-paste --type text --watch cliphist store
+exec wl-paste --type image --watch cliphist store
+
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
#exec --no-startup-id /usr/lib/polkit-kde-authentication-agent-1
+
diff --git a/sway/conf.d/20-binds.conf b/sway/conf.d/20-binds.conf
index 02f032e..f4a4246 100644
--- a/sway/conf.d/20-binds.conf
+++ b/sway/conf.d/20-binds.conf
@@ -92,11 +92,15 @@ bindsym $mod+a focus parent
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
+bindsym $mod+c exec $clipboard_hist
+# Clipboard history
+
# Screenshot
bindsym Print exec $screenshot_area
-bindsym Print+Alt exec $screenshot_area_clipboard
+#bindsym Print+Alt exec $screenshot_area_clipboard
bindsym Print+Shift exec $screenshot_screen
-bindsym Print+Shift+Alt exec $screenshot_screen_clipboard
+bindsym Print+Alt exec $screenshot_window
+#bindsym Print+Shift+Alt exec $screenshot_screen_clipboard
# Audio
# bindsym $mod+bracketleft exec pactl set-sink-volume @DEFAULT_SINK@ -5%
diff --git a/sway/conf.d/21-rules.conf b/sway/conf.d/21-rules.conf
index 93feec7..8397f09 100644
--- a/sway/conf.d/21-rules.conf
+++ b/sway/conf.d/21-rules.conf
@@ -21,5 +21,100 @@ for_window [app_id="(?i)Thunderbird" title=".*Reminder"] floating enable
for_window [app_id="Zoom Workplace" title="^zoom$"] border none, floating enable
for_window [app_id="Zoom Workplace" title="^(Zoom|About)$"] border pixel, floating enable
-for_window [app_id=".*"] border normal
for_window [app_id="^chrome-.*-.*$"] shortcuts_inhibitor disable
+
+for_window [shell="xwayland"] title_format "[XWayland] %title"
+
+# stolen from https://gitlab.com/that1communist/dotfiles/-/blob/master/.config/sway/modules/win-rules ...
+#set the variables
+set {
+ $ii inhibit_idle focus
+ $popup floating enable; sticky enable
+ $float floating enable;
+ $video inhibit_idle fullscreen; max_render_time off
+ $important inhibit_idle open; floating enable;
+ $max inhibit_idle visible; floating enable; sticky enable;
+}
+for_window {
+#ii - inhibit_idle focus
+ [class="Cemu"] $ii
+ [instance="cemu"] $ii
+ [app_id="cemu"] $ii
+ [app_id="rpcs3"] $ii
+ [app_id="yuzu"] $ii
+ [class="yuzu"] $ii
+ [app_id="snes9x-gtk"] $ii
+
+#popup - floating enable; sticky enable
+ [app_id="firefox" title="^Picture-in-Picture$"] $popup
+ [app_id="stoken-gui"] $popup
+ [app_id="org.twosheds.iwgtk"] $popup
+ [app_id="iwgtk"] $popup
+ [app_id="ksysguard"] $popup
+ [app_id="net.nokyan.Resources"] $popup
+ [app_id="galculator"] $popup
+ [title="(?:Open|Save) (?:File|Folder|As)" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
+ [title="^(File|Folder)\s*Already Exists\s*—\s*" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
+ [title="Confirm to replace files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
+ [app_id="pavucontrol"] $popup
+ [app_id="qtalarm"] $popup
+ [app_id="deluge" title="Add Torrents*"] $popup
+
+#float - floating enable; border pixel 1
+ [app_id="org.telegram.desktop"] $float; blur off; inhibit_idle open
+ [app_id="com.github.weclaw1.ImageRoll"] $float
+ [app_id="teams-for-linux"] $float
+ [class="teams-for-linux"] $float
+ [instance="teams-for-linux"] $float
+ [app_id="org.gnome.Loupe"] $float
+ [instance="yakyak"] $float
+ [class="Microsoft Teams - Preview"] $float
+ [class="teams-for-linux"] $float
+ [class="Microsoft Teams - Insiders"] $float
+ [app_id="Alacritty_floating"] $float
+ [title="^Information\s*—\s*Dolphin" app_id="dolphin"] $float
+ [title="^Loading archive" app_id="org.kde.ark"] $float
+ [instance="crx_nckgahadagoaajjgafhacjanaoiihapd"] $float
+ [title="Preferences" app_id="pcmanfm-qt"] $float
+ [title="File Properties" app_id="pcmanfm-qt"] $float
+ [title="^Extension: .* Firefox Developer Edition$"] $float
+ [app_id="anki"] $float
+ [window_role="pop-up,task_dialog,About,bubble"] $float
+ [window_type="dialog"] $float
+ [window_type="utility"] $float
+ [window_type="toolbar"] $float
+ [window_type="splash"] $float
+ [window_type="menu"] $float
+ [window_type="dropdown_menu"] $float
+ [window_type="popup_menu"] $float
+ [window_type="tooltip"] $float
+ [window_type="notification"] $float
+
+#video - inhibit_idle fullscreen; border none; max_render_time off
+ [instance="chromium"] $video
+ [app_id="mpv"] $video
+ [app_id="vlc"] $video
+ [class="firefox"] $video
+ [app_id="firefox"] $video
+ [class="Nightly"] $video
+
+#important - inhibit_idle open; floating enable; border pixel 1
+ [title="Move files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
+ [title="^(Copying|Moving)\s*—\s*Dolphin" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
+ [title="^Extracting\s" app_id="(dolphin|org.kde.ark)"] $important
+ [title="Copy Files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
+ [title="Delete Files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
+ [title="Removable medium is inserted" app_id="pcmanfm|pcmanfm-qt"] $important
+ [title="Compressing (.*) — Ark" app_id="org.kde.ark"] $important; resize set width 18 ppt
+
+#misc
+ [class="steam"] floating enable; max_render_time off
+ [instance="steamwebhelper"] floating enable; max_render_time off
+ [app_id="org.telegram.desktop" title="Telegram"] floating disable; inhibit_idle none
+ [urgent=latest] focus
+ [app_id="firefox" title="Firefox — Sharing Indicator"] floating enable; kill
+ [title="Wine System Tray"] floating enable; kill
+}
+no_focus [app_id="at.yrlf.wl_mirror"]
+
+for_window [app_id=".*"] border normal
diff --git a/systemd/system-user/swayidle.service b/systemd/system-user/swayidle.service
index ce9f7e3..f5d223a 100644
--- a/systemd/system-user/swayidle.service
+++ b/systemd/system-user/swayidle.service
@@ -7,9 +7,9 @@ PartOf=graphical-session.target
Type=simple
ExecStart=/usr/bin/swayidle -w \
timeout 300 "notify-send 'Power' 'System will suspend very soon due to inactivity.'" \
- timeout 315 "swaylock" \
- timeout 320 "swaymsg 'output * power off'" resume "swaymsg 'output * power on'" \
- before-sleep "swaylock"
+ timeout 315 "hyprlock" \
+ timeout 320 "sytemctl suspend && swaymsg 'output * power off'" resume "swaymsg 'output * power on'" \
+ before-sleep "hyprlock"
[Install]