From ad4c186bff25ac3f8eca19d90626674db72886df Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sat, 29 Jul 2023 16:20:28 -0500 Subject: refactor: reorganize wayland/sway configs --- bemenu/.local/bin/powermenu | 32 +++++ i3status/.config/i3status-rust/config.toml | 134 +++++++++++++++++++++ sway/.config/i3status-rust/config.toml | 134 --------------------- sway/.config/sway/config | 4 +- sway/.config/systemd/user/clipman.service | 13 -- .../systemd/user/dunst.service.d/50-sway.conf | 7 -- sway/.config/systemd/user/sway-session.target | 6 +- sway/.config/yofi/yofi.config | 19 --- sway/.local/bin/powermenu | 32 ----- wayland/.config/systemd/user/clipman.service | 13 ++ .../systemd/user/dunst.service.d/50-wayland.conf | 7 ++ .../.config/systemd/user/wayland-session.target | 6 + 12 files changed, 198 insertions(+), 209 deletions(-) create mode 100755 bemenu/.local/bin/powermenu create mode 100644 i3status/.config/i3status-rust/config.toml delete mode 100644 sway/.config/i3status-rust/config.toml delete mode 100644 sway/.config/systemd/user/clipman.service delete mode 100644 sway/.config/systemd/user/dunst.service.d/50-sway.conf delete mode 100644 sway/.config/yofi/yofi.config delete mode 100755 sway/.local/bin/powermenu create mode 100644 wayland/.config/systemd/user/clipman.service create mode 100644 wayland/.config/systemd/user/dunst.service.d/50-wayland.conf create mode 100644 wayland/.config/systemd/user/wayland-session.target diff --git a/bemenu/.local/bin/powermenu b/bemenu/.local/bin/powermenu new file mode 100755 index 0000000..688ae3b --- /dev/null +++ b/bemenu/.local/bin/powermenu @@ -0,0 +1,32 @@ +#!/usr/bin/sh + +if [ "$#" -eq 0 ]; then + set -- $(awk '{print tolower($2)}') +fi + +case "$1" in +lock) + loginctl lock-session ${XDG_SESSION_ID-} + ;; +logout) + loginctl terminate-session ${XDG_SESSION_ID-} + ;; +suspend) + systemctl suspend + ;; +hibernate) + systemctl hibernate + ;; +reboot) + systemctl reboot + ;; +poweroff) + systemctl poweroff + ;; +*list) + printf '%s\n' '󰌾 Lock' '󰍃 Logout' '󰋊 Hibernate' '󰒲 Suspend' '󰜉 Reboot' '󰐥 Poweroff' + ;; +*) + echo "Invalid argument: $@" + ;; +esac diff --git a/i3status/.config/i3status-rust/config.toml b/i3status/.config/i3status-rust/config.toml new file mode 100644 index 0000000..23f71aa --- /dev/null +++ b/i3status/.config/i3status-rust/config.toml @@ -0,0 +1,134 @@ +# base16-i3status-rust (https://github.com/mystfox/base16-i3status-rust) +# Gruvbox dark, hard by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +[theme] +theme = "semi-native" + +[theme.overrides] +idle_bg = "#1d2021" +idle_fg = "#d5c4a1" +info_bg = "#8ec07c" +info_fg = "#1d2021" +good_bg = "#b8bb26" +good_fg = "#1d2021" +warning_bg = "#fabd2f" +warning_fg = "#1d2021" +critical_bg = "#fb4934" +critical_fg = "#1d2021" + +[icons] +icons = "material-nf" + +[icons.overrides] +cpu = "CPU" +memory_mem = "MEM" +cpu_boost_on = "BOOST" +cpu_boost_off = "" +disk_drive = "DISK" + +[[block]] +block = "focused_window" +[block.format] +full = " $title.str(max_w:30) |" +short = " $title.str(max_w:10) |" + +[[block]] +block = "weather" +autolocate = true +autolocate_interval = "once" +service.name = "metno" + +[[block]] +block = "disk_space" +format = " $available " +format_alt = " $icon $available / $total " + +[[block]] +block = "memory" +format = " $mem_avail.eng(u:B,p:M) " +format_alt = " $icon $mem_avail.eng(u:B,p:M) / $mem_total.eng(u:B,p:M) " + +[[block]] +block = "cpu" +format = " $utilization " +format_alt = " $icon $utilization $frequency {$boost |}" + +[[block]] +block = "maildir" +interval = 60 +inboxes = ["~/.local/share/mail/gmail/INBOX"] +threshold_warning = 1 +threshold_critical = 10 +display_type = "new" + +[[block]] +block = "music" +player = "spotifyd" +format = " $icon {$combo.str(max_w:20) $prev $play $next |}" + +[[block]] +block = "sound" +if_command = "pactl list >/dev/null || aplay -l >/dev/null " +[[block.click]] +button = "left" +cmd = "pavucontrol" + +[[block]] +block = "toggle" +format = " $icon " +if_command = "networkctl status wg0" +command_state = "cat /sys/class/net/wg0/carrier" +command_on = "sudo networkctl up wg0" +command_off = "sudo networkctl down wg0" +interval = 20 +merge_with_next = true + +[[block]] +block = "net" +device = "^wg0$" +format = " $icon " +format_alt = " $device {$ip |}" +missing_format = "" +merge_with_next = true + +[[block]] +block = "net" +device = "^wl.*$" +format = " $icon " +format_alt = " $device {$signal_strength $frequency $ssid |}{$ip |}" +missing_format = "" +merge_with_next = true + +[[block]] +block = "net" +device = "^en.*$" +format = " $icon " +format_alt = " $device {$ip |}" +missing_format = "" + +[[block]] +block = "battery" +device = "BAT1" +missing_format = "" +merge_with_next = true + +[[block]] +block = "battery" +device = "BAT2" +missing_format = "" + +[[block]] +block = "time" +interval = 1 +format.full = " $timestamp.datetime(f:'%a %m/%d %T') " +format.short = " $timestamp.datetime(f:%T) " + +[[block]] +block = "notify" +format = " $icon {($notification_count.eng(w:1)) |}" +[[block.click]] +button = "left" +action = "show" +[[block.click]] +button = "right" +action = "toggle_paused" diff --git a/sway/.config/i3status-rust/config.toml b/sway/.config/i3status-rust/config.toml deleted file mode 100644 index 23f71aa..0000000 --- a/sway/.config/i3status-rust/config.toml +++ /dev/null @@ -1,134 +0,0 @@ -# base16-i3status-rust (https://github.com/mystfox/base16-i3status-rust) -# Gruvbox dark, hard by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) - -[theme] -theme = "semi-native" - -[theme.overrides] -idle_bg = "#1d2021" -idle_fg = "#d5c4a1" -info_bg = "#8ec07c" -info_fg = "#1d2021" -good_bg = "#b8bb26" -good_fg = "#1d2021" -warning_bg = "#fabd2f" -warning_fg = "#1d2021" -critical_bg = "#fb4934" -critical_fg = "#1d2021" - -[icons] -icons = "material-nf" - -[icons.overrides] -cpu = "CPU" -memory_mem = "MEM" -cpu_boost_on = "BOOST" -cpu_boost_off = "" -disk_drive = "DISK" - -[[block]] -block = "focused_window" -[block.format] -full = " $title.str(max_w:30) |" -short = " $title.str(max_w:10) |" - -[[block]] -block = "weather" -autolocate = true -autolocate_interval = "once" -service.name = "metno" - -[[block]] -block = "disk_space" -format = " $available " -format_alt = " $icon $available / $total " - -[[block]] -block = "memory" -format = " $mem_avail.eng(u:B,p:M) " -format_alt = " $icon $mem_avail.eng(u:B,p:M) / $mem_total.eng(u:B,p:M) " - -[[block]] -block = "cpu" -format = " $utilization " -format_alt = " $icon $utilization $frequency {$boost |}" - -[[block]] -block = "maildir" -interval = 60 -inboxes = ["~/.local/share/mail/gmail/INBOX"] -threshold_warning = 1 -threshold_critical = 10 -display_type = "new" - -[[block]] -block = "music" -player = "spotifyd" -format = " $icon {$combo.str(max_w:20) $prev $play $next |}" - -[[block]] -block = "sound" -if_command = "pactl list >/dev/null || aplay -l >/dev/null " -[[block.click]] -button = "left" -cmd = "pavucontrol" - -[[block]] -block = "toggle" -format = " $icon " -if_command = "networkctl status wg0" -command_state = "cat /sys/class/net/wg0/carrier" -command_on = "sudo networkctl up wg0" -command_off = "sudo networkctl down wg0" -interval = 20 -merge_with_next = true - -[[block]] -block = "net" -device = "^wg0$" -format = " $icon " -format_alt = " $device {$ip |}" -missing_format = "" -merge_with_next = true - -[[block]] -block = "net" -device = "^wl.*$" -format = " $icon " -format_alt = " $device {$signal_strength $frequency $ssid |}{$ip |}" -missing_format = "" -merge_with_next = true - -[[block]] -block = "net" -device = "^en.*$" -format = " $icon " -format_alt = " $device {$ip |}" -missing_format = "" - -[[block]] -block = "battery" -device = "BAT1" -missing_format = "" -merge_with_next = true - -[[block]] -block = "battery" -device = "BAT2" -missing_format = "" - -[[block]] -block = "time" -interval = 1 -format.full = " $timestamp.datetime(f:'%a %m/%d %T') " -format.short = " $timestamp.datetime(f:%T) " - -[[block]] -block = "notify" -format = " $icon {($notification_count.eng(w:1)) |}" -[[block.click]] -button = "left" -action = "show" -[[block.click]] -button = "right" -action = "toggle_paused" diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 2057932..a4fbc09 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -139,7 +139,9 @@ mode 'resize' { bar { status_command i3status-rs - font "Fira Code Nerd Font" Normal 12 + font "Fira Code Nerd Font" Normal 15 + status_padding 0 + tray_padding 0 colors { background $base00 separator $base01 diff --git a/sway/.config/systemd/user/clipman.service b/sway/.config/systemd/user/clipman.service deleted file mode 100644 index 47155c8..0000000 --- a/sway/.config/systemd/user/clipman.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=A simple clipboard manager for Wayland -Documentation=man:clipman(1) -PartOf=sway-session.target -After=sway-session.target - -[Service] -Type=simple -ExecStart=/usr/bin/wl-paste --type text --watch clipman --notify store --no-persist --unix -Restart=on-failure - -[Install] -WantedBy=sway-session.target diff --git a/sway/.config/systemd/user/dunst.service.d/50-sway.conf b/sway/.config/systemd/user/dunst.service.d/50-sway.conf deleted file mode 100644 index 7dc167b..0000000 --- a/sway/.config/systemd/user/dunst.service.d/50-sway.conf +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -PartOf= -PartOf=sway-session.target -After=sway-session.target - -[Install] -WantedBy=sway-session.target diff --git a/sway/.config/systemd/user/sway-session.target b/sway/.config/systemd/user/sway-session.target index 5dc7c14..7093368 100644 --- a/sway/.config/systemd/user/sway-session.target +++ b/sway/.config/systemd/user/sway-session.target @@ -1,6 +1,6 @@ [Unit] Description=sway session Documentation=man:systemd.special(7) -BindsTo=graphical-session.target -Wants=graphical-session-pre.target -After=graphical-session-pre.target +BindsTo=wayland-session.target +Wants=wayland-session-pre.target +After=wayland-session-pre.target diff --git a/sway/.config/yofi/yofi.config b/sway/.config/yofi/yofi.config deleted file mode 100644 index 34f3ae3..0000000 --- a/sway/.config/yofi/yofi.config +++ /dev/null @@ -1,19 +0,0 @@ -font = "DejaVu Sans" -# font = "Fira Code Nerd Font" - -bg_color = 0x282828aa - -[input_text] -font_color = 0xf8f8f2ff -bg_color = 0x75715eff - -[list_items] -font_color = 0xebdbb2ff -selected_font_color = 0xfe8019ff -# match_color = 0xd65d0eff -# hide_actions = true - -[icon] -size = 16 -theme = "Adwaita" -fallback_icon_path = "/usr/share/icons/Adwaita/16x16/categories/applications-engineering-symbolic.symbolic.png" diff --git a/sway/.local/bin/powermenu b/sway/.local/bin/powermenu deleted file mode 100755 index 688ae3b..0000000 --- a/sway/.local/bin/powermenu +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/sh - -if [ "$#" -eq 0 ]; then - set -- $(awk '{print tolower($2)}') -fi - -case "$1" in -lock) - loginctl lock-session ${XDG_SESSION_ID-} - ;; -logout) - loginctl terminate-session ${XDG_SESSION_ID-} - ;; -suspend) - systemctl suspend - ;; -hibernate) - systemctl hibernate - ;; -reboot) - systemctl reboot - ;; -poweroff) - systemctl poweroff - ;; -*list) - printf '%s\n' '󰌾 Lock' '󰍃 Logout' '󰋊 Hibernate' '󰒲 Suspend' '󰜉 Reboot' '󰐥 Poweroff' - ;; -*) - echo "Invalid argument: $@" - ;; -esac diff --git a/wayland/.config/systemd/user/clipman.service b/wayland/.config/systemd/user/clipman.service new file mode 100644 index 0000000..5008c39 --- /dev/null +++ b/wayland/.config/systemd/user/clipman.service @@ -0,0 +1,13 @@ +[Unit] +Description=A simple clipboard manager for Wayland +Documentation=man:clipman(1) +PartOf=wayland-session.target +After=wayland-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/wl-paste --type text --watch clipman --notify store --no-persist --unix +Restart=on-failure + +[Install] +WantedBy=wayland-session.target diff --git a/wayland/.config/systemd/user/dunst.service.d/50-wayland.conf b/wayland/.config/systemd/user/dunst.service.d/50-wayland.conf new file mode 100644 index 0000000..c66af48 --- /dev/null +++ b/wayland/.config/systemd/user/dunst.service.d/50-wayland.conf @@ -0,0 +1,7 @@ +[Unit] +PartOf= +PartOf=wayland-session.target +After=wayland-session.target + +[Install] +WantedBy=wayland-session.target diff --git a/wayland/.config/systemd/user/wayland-session.target b/wayland/.config/systemd/user/wayland-session.target new file mode 100644 index 0000000..2c0630f --- /dev/null +++ b/wayland/.config/systemd/user/wayland-session.target @@ -0,0 +1,6 @@ +[Unit] +Description=wayland session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target -- cgit v1.2.3-70-g09d2