From d8c2da70a986ae9eb93638dc64ccc7517afcfe26 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Wed, 23 Apr 2025 22:44:41 +0100 Subject: [PATCH] MOAR config --- home/dot_config/sway/config.tmpl | 37 ++++------------------ home/dot_config/sway/executable_power-menu | 23 ++++++++++++++ home/dot_config/sway/pkglist.txt | 15 +++++++++ home/dot_config/swayidle/config | 3 ++ home/dot_config/swaylock/config | 3 ++ home/dot_config/waybar/config.jsonc | 11 ++----- home/dot_config/waybar/style.css | 10 +++++- 7 files changed, 61 insertions(+), 41 deletions(-) create mode 100644 home/dot_config/sway/executable_power-menu create mode 100644 home/dot_config/sway/pkglist.txt create mode 100644 home/dot_config/swayidle/config create mode 100644 home/dot_config/swaylock/config diff --git a/home/dot_config/sway/config.tmpl b/home/dot_config/sway/config.tmpl index e133b0f..4dfae01 100644 --- a/home/dot_config/sway/config.tmpl +++ b/home/dot_config/sway/config.tmpl @@ -76,33 +76,12 @@ include /etc/sway/config-vars.d/* ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill -# -# Example configuration: -# -# output HDMI-A-1 resolution 1920x1080 position 1920,0 -# -# You can get the names of your outputs by running: swaymsg -t get_outputs +set $bg /usr/share/backgrounds/archlinux/wild.png +output * bg $bg fill + ### Idle configuration -# -# Example configuration: -# -# exec swayidle -w \ -# timeout 300 'swaylock -f -c 000000' \ -# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ -# before-sleep 'swaylock -f -c 000000' -# -# This will lock your screen after 300 seconds of inactivity, then turn off -# your displays after another 300 seconds, and turn your screens back on when -# resumed. It will also lock your screen before your computer goes to sleep. - - - -exec swayidle -w \ -timeout 300 "swaylock -e -f -i ~/Pictures/Backgrounds/DSC02113.jpg" \ - timeout 600 'systemctl suspend' \ - before-sleep "swaylock -e -f -i ~/Pictures/Backgrounds/DSC02113.jpg" +exec swayidle -w ### Input configuration @@ -175,7 +154,7 @@ input 1241:36:HOLDCHIP_USB_Keyboard { bindsym $mod+Shift+c reload # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + bindsym $mod+Shift+e exec ~/.config/sway/power-menu # # Moving around: # @@ -318,7 +297,7 @@ mode "resize" { } bindsym $mod+r mode "resize" -bindsym $mod+Alt+l exec 'swaylock -e -f -i ~/Pictures/Backgrounds/DSC02113.jpg' +bindsym $mod+Alt+l exec swaylock include /etc/sway/config.d/* @@ -340,13 +319,11 @@ exec mako& {{- if eq .chezmoi.hostname "baryte" }} output "Acer Technologies VG270U P 0x05217924" { - background ~/Pictures/Backgrounds/DSC02111.jpg fill position 0 0 scale 1 } output "Acer Technologies VG270U P 0x9392CFAC" { - background ~/Pictures/Backgrounds/DSC02111.jpg fill position 2560 0 scale 1 } @@ -362,13 +339,11 @@ exec kanshi& {{- if eq .chezmoi.hostname "dubnium" }} output "Acer Technologies VG270U P 0x05217924" { - background ~/Pictures/background.jpg fill position 0 0 scale 1 } output "Acer Technologies VG270U P 0x9392CFAC" { - background ~/Pictures/background.jpg fill position 2560 0 scale 1 } diff --git a/home/dot_config/sway/executable_power-menu b/home/dot_config/sway/executable_power-menu new file mode 100644 index 0000000..f2d4409 --- /dev/null +++ b/home/dot_config/sway/executable_power-menu @@ -0,0 +1,23 @@ +#!/bin/bash + +entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown\n Lock" + +selected=$(echo -e $entries | wofi --dmenu --cache-file /dev/null | awk '{print tolower($2)}') + +case $selected in +lock) + swaylock + ;; +logout) + swaymsg exit + ;; +suspend) + exec systemctl suspend + ;; +reboot) + exec systemctl reboot + ;; +shutdown) + exec systemctl poweroff -i + ;; +esac diff --git a/home/dot_config/sway/pkglist.txt b/home/dot_config/sway/pkglist.txt new file mode 100644 index 0000000..990690d --- /dev/null +++ b/home/dot_config/sway/pkglist.txt @@ -0,0 +1,15 @@ +archlinux-wallpaper +scenefx +swayfx +swayidle +swaylock +swaybg +mako +waybar +wofi +kanshi +foot +firefox +pavucontrol +blueman +btop diff --git a/home/dot_config/swayidle/config b/home/dot_config/swayidle/config new file mode 100644 index 0000000..c34a00e --- /dev/null +++ b/home/dot_config/swayidle/config @@ -0,0 +1,3 @@ +timeout 300 swaylock +timeout 900 'systemctl suspend' +before-sleep swaylock diff --git a/home/dot_config/swaylock/config b/home/dot_config/swaylock/config new file mode 100644 index 0000000..ebfc4ca --- /dev/null +++ b/home/dot_config/swaylock/config @@ -0,0 +1,3 @@ +ignore-empty-password +daemonize +image=/usr/share/backgrounds/archlinux/geolanes.png diff --git a/home/dot_config/waybar/config.jsonc b/home/dot_config/waybar/config.jsonc index 71d68c4..7b0972f 100644 --- a/home/dot_config/waybar/config.jsonc +++ b/home/dot_config/waybar/config.jsonc @@ -234,15 +234,8 @@ "on-click": "playerctl previous" }, "custom/power": { - "format": "⏻ ", + "format": "⏻", "tooltip": false, - "menu": "on-click", - "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder - "menu-actions": { - "shutdown": "shutdown", - "reboot": "reboot", - "suspend": "systemctl suspend", - "hibernate": "systemctl hibernate" - } + "on-click": "$HOME/.config/sway/power-menu" } } diff --git a/home/dot_config/waybar/style.css b/home/dot_config/waybar/style.css index c7c75ef..5f9a47a 100644 --- a/home/dot_config/waybar/style.css +++ b/home/dot_config/waybar/style.css @@ -100,6 +100,7 @@ button:hover { #idle_inhibitor, #scratchpad, #power-profiles-daemon, +#custom-power, #mpd { padding: 0 10px; color: #ffffff; @@ -126,7 +127,10 @@ button:hover { .modules-right, .modules-left { border-radius: 15px; - padding: 7px; + padding-left: 12px; + padding-right: 12px; + padding-top: 7px; + padding-bottom: 7px; } #clock { @@ -242,6 +246,10 @@ label:focus { background-color: #ffa000; } +#custom-power { + background-color: #2d3436; +} + #temperature { background-color: #f0932b; }