From ceaf04e7b1ee25594f0e6db1761786e338159ae6 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 21:40:16 -0400 Subject: [PATCH 01/12] =?UTF-8?q?feat(waybar):=20update=20pulseaudio=20mod?= =?UTF-8?q?ule=20*=20Set=20`scroll-step`=20to=202=20and=20remove=20`on-scr?= =?UTF-8?q?oll-up`/`on-scroll-down`=20action=20(which=20is=20doing=20the?= =?UTF-8?q?=20same=20thing)=20*=20Format=20as=20icon|volume=20instead=20of?= =?UTF-8?q?=20volume|icon=20for=20consistency=20with=20other=20modules=20*?= =?UTF-8?q?=20Remove=20`format-source`=20settings=20since=20it=20seems=20t?= =?UTF-8?q?o=20be=20set=20up=20inconsistently.=20This=20feature=20also=20b?= =?UTF-8?q?ehaves=20oddly=20by=20default=20(for=20example,=20it=20cannot?= =?UTF-8?q?=20have=20an=20on-click=20or=20scroll=20behavior=20independent?= =?UTF-8?q?=20from=20volume--kind=20of=20unintuitive).=20If=20a=20user=20w?= =?UTF-8?q?ants=20to=20use=20this=20feature=20it=20will=20likely=20work=20?= =?UTF-8?q?better=20to=20break=20out=20source=20into=20a=20separate=20modu?= =?UTF-8?q?le=20like=20this:=20https://github.com/Alexays/Waybar/issues/92?= =?UTF-8?q?5#issuecomment-1377761376=20*=20Remove=20`format-bluetooth`=20s?= =?UTF-8?q?ettings=20since=20it=20is=20not=20defining=20a=20different=20be?= =?UTF-8?q?havior=20after=20removing=20`format-source`=20*=20Replaced=20?= =?UTF-8?q?=EF=9A=A9,=20=EF=AA=80,=20=EF=9F=8A,=20and=20=EF=9F=8D=20icons?= =?UTF-8?q?=20since=20they=20are=20all=20depreciated/removed=20from=20Nerd?= =?UTF-8?q?=20Font=20icon=20set=20*=20Added=20additional=20icons=20to=20`d?= =?UTF-8?q?efault`=20to=20have=20different=20icons=20for=20low,=20medium,?= =?UTF-8?q?=20and=20high=20volume=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/waybar/config | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.config/waybar/config b/.config/waybar/config index 14b6e75..c7bf5bc 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -139,25 +139,19 @@ }, "pulseaudio": { - "scroll-step": 1, // %, can be a float - "format": "{volume}% {icon}", - "format-bluetooth": "{volume}% {icon}  {format_source}", - "format-bluetooth-muted": " {icon}  {format_source}", - "format-muted": "婢 {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", + "scroll-step": 2, + "format": "{icon} {volume}%", + "format-muted":"󰝟 muted", "format-icons": { - "headphone": "", - "hands-free": "וֹ", - "headset": "  ", + "headphones": "", + "handsfree": "", + "headset": "", "phone": "", "portable": "", "car": "", - "default": [""] + "default": ["󰕿", "󰖀", "󰕾"] }, - "on-click": "pavucontrol", - "on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +2%", - "on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -2%", + "on-click": "pavucontrol" }, // to use the weather module replace with your city or town From 8234c3750c2356a0b0894f8fb89403011a9b232a Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 21:45:02 -0400 Subject: [PATCH 02/12] =?UTF-8?q?feat(waybar):=20update=20battery=20module?= =?UTF-8?q?=20*=20Remove=20`format-charging`=20and=20`format-plugged`=20se?= =?UTF-8?q?ttings=20in=20favor=20of=20just=20using=20the=20graduated=20bat?= =?UTF-8?q?tery=20level=20icons.=20Also=20=EF=97=A7=20is=20a=20depreciated?= =?UTF-8?q?/removed=20Nerd=20Font=20icon.=20If=20we=20want=20to=20visually?= =?UTF-8?q?=20differentiate=20the=20charging=20state,=20CSS=20rules=20in?= =?UTF-8?q?=20`~/.config/waybar/style.css`=20might=20be=20a=20better=20way?= =?UTF-8?q?=20to=20handle=20that.=20*=20Remove=20the=20commented=20lines?= =?UTF-8?q?=20because=20it=20is=20unlikely=20we=20will=20ever=20want=20the?= =?UTF-8?q?se=20specific=20settings.=20*=20Remove=20PBPbattery=20module=20?= =?UTF-8?q?and=20associated=20script.=20It=20is=20all=20commented=20out=20?= =?UTF-8?q?anyway.=20This=20feature=20has=20been=20built-in=20to=20Waybar?= =?UTF-8?q?=20for=20some=20time=20now;=20a=20custom=20script=20is=20no=20l?= =?UTF-8?q?onger=20needed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/waybar/config | 15 ++------------- .config/waybar/scripts/PBPbattery.sh | 21 --------------------- .config/waybar/style.css | 3 +-- 3 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 .config/waybar/scripts/PBPbattery.sh diff --git a/.config/waybar/config b/.config/waybar/config index c7bf5bc..68a8c43 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -23,7 +23,6 @@ "pulseaudio", "custom/keyboard-layout", "battery", - //"custom/PBPbattery", "backlight#icon", "backlight#value", "clock", @@ -41,26 +40,16 @@ "deactivated": "" } }, - + "battery": { "states": { - // "good": 95, "warning": 30, "critical": 15 }, - "format": "{capacity}% {icon}", - "format-charging": "{capacity}% ", - "format-plugged": "{capacity}% ", - // "format-good": "", // An empty format will hide the module - // "format-full": "", + "format": "{icon} {capacity}%", "format-icons": ["", "", "", "", ""] }, - "custom/PBPbattery": { - "exec": "~/.config/waybar/scripts/PBPbattery.sh", - "format": "{}", - }, - "clock": { "interval": 10, "format-alt": " {:%e %b %Y}", // Icon: calendar-alt diff --git a/.config/waybar/scripts/PBPbattery.sh b/.config/waybar/scripts/PBPbattery.sh deleted file mode 100644 index 1cf34da..0000000 --- a/.config/waybar/scripts/PBPbattery.sh +++ /dev/null @@ -1,21 +0,0 @@ - -#!/bin/bash -#simple Shellscript for waybar/i3blocks/polybar on Pinebook pro -#05012020 geri123@gmx.net Gerhard S. - -PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity) -STATUS=$(cat /sys/class/power_supply/cw2015-battery/status) -case $(( - $PERCENT >= 0 && $PERCENT <= 20 ? 1 : - $PERCENT > 20 && $PERCENT <= 40 ? 2 : - $PERCENT > 40 && $PERCENT <= 60 ? 3 : - $PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in -# - (1) echo $STATUS:"":$PERCENT%;; - (2) echo $STATUS:"":$PERCENT%;; - (3) echo $STATUS:"":$PERCENT%;; - (4) echo $STATUS:"":$PERCENT%;; - (5) echo $STATUS:"":$PERCENT%;; -esac - - diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 938ff1f..09b3977 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -73,8 +73,7 @@ Arc-Dark Color Scheme #pulseaudio, #temperature, #tray, -#idle_inhibitor, -#custom-PBPbattery { +#idle_inhibitor { padding:0.5rem 0.6rem; margin: 1px 0px; } From a255d713404fe6cd9e5438e978f9e2e80704cfdf Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 21:47:12 -0400 Subject: [PATCH 03/12] feat(waybar): change rocket icon to eos logo Change the icon of the launcher module from a rocket to the EOS logo. --- .config/waybar/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/waybar/config b/.config/waybar/config index 68a8c43..9a3871d 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -188,7 +188,7 @@ }, "custom/launcher": { - "format":" ", + "format":"", "on-click": "exec wofi -c ~/.config/wofi/config -I", "tooltip": false, }, From 3a740207039ca7b16d989d8ffbdcdd41e20613e1 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 21:55:37 -0400 Subject: [PATCH 04/12] feat(waybar): add sway/window to modules-left Add sway/window module next to workspaces. It prints the title of the focused window in the Waybar. --- .config/waybar/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/waybar/config b/.config/waybar/config index 9a3871d..73e0d23 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -10,6 +10,7 @@ "custom/launcher", "sway/workspaces", "sway/mode", + "sway/window", ], "modules-center": [ From 678c3a1fcbfccdbdaf383650ae2478b6933f3826 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:00:22 -0400 Subject: [PATCH 05/12] feat(screenshots): add swappy, add screenshot scripts and keybindings * Add [swappy](https://github.com/jtheoof/swappy) for handling screenshots. It's a nice Flameshot-like tool that allows adding simple annotations (drawing circles, arrows, text, etc) to screenshots and can save to file or pass to the clipboard. * Add keybindings for "snip", screenshot window, and screenshot current display. * Add scripts for the screenshot window and screenshot current display functions. * `packages-repository.txt` has also been alphabetically sorted to make it easier to work with. --- .config/sway/config.d/default | 8 ++++++-- .config/sway/scripts/screenshot.sh | 18 ------------------ .config/sway/scripts/screenshot_display.sh | 4 ++++ .config/sway/scripts/screenshot_window.sh | 3 +++ packages-repository.txt | 1 + 5 files changed, 14 insertions(+), 20 deletions(-) delete mode 100644 .config/sway/scripts/screenshot.sh create mode 100755 .config/sway/scripts/screenshot_display.sh create mode 100755 .config/sway/scripts/screenshot_window.sh diff --git a/.config/sway/config.d/default b/.config/sway/config.d/default index 4cf2cb6..75ef7d2 100644 --- a/.config/sway/config.d/default +++ b/.config/sway/config.d/default @@ -219,8 +219,12 @@ bindsym $mod+r mode "resize" # # Screenshots # - bindsym print exec /usr/share/sway-contrib/grimshot --notify save output - bindsym Shift+print exec ~/.config/sway/scripts/screenshot.sh + # Snip a selection and pipe to swappy + bindsym print exec grim -g "$(slurp)" - | swappy -f - + # Screenshot a window and pipe to swappy + bindsym Ctrl+Print exec ~/.config/sway/scripts/screenshot_window.sh + # Screenshot the current display and pipe to swappy + bindsym Shift+Print exec ~/.config/sway/scripts/screenshot_display.sh # # Keybindings List # diff --git a/.config/sway/scripts/screenshot.sh b/.config/sway/scripts/screenshot.sh deleted file mode 100644 index 75b836d..0000000 --- a/.config/sway/scripts/screenshot.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -entries="Active Screen Output Area Window" - -selected=$(printf '%s\n' $entries | wofi --style=$HOME/.config/wofi/style.widgets.css --conf=$HOME/.config/wofi/config.screenshot | awk '{print tolower($1)}') - -case $selected in - active) - /usr/share/sway-contrib/grimshot --notify save active;; - screen) - /usr/share/sway-contrib/grimshot --notify save screen;; - output) - /usr/share/sway-contrib/grimshot --notify save output;; - area) - /usr/share/sway-contrib/grimshot --notify save area;; - window) - /usr/share/sway-contrib/grimshot --notify save window;; -esac diff --git a/.config/sway/scripts/screenshot_display.sh b/.config/sway/scripts/screenshot_display.sh new file mode 100755 index 0000000..5b50f5e --- /dev/null +++ b/.config/sway/scripts/screenshot_display.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +output_id=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused).name') +grim -o $output_id - | swappy -f - diff --git a/.config/sway/scripts/screenshot_window.sh b/.config/sway/scripts/screenshot_window.sh new file mode 100755 index 0000000..9b58a1c --- /dev/null +++ b/.config/sway/scripts/screenshot_window.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | swappy -f - diff --git a/packages-repository.txt b/packages-repository.txt index c0f5ae5..880cb0e 100644 --- a/packages-repository.txt +++ b/packages-repository.txt @@ -38,3 +38,4 @@ xed ttf-jetbrains-mono ttf-ubuntu-font-family xfce4-terminal +swappy From 519482383625e7b171a0040164b7dabe9b477f00 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:03:41 -0400 Subject: [PATCH 06/12] style: alphabetically sort package lists The Sway package lists have been alphabetically sorted to make them easier to manage. --- netinstall.yaml | 63 +++++++++++++++++++++-------------------- packages-repository.txt | 62 ++++++++++++++++++++-------------------- 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/netinstall.yaml b/netinstall.yaml index 0ce7a0f..024e0a9 100644 --- a/netinstall.yaml +++ b/netinstall.yaml @@ -137,47 +137,48 @@ selected: true critical: false packages: - - sway - - swayidle - - swaylock - - swaybg - - waybar - - lxappearance - - polkit-gnome - - thunar - - thunar-archive-plugin + - acpi + - arc-gtk-theme-eos + - archlinux-xdg-menu + - arc-x-icons-theme + - bluez-utils + - brightnessctl + - celluloid + - dex + - diffuse - file-roller - - thunar-volman + - foot - grim - - slurp + - gtk-engine-murrine + - gtk-layer-shell + - htop + - imv + - lxappearance + - mako + - network-manager-applet - otf-font-awesome - - pulseaudio - paprefs - pavucontrol - - arc-gtk-theme-eos - - arc-x-icons-theme - - gtk-engine-murrine - - mako - - wofi - - acpi - - bluez-utils - - network-manager-applet + - polkit-gnome + - pulseaudio + - slurp + - swappy + - sway + - swaybg + - swayidle + - swaylock - sysstat - - archlinux-xdg-menu - - htop - - xfce4-terminal - - gtk-layer-shell - - ttf-nerd-fonts-symbols - - xdg-desktop-portal-wlr - - brightnessctl + - thunar + - thunar-archive-plugin + - thunar-volman - ttf-jetbrains-mono + - ttf-nerd-fonts-symbols - ttf-ubuntu-font-family + - waybar + - wofi + - xdg-desktop-portal-wlr - xed - - dex - - celluloid - xorg-xhost - - diffuse - - imv - name: "Zen Kernel" description: "https://github.com/zen-kernel/zen-kernel" hidden: false diff --git a/packages-repository.txt b/packages-repository.txt index 880cb0e..ffccabc 100644 --- a/packages-repository.txt +++ b/packages-repository.txt @@ -1,41 +1,41 @@ +acpi +arc-gtk-theme-eos +awesome-terminal-fonts +bluez-utils +brightnessctl +dex +egl-wayland +eos-sddm-theme +file-roller +grim +gtk-engine-murrine +gtk-layer-shell +htop +jq +mako +network-manager-applet +nwg-look +polkit-gnome +sddm +slurp +swappy sway +swaybg sway-contrib swayidle swaylock -swaybg -waybar -nwg-look -polkit-gnome +sysstat thunar thunar-archive-plugin -file-roller thunar-volman -grim -slurp -awesome-terminal-fonts -arc-gtk-theme-eos -gtk-engine-murrine -mako -wofi -sddm -eos-sddm-theme -acpi -bluez-utils -network-manager-applet -sysstat -htop -wayland-protocols -xorg-xwayland -egl-wayland -gtk-layer-shell -ttf-nerd-fonts-symbols -xdg-desktop-portal-wlr -brightnessctl -wl-clipboard -dex -jq -xed ttf-jetbrains-mono +ttf-nerd-fonts-symbols ttf-ubuntu-font-family +waybar +wayland-protocols +wl-clipboard +wofi +xdg-desktop-portal-wlr +xed xfce4-terminal -swappy +xorg-xwayland From 4f8c150510aed3f6740be1a1c2d500430ef9a399 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:08:14 -0400 Subject: [PATCH 07/12] fix: foot > xfce4-terminal The Foot commit hasn't been pushed yet (fix). --- netinstall.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netinstall.yaml b/netinstall.yaml index 024e0a9..0330476 100644 --- a/netinstall.yaml +++ b/netinstall.yaml @@ -147,7 +147,6 @@ - dex - diffuse - file-roller - - foot - grim - gtk-engine-murrine - gtk-layer-shell @@ -178,6 +177,7 @@ - wofi - xdg-desktop-portal-wlr - xed + - xfce4-terminal - xorg-xhost - name: "Zen Kernel" description: "https://github.com/zen-kernel/zen-kernel" From 24888b484bb57b2bee55147bc6cf0c68ac0d4156 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:17:44 -0400 Subject: [PATCH 08/12] Change the default terminal to [Foot terminal](https://codeberg.org/dnkl/foot), a Wayland-first terminal which is the default for the Sway project. Compared to xfce4-terminal, Foot is faster and more lightweight (both in size and resource usage). It also has native Sixel support, which allows rendering images in the terminal. I have added a foot.ini which preserves the color scheme that had been set up on xfce4-terminal (with the purple background and transparency), except using the Material color scheme for terminal fonts. The bright colors of the fonts look good on the purple, and are easier to read than the old font colors. Other changes in this PR: * Add foot to package lists; remove xfce4-terminal * Autostart foot-server in Sway config * Change default terminal in Sway config * Change Waybar on-click actions to use footclient instead of xfce4-terminal * Update cheatsheet, keyhint files * Update Wofi, Thunar configs to use footclient instead of xfce4-terminal --- .config/Thunar/uca.xml | 2 +- .config/foot/foot.ini | 195 ++++++++++++++++++ .config/sway/cheatsheet | 5 +- .config/sway/config.d/application_defaults | 4 +- .config/sway/config.d/default | 11 +- .config/waybar/config | 6 +- .config/waybar/scripts/keyhint.sh | 2 +- .config/wofi/config | 2 +- .config/xfce4/terminal/accels.scm | 58 ------ .config/xfce4/terminal/terminalrc | 43 ---- .../xfce-perchannel-xml/thunar-volman.xml | 10 - netinstall.yaml | 2 +- packages-repository.txt | 1 + 13 files changed, 213 insertions(+), 128 deletions(-) create mode 100644 .config/foot/foot.ini delete mode 100644 .config/xfce4/terminal/accels.scm delete mode 100644 .config/xfce4/terminal/terminalrc delete mode 100644 .config/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml diff --git a/.config/Thunar/uca.xml b/.config/Thunar/uca.xml index cd42094..fea0520 100644 --- a/.config/Thunar/uca.xml +++ b/.config/Thunar/uca.xml @@ -4,7 +4,7 @@ utilities-terminal Open Terminal Here 1611168259857250-1 - sh -c 'cd %f; xfce4-terminal' + sh -c 'cd %f; footclient' Example for a custom action * diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..da54517 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,195 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot +# title=foot +# locked-title=no + +font=JetBrainsMono-Regular:size=13 +# font-bold= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# box-drawings-uses-font-glyphs=no +# dpi-aware=auto + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +pad=12x12 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= + +[environment] +# name=value + +[bell] +# urgent=no +# notify=no +# command= +# command-focused=no + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color= +# blink=no +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[colors] +alpha=0.9 # Adjust alpha to match transparency level +foreground=e3e3ea # ColorForeground +background=08052b # ColorBackground + +## Normal/regular colors (color palette 0-7) +regular0=546E7A # black +regular1=FF5252 # red +regular2=5CF19E # green +regular3=FFD740 # yellow +regular4=40C4FF # blue +regular5=FF4081 # magenta +regular6=64FCDA # cyan +regular7=FFFFFF # white + +## Bright colors (color palette 8-15) +bright0=B0BEC5 # bright black +bright1=FF8A80 # bright red +bright2=B9F6CA # bright green +bright3=FFE57F # bright yellow +bright4=80D8FF # bright blue +bright5=FF80AB # bright magenta +bright6=A7FDEB # bright cyan +bright7=FFFFFF # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= # black-on-yellow +# scrollback-indicator= # black-on-bright-blue +# search-box-no-match= # black-on-red +# search-box-match= # black-on-yellow +# urls= + +[csd] +# preferred=server +size=0 +# font= +# color= +# hide-when-typing=no +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=none +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 + +# vim: ft=dosini diff --git a/.config/sway/cheatsheet b/.config/sway/cheatsheet index 4b1a94c..629d698 100644 --- a/.config/sway/cheatsheet +++ b/.config/sway/cheatsheet @@ -23,12 +23,9 @@ MOD key is set to the WINKEY/LINKEY -# start floating xfce4-terminal +# Launch the terminal MOD+Return -# start fixed termite-terminal -MOD+Shift+Return - # kill focused window MOD+q diff --git a/.config/sway/config.d/application_defaults b/.config/sway/config.d/application_defaults index 445796f..8b5bd20 100644 --- a/.config/sway/config.d/application_defaults +++ b/.config/sway/config.d/application_defaults @@ -40,8 +40,8 @@ for_window [title="File Operation Progress"] floating enable, border pixel 1, st for_window [app_id="firefox" title="^Library$"] floating enable, border pixel 1, sticky enable, resize set width 40 ppt height 30 ppt for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt for_window [title="Picture in picture"] floating enable, sticky enable -for_window [title="nmtui"] floating enable, resize set width 50 ppt height 70 ppt -for_window [title="htop"] floating enable, resize set width 50 ppt height 70 ppt +for_window [title="waybar_htop"] floating enable, resize set width 70 ppt height 70 ppt +for_window [title="waybar_nmtui"] floating enable for_window [app_id="xsensors"] floating enable for_window [title="Save File"] floating enable for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill diff --git a/.config/sway/config.d/default b/.config/sway/config.d/default index 75ef7d2..84a6444 100644 --- a/.config/sway/config.d/default +++ b/.config/sway/config.d/default @@ -15,8 +15,11 @@ set $volume_up $(pactl set-sink-volume @DEFAULT_SINK@ +5% && $sink_volume) set $volume_mute $(pactl set-sink-mute @DEFAULT_SINK@ toggle && pactl get-sink-mute @DEFAULT_SINK@ | sed -En "/no/ s/.*/$($sink_volume)/p; /yes/ s/.*/0/p") set $mic_mute $(pactl set-source-mute @DEFAULT_SOURCE@ toggle && pactl get-source-mute @DEFAULT_SOURCE@ | sed -En "/no/ s/.*/$($source_volume)/p; /yes/ s/.*/0/p") -# Your preferred terminal emulators -set $term-float xfce4-terminal +# Start foot server +exec_always --no-startup-id foot --server + +# Set default terminal emulator +set $term footclient # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened @@ -42,8 +45,8 @@ exec swayidle -w\ # # Basics: # - # Start a floating terminal - bindsym $mod+Return exec $term-float + # Launch the terminal + bindsym $mod+Return exec $term # Open the power menu bindsym $mod+Shift+e exec $powermenu diff --git a/.config/waybar/config b/.config/waybar/config index 73e0d23..f960f18 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -65,7 +65,7 @@ "warning": 70, "critical": 90, }, - "on-click": "xfce4-terminal -e 'htop'", + "on-click": "footclient -T waybar_htop -e htop", }, "custom/keyboard-layout": { @@ -82,7 +82,7 @@ "memory": { "interval": 5, "format": " {}%", // Icon: memory - "on-click": "xfce4-terminal -e 'htop'", + "on-click": "footclient -T waybar_htop -e htop", "states": { "warning": 70, "critical": 90 @@ -95,7 +95,7 @@ "format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet "format-disconnected": "⚠ Disconnected", "tooltip-format": "{ifname}: {ipaddr}", - "on-click": "xfce4-terminal -e 'nmtui'", + "on-click": "footclient -T waybar_nmtui -e nmtui", }, "network#vpn": { "interface": "tun0", diff --git a/.config/waybar/scripts/keyhint.sh b/.config/waybar/scripts/keyhint.sh index 01f3396..79b2768 100644 --- a/.config/waybar/scripts/keyhint.sh +++ b/.config/waybar/scripts/keyhint.sh @@ -1,2 +1,2 @@ #!/bin/sh -yad --title="EndeavourOS Sway-WM keybindings:" --no-buttons --geometry=400x345-15-400 --list --column=key: --column=description: --column=command: "ESC" "close this app" "" "=" "modkey" "(set mod Mod4)" "+enter" "Terminal" "(xfce4-terminal)" "+d" "Application Menu" "(wofi)" "+p" "Activities" "(wofi)" "+o" "" "Open Broswer" "+n" "" "Open Files" "+q" "close focused app" "(kill)" "[Shift]+Print-key" "screenshot" "(grim)" "+Shift+e" "power-menu" "(wofi)" "+t" "open keybinding helper" "full list" +yad --title="EndeavourOS Sway-WM keybindings:" --no-buttons --geometry=400x345-15-400 --list --column=key: --column=description: --column=command: "ESC" "close this app" "" "=" "modkey" "(set mod Mod4)" "+enter" "Terminal" "(Foot)" "+d" "Application Menu" "(wofi)" "+p" "Activities" "(wofi)" "+o" "" "Open Broswer" "+n" "" "Open Files" "+q" "close focused app" "(kill)" "[Shift]+Print-key" "screenshot" "(grim)" "+Shift+e" "power-menu" "(wofi)" "+t" "open keybinding helper" "full list" diff --git a/.config/wofi/config b/.config/wofi/config index 091c2f0..54f832c 100644 --- a/.config/wofi/config +++ b/.config/wofi/config @@ -3,7 +3,7 @@ show=drun width=25% lines=10 line_wrap=word -term=xfce4-terminal +term=footclient allow_markup=true always_parse_args=true show_all=true diff --git a/.config/xfce4/terminal/accels.scm b/.config/xfce4/terminal/accels.scm deleted file mode 100644 index 1b6accf..0000000 --- a/.config/xfce4/terminal/accels.scm +++ /dev/null @@ -1,58 +0,0 @@ - xfce4-terminal GtkAccelMap rc-file -*- scheme -*- -; this file is an automated accelerator map dump -; -(gtk_accel_path "/terminal-window/goto-tab-2" "2") -(gtk_accel_path "/terminal-window/goto-tab-6" "6") -; (gtk_accel_path "/terminal-window/copy-input" "") -; (gtk_accel_path "/terminal-window/close-other-tabs" "") -; (gtk_accel_path "/terminal-window/move-tab-right" "Page_Down") -(gtk_accel_path "/terminal-window/goto-tab-7" "7") -; (gtk_accel_path "/terminal-window/set-title-color" "") -; (gtk_accel_path "/terminal-window/edit-menu" "") -; (gtk_accel_path "/terminal-window/zoom-menu" "") -(gtk_accel_path "/terminal-window/goto-tab-1" "1") -; (gtk_accel_path "/terminal-window/fullscreen" "F11") -; (gtk_accel_path "/terminal-window/read-only" "") -; (gtk_accel_path "/terminal-window/preferences" "") -; (gtk_accel_path "/terminal-window/reset-and-clear" "") -; (gtk_accel_path "/terminal-window/about" "") -(gtk_accel_path "/terminal-window/goto-tab-5" "5") -; (gtk_accel_path "/terminal-window/close-window" "q") -; (gtk_accel_path "/terminal-window/reset" "") -; (gtk_accel_path "/terminal-window/save-contents" "") -(gtk_accel_path "/terminal-window/toggle-menubar" "F10") -; (gtk_accel_path "/terminal-window/copy" "c") -; (gtk_accel_path "/terminal-window/copy-html" "") -; (gtk_accel_path "/terminal-window/last-active-tab" "") -; (gtk_accel_path "/terminal-window/show-borders" "") -; (gtk_accel_path "/terminal-window/view-menu" "") -; (gtk_accel_path "/terminal-window/detach-tab" "d") -; (gtk_accel_path "/terminal-window/scroll-on-output" "") -; (gtk_accel_path "/terminal-window/show-toolbar" "") -; (gtk_accel_path "/terminal-window/next-tab" "Page_Down") -; (gtk_accel_path "/terminal-window/tabs-menu" "") -; (gtk_accel_path "/terminal-window/search-next" "") -; (gtk_accel_path "/terminal-window/search-prev" "") -; (gtk_accel_path "/terminal-window/undo-close-tab" "") -; (gtk_accel_path "/terminal-window/set-title" "s") -; (gtk_accel_path "/terminal-window/contents" "F1") -; (gtk_accel_path "/terminal-window/zoom-reset" "0") -; (gtk_accel_path "/terminal-window/close-tab" "w") -; (gtk_accel_path "/terminal-window/new-tab" "t") -; (gtk_accel_path "/terminal-window/new-window" "n") -; (gtk_accel_path "/terminal-window/terminal-menu" "") -; (gtk_accel_path "/terminal-window/show-menubar" "") -; (gtk_accel_path "/terminal-window/select-all" "a") -; (gtk_accel_path "/terminal-window/paste" "v") -(gtk_accel_path "/terminal-window/goto-tab-9" "9") -; (gtk_accel_path "/terminal-window/move-tab-left" "Page_Up") -; (gtk_accel_path "/terminal-window/search" "f") -; (gtk_accel_path "/terminal-window/file-menu" "") -; (gtk_accel_path "/terminal-window/prev-tab" "Page_Up") -; (gtk_accel_path "/terminal-window/paste-selection" "") -; (gtk_accel_path "/terminal-window/zoom-in" "plus") -; (gtk_accel_path "/terminal-window/zoom-out" "minus") -(gtk_accel_path "/terminal-window/goto-tab-8" "8") -; (gtk_accel_path "/terminal-window/help-menu" "") -(gtk_accel_path "/terminal-window/goto-tab-4" "4") -(gtk_accel_path "/terminal-window/goto-tab-3" "3") diff --git a/.config/xfce4/terminal/terminalrc b/.config/xfce4/terminal/terminalrc deleted file mode 100644 index 67444c0..0000000 --- a/.config/xfce4/terminal/terminalrc +++ /dev/null @@ -1,43 +0,0 @@ -[Configuration] -BackgroundDarkness=0.860000 -MiscSearchDialogOpacity=100 -MiscShowUnsafePasteDialog=FALSE -BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT -FontUseSystem=TRUE -MiscAlwaysShowTabs=FALSE -MiscBell=FALSE -MiscBellUrgent=FALSE -MiscBordersDefault=TRUE -MiscCursorBlinks=FALSE -MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK -MiscDefaultGeometry=100x30 -MiscInheritGeometry=FALSE -MiscMenubarDefault=FALSE -MiscMouseAutohide=FALSE -MiscMouseWheelZoom=TRUE -MiscToolbarDefault=FALSE -MiscConfirmClose=TRUE -MiscCycleTabs=TRUE -MiscTabCloseButtons=TRUE -MiscTabCloseMiddleClick=TRUE -MiscTabPosition=GTK_POS_TOP -MiscHighlightUrls=TRUE -MiscMiddleClickOpensUri=FALSE -MiscCopyOnSelect=FALSE -MiscShowRelaunchDialog=TRUE -MiscRewrapOnResize=TRUE -MiscUseShiftArrowsToScroll=FALSE -MiscSlimTabs=TRUE -MiscNewTabAdjacent=FALSE -ColorForeground=#e3e3ea -ColorBackground=#08052b -ColorCursor=#ff7f7f -ColorCursorForeground=#FFFFFF -ColorBold=#7fbaff -TabActivityColor=#47B35D -ColorCursorUseDefault=FALSE -ColorBoldIsBright=FALSE -ScrollingUnlimited=TRUE -TitleMode=TERMINAL_TITLE_REPLACE -ScrollingBar=TERMINAL_SCROLLBAR_NONE -TextBlinkMode=TERMINAL_TEXT_BLINK_MODE_FOCUSED diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml deleted file mode 100644 index c38dbdf..0000000 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/netinstall.yaml b/netinstall.yaml index 0330476..024e0a9 100644 --- a/netinstall.yaml +++ b/netinstall.yaml @@ -147,6 +147,7 @@ - dex - diffuse - file-roller + - foot - grim - gtk-engine-murrine - gtk-layer-shell @@ -177,7 +178,6 @@ - wofi - xdg-desktop-portal-wlr - xed - - xfce4-terminal - xorg-xhost - name: "Zen Kernel" description: "https://github.com/zen-kernel/zen-kernel" diff --git a/packages-repository.txt b/packages-repository.txt index ffccabc..51c58e2 100644 --- a/packages-repository.txt +++ b/packages-repository.txt @@ -7,6 +7,7 @@ dex egl-wayland eos-sddm-theme file-roller +foot grim gtk-engine-murrine gtk-layer-shell From 246e7ae60efbfc92bb4010564c5cb7aaff76640f Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:20:35 -0400 Subject: [PATCH 09/12] feat(waybar): update waybar font Change Waybar font to JetBrainsMono so it matches the terminal font. --- .config/waybar/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 09b3977..4b67c43 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -56,7 +56,7 @@ Arc-Dark Color Scheme background: transparent; color: #bebebe; background-color: @base1; - font-family: UbuntuMono; + font-family: JetBrainsMono; font-size: 14px; } From e343a92ab7b1c30c87c012e2fe4c62bb437821ac Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:22:50 -0400 Subject: [PATCH 10/12] feat(waybar): update keyboard module, update input config file Update the Waybar keyboard module to move the keyboard layout to the tooltip when hovering over the module (and out of the actual Waybar). This will contribute to a cleaner look, and help trim down the lengthiness of the Waybar without sacrificing the utility of the module. * Move keyboard layout to tooltip * The module comments also referenced a script for sending signal, but there is no such script. The comments have been updated to reference example code added to ~/.config/sway/config.d/input In addition to adding the example code, ~/.config/sway/config.d/input itself was updated to address some issues and add additional functionality. * Remove the note about finding the touchpad ID and adding it to the config. This has not been necessary on Sway for a long time. * Remove the `input type:keyboard xkb_layout "us"` line. This line is not actually doing anything since it will be overwritten by the `exec_always` block right below it every time Sway is reloaded. * Enable numlock by default * Add a commented block with example config for setting up keyboard layout toggle. * Add explanatory comments. --- .config/sway/config.d/input | 22 ++++++++++++++++------ .config/waybar/config | 11 +++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.config/sway/config.d/input b/.config/sway/config.d/input index 53f0ad9..a97703a 100644 --- a/.config/sway/config.d/input +++ b/.config/sway/config.d/input @@ -1,20 +1,30 @@ ### Input configuration # -# Example configuration: -# You can get the names of your inputs by running: swaymsg -t get_inputs -# Put your touchpad's ID to replace "Touchpad-ID" (keep the quotation marks) +# Read `man 5 sway-input` for more information about this section. +# Touchpad configuration input type:touchpad { dwt enabled tap enabled natural_scroll enabled } -# Read `man 5 sway-input` for more information about this section. -# -input type:keyboard xkb_layout "us" +# Enable numlock by default +input type:keyboard xkb_numlock enabled +# Set keyboard layout and variant based on current system settings exec_always { 'swaymsg input type:keyboard xkb_layout "$(localectl status | grep "X11 Layout" | sed -e "s/^.*X11 Layout://")"' 'swaymsg input type:keyboard xkb_variant "$(localectl status | grep "X11 Variant" | sed -e "s/^.*X11 Variant://")"' } + +# # Toggle between keyboard layouts. This example has the "us" and "gb" +# # keyboard layouts, and uses Alt+Shift to toggle between them. +# input "type:keyboard" { +# xkb_layout "us,gb" +# xkb_options "grp:alt_shift_toggle" +# } +# # Assign the same binding to "pkill -RTMIN+1 waybar" to send signal to +# # the Waybar keyboard module (so the module shows the updated layout). +# # This example uses Alt + left Shift. +# bindsym Alt+Shift_L exec "pkill -RTMIN+1 waybar" diff --git a/.config/waybar/config b/.config/waybar/config index f960f18..3aaf1b8 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -69,13 +69,12 @@ }, "custom/keyboard-layout": { - "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4", - // Interval set only as a fallback, as the value is updated by signal + "exec": "i=$(swaymsg -t get_inputs); echo \"\"; echo \"$i\" | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4", + "format": "", + // Interval set only as a fallback; use signal to update the module more immediately "interval": 30, - "format": " {}", // Icon: keyboard - // Signal sent by Sway key binding (~/.config/sway/key-bindings) - "signal": 1, // SIGHUP - "tooltip": false, + // See example config for sending signal to Waybar in ~/.config/sway/config.d/input + "signal": 1, "on-click": "~/.config/waybar/scripts/keyhint.sh", }, From bc386105e542c7915f24397ffc5dcc2cd55ee51c Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:24:22 -0400 Subject: [PATCH 11/12] feat: add autotiling script Add Piotr Miller's very excellent autotiling script. https://github.com/nwg-piotr/autotiling --- .config/sway/config.d/autostart_applications | 3 +- .config/sway/scripts/autotiling | 214 +++++++++++++++++++ 2 files changed, 216 insertions(+), 1 deletion(-) create mode 100755 .config/sway/scripts/autotiling diff --git a/.config/sway/config.d/autostart_applications b/.config/sway/config.d/autostart_applications index 0b59ce7..a643b4f 100644 --- a/.config/sway/config.d/autostart_applications +++ b/.config/sway/config.d/autostart_applications @@ -7,7 +7,8 @@ exec mako # Network Applet exec nm-applet --indicator - +# Autotiling +exec_always ~/.config/sway/scripts/autotiling # Welcome App exec dex -a -s /etc/xdg/autostart/:~/.config/autostart/ diff --git a/.config/sway/scripts/autotiling b/.config/sway/scripts/autotiling new file mode 100755 index 0000000..4ccfe59 --- /dev/null +++ b/.config/sway/scripts/autotiling @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 + +""" +This script uses the i3ipc python module to switch the layout splith / splitv +for the currently focused window, depending on its dimensions. +It works on both sway and i3 window managers. + +Inspired by https://github.com/olemartinorg/i3-alternating-layout + +Copyright: 2019-2021 Piotr Miller & Contributors +e-mail: nwg.piotr@gmail.com +Project: https://github.com/nwg-piotr/autotiling +License: GPL3 + +Dependencies: python-i3ipc>=2.0.1 (i3ipc-python) +""" +import argparse +import os +import sys +from functools import partial + +from i3ipc import Connection, Event + +try: + from .__about__ import __version__ +except ImportError: + __version__ = "unknown" + + +def temp_dir(): + return os.getenv("TMPDIR") or os.getenv("TEMP") or os.getenv("TMP") or "/tmp" + + +def save_string(string, file_path): + try: + with open(file_path, "wt") as file: + file.write(string) + except Exception as e: + print(e) + + +def output_name(con): + if con.type == "root": + return None + + if p := con.parent: + if p.type == "output": + return p.name + else: + return output_name(p) + + +def switch_splitting(i3, e, debug, outputs, workspaces, depth_limit, splitwidth, splitheight, splitratio): + try: + con = i3.get_tree().find_focused() + output = output_name(con) + # Stop, if outputs is set and current output is not in the selection + if outputs and output not in outputs: + if debug: + print(f"Debug: Autotiling turned off on output {output}", file=sys.stderr) + return + + if con and not workspaces or (str(con.workspace().num) in workspaces): + if con.floating: + # We're on i3: on sway it would be None + # May be 'auto_on' or 'user_on' + is_floating = "_on" in con.floating + else: + # We are on sway + is_floating = con.type == "floating_con" + + if depth_limit: + # Assume we reached the depth limit, unless we can find a workspace + depth_limit_reached = True + current_con = con + current_depth = 0 + while current_depth < depth_limit: + # Check if we found the workspace of the current container + if current_con.type == "workspace": + # Found the workspace within the depth limitation + depth_limit_reached = False + break + + # Look at the parent for next iteration + current_con = current_con.parent + + # Only count up the depth, if the container has more than + # one container as child + if len(current_con.nodes) > 1: + current_depth += 1 + + if depth_limit_reached: + if debug: + print("Debug: Depth limit reached") + return + + is_full_screen = con.fullscreen_mode == 1 + is_stacked = con.parent.layout == "stacked" + is_tabbed = con.parent.layout == "tabbed" + + # Exclude floating containers, stacked layouts, tabbed layouts and full screen mode + if (not is_floating + and not is_stacked + and not is_tabbed + and not is_full_screen): + new_layout = "splitv" if con.rect.height > con.rect.width / splitratio else "splith" + + if new_layout != con.parent.layout: + result = i3.command(new_layout) + if result[0].success and debug: + print(f"Debug: Switched to {new_layout}", file=sys.stderr) + elif debug: + print(f"Error: Switch failed with err {result[0].error}", file=sys.stderr) + + if e.change in ["new", "move"] and con.percent: + if con.parent.layout == "splitv" and splitheight != 1.0: # top / bottom + # print(f"split top fac {splitheight*100}") + i3.command(f"resize set height {int(con.percent * splitheight * 100)} ppt") + elif con.parent.layout == "splith" and splitwidth != 1.0: # top / bottom: # left / right + # print(f"split right fac {splitwidth*100} ") + i3.command(f"resize set width {int(con.percent * splitwidth * 100)} ppt") + + elif debug: + print("Debug: No focused container found or autotiling on the workspace turned off", file=sys.stderr) + + except Exception as e: + print(f"Error: {e}", file=sys.stderr) + + +def get_parser(): + parser = argparse.ArgumentParser(prog="autotiling", description="Script for sway and i3 to automatically switch the horizontal / vertical window split orientation") + + parser.add_argument("-d", "--debug", action="store_true", + help="print debug messages to stderr") + parser.add_argument("-v", "--version", action="version", + version=f"%(prog)s {__version__}, Python {sys.version}", + help="display version information") + parser.add_argument("-o", "--outputs", nargs="*", type=str, default=[], + help="restricts autotiling to certain output; example: autotiling --output DP-1 HDMI-0") + parser.add_argument("-w", "--workspaces", nargs="*", type=str, default=[], + help="restricts autotiling to certain workspaces; example: autotiling --workspaces 8 9") + parser.add_argument("-l", "--limit", type=int, default=0, + help='limit how often autotiling will split a container; ' + 'try "2" if you like master-stack layouts; default: 0 (no limit)') + parser.add_argument("-sw", + "--splitwidth", + help='set the width of the vertical split (as factor); default: 1.0;', + type=float, + default=1.0, ) + parser.add_argument("-sh", + "--splitheight", + help='set the height of the horizontal split (as factor); default: 1.0;', + type=float, + default=1.0, ) + parser.add_argument("-sr", + "--splitratio", + help='Split direction ratio - based on window height/width; default: 1;' + 'try "1.61", for golden ratio - window has to be 61%% wider for left/right split; default: 1.0;', + type=float, + default=1.0, ) + + """ + Changing event subscription has already been the objective of several pull request. To avoid doing this again + and again, let's allow to specify them in the `--events` argument. + """ + parser.add_argument("-e", "--events", nargs="*", type=str, default=["WINDOW", "MODE"], + help="list of events to trigger switching split orientation; default: WINDOW MODE") + + return parser + +def main(): + args = get_parser().parse_args() + + if args.debug: + if args.outputs: + print(f"autotiling is only active on outputs: {','.join(args.outputs)}") + if args.workspaces: + print(f"autotiling is only active on workspaces: {','.join(args.workspaces)}") + + # For use w/ nwg-panel + ws_file = os.path.join(temp_dir(), "autotiling") + if args.workspaces: + save_string(','.join(args.workspaces), ws_file) + else: + if os.path.isfile(ws_file): + os.remove(ws_file) + + if not args.events: + print("No events specified", file=sys.stderr) + sys.exit(1) + + handler = partial( + switch_splitting, + debug=args.debug, + outputs=args.outputs, + workspaces=args.workspaces, + depth_limit=args.limit, + splitwidth=args.splitwidth, + splitheight=args.splitheight, + splitratio=args.splitratio + ) + i3 = Connection() + for e in args.events: + try: + i3.on(Event[e], handler) + print(f"{Event[e]} subscribed") + except KeyError: + print(f"'{e}' is not a valid event", file=sys.stderr) + + i3.main() + + +if __name__ == "__main__": + main() From b5876582252e126c628cf3d0347a23e9099a1a28 Mon Sep 17 00:00:00 2001 From: BluishHumility Date: Mon, 29 Jul 2024 22:36:59 -0400 Subject: [PATCH 12/12] feat(waybar): update waybar colors Darken the grey shade of the Waybar, lighten the shade of the Waybar font. --- .config/waybar/style.css | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 4b67c43..f9260d1 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -10,11 +10,8 @@ * Keyframes * -------------------------------------------------------------------------- */ -/* -Arc-Dark Color Scheme -*/ @define-color highlight #5294e2 ; -@define-color base1 #404552 ; +@define-color base1 #19191e ; @keyframes blink-warning { 70% { @@ -54,7 +51,7 @@ Arc-Dark Color Scheme /* The whole bar */ #waybar { background: transparent; - color: #bebebe; + color: #e3e3ea; background-color: @base1; font-family: JetBrainsMono; font-size: 14px;