From 57b1ca02fce6360b0120069a732f41ed7fb692fd Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 27 Oct 2025 15:42:41 +0100 Subject: [PATCH 01/18] [WIP] ubuntu: Install hyprlock. --- install/ubuntu.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/install/ubuntu.sh b/install/ubuntu.sh index 537c70c..d110b7f 100755 --- a/install/ubuntu.sh +++ b/install/ubuntu.sh @@ -496,6 +496,45 @@ install_gtk_theme() { log_success "GTK theme installed" } +install_hyprlock() { + if command_exists hyprlock; then + log_success "hyprlock is already installed" + return + fi + + log_info "Installing hyprlock..." + install_apt_packages \ + libpam0g-dev libgbm-dev libdrm-dev libmagic-dev libaudit-dev \ + libsdbus-c++-dev libgl1-mesa-dev + + local tag="v0.9.1" + + local hyprlock_dir="/tmp/hyprlock-build-$$" + mkdir -p "$hyprlock_dir" + + pushd "$hyprlock_dir" >/dev/null + + if git clone --recursive -b $tag https://github.com/hyprwm/hyprlock.git; then + pushd hyprlock >/dev/null + + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build + cmake --build ./build --config Release --target hyprlock -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + + if sudo cmake --install build 2>&1 ; then + log_success "hyprlock $tag installed successfully." + + else + log_error "Installation failed for hyprlock $tag" + fi + + popd >/dev/null + else + log_error "Download failed for hyprlock $tag" + fi + + popd >/dev/null +} + install_sway() { if command_exists sway; then log_success "sway is already installed" @@ -648,6 +687,7 @@ main() { log_info "Installing desktop environment packages..." install_ghostty install_gtk_theme + install_hyprlock install_sway install_waypaper From 23a3d3b5f98954682ef711eb4bb39ce18ea5d5d6 Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 27 Oct 2025 16:51:16 +0100 Subject: [PATCH 02/18] ubuntu: Install simp1e cursor theme. --- install/ubuntu.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/install/ubuntu.sh b/install/ubuntu.sh index d110b7f..d3aec25 100755 --- a/install/ubuntu.sh +++ b/install/ubuntu.sh @@ -535,6 +535,37 @@ install_hyprlock() { popd >/dev/null } +install_simp1e_cursor_theme() { + local theme_dir="/usr/share/icons/Simp1e" + + if [[ -d "$theme_dir" ]]; then + log_success "Simp1e cursor theme is already installed" + return + fi + + log_info "Installing Simp1e cursor theme..." + pushd /tmp >/dev/null + + local files + files=$(curl -Lfs https://www.pling.com/p/1932768/loadFiles) + local raw_url + raw_url=$(echo $files | jq -r '.files[] | select(.name == "Simp1e.tar.xz") | .url') + local decoded_url + decoded_url=$(echo $raw_url | perl -pe 's/\%(\w\w)/chr hex $1/ge') + + download_file "$decoded_url" "Simp1e.tar.xz" + + local extract_dir="simp1e-cursor-$$" + mkdir -p "$extract_dir" + tar -xf Simp1e.tar.xz -C "$extract_dir" + + sudo mv "$extract_dir/Simp1e" /usr/share/icons/ + + rm -rf "$extract_dir" Simp1e.tar.xz + popd >/dev/null + log_success "Simp1e cursor theme installed" +} + install_sway() { if command_exists sway; then log_success "sway is already installed" @@ -688,6 +719,7 @@ main() { install_ghostty install_gtk_theme install_hyprlock + install_simp1e_cursor_theme install_sway install_waypaper From 78b8ea3d8d7ad6e39dd2a655e856768739e64604 Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 27 Oct 2025 11:50:24 +0100 Subject: [PATCH 03/18] [WIP] sway: Configure sway. --- config/fuzzel/fuzzel.ini~esh | 2 + config/sway/config | 158 +++++++++++++++++++++++++++ config/sway/environment.sh | 14 +++ config/sway/init | 3 + config/sway/init~sway | 3 + config/sway/keymaps.conf | 142 ++++++++++++++++++++++++ config/sway/outputs.conf~home-dual | 11 ++ config/sway/outputs.conf~home-triple | 14 +++ config/sway/outputs.conf~intelic | 11 ++ config/sway/refresh.sh | 26 +++++ config/sway/sway-run.sh | 23 ++++ config/sway/theme.conf~esh | 15 +++ config/sway/workspace.conf | 36 ++++++ config/waybar/sway-config | 135 +++++++++++++++++++++++ config/waybar/sway-style.css~esh | 141 ++++++++++++++++++++++++ deploy/deploy-desktop.sh | 8 +- deploy/modules/sway.sh | 57 ++++++++++ deploy/modules/waybar.sh | 4 + 18 files changed, 802 insertions(+), 1 deletion(-) create mode 100644 config/sway/config create mode 100755 config/sway/environment.sh create mode 100755 config/sway/init create mode 100755 config/sway/init~sway create mode 100644 config/sway/keymaps.conf create mode 100644 config/sway/outputs.conf~home-dual create mode 100644 config/sway/outputs.conf~home-triple create mode 100644 config/sway/outputs.conf~intelic create mode 100755 config/sway/refresh.sh create mode 100755 config/sway/sway-run.sh create mode 100644 config/sway/theme.conf~esh create mode 100644 config/sway/workspace.conf create mode 100644 config/waybar/sway-config create mode 100644 config/waybar/sway-style.css~esh create mode 100755 deploy/modules/sway.sh diff --git a/config/fuzzel/fuzzel.ini~esh b/config/fuzzel/fuzzel.ini~esh index a0631f5..4130b2d 100644 --- a/config/fuzzel/fuzzel.ini~esh +++ b/config/fuzzel/fuzzel.ini~esh @@ -2,7 +2,9 @@ [main] dpi-aware=no font=<%= $font_sans %>:size=<%= $font_size_medium %> +<% if [[ $DEPLOY_DISTRO == "arch" ]]; then -%> use-bold=yes +<% fi -%> width=72 icons-enabled=no horizontal-pad=0 diff --git a/config/sway/config b/config/sway/config new file mode 100644 index 0000000..2b386f7 --- /dev/null +++ b/config/sway/config @@ -0,0 +1,158 @@ +#------------------------------------------------------------------------------- +# Sway configuration +# +# See the sway(5) and swaymsg(1) man pages for complete documentation. +#------------------------------------------------------------------------------- + +# Variables +#------------------------------------------------------------------------------- + +set $config_dir $HOME/.config +set $scripts_dir $HOME/.local/scripts + +# Systemd integration +#------------------------------------------------------------------------------- + +exec dbus-update-activation-environment --systemd \ + XDG_CURRENT_DESKTOP \ + XDG_SESSION_TYPE \ + WAYLAND_DISPLAY + +# Input configuration +#------------------------------------------------------------------------------- + +# Focus follows cursor +focus_follows_mouse yes + +# Keyboard repeat rate +input type:keyboard { + repeat_delay 300 + repeat_rate 50 +} + +# Hide inactive cursor +seat * hide_cursor 3000 + +# Zowie EC2 sensitivity +input "1189:32769:BenQ_ZOWIE_BenQ_ZOWIE_Gaming_Mouse" { + accel_profile flat + pointer_accel -0.65 +} + +# Logitech G Pro X Superlight sensitivity +input "1133:50503:Logitech_USB_Receiver" { + accel_profile flat + pointer_accel 0.05 +} + +# Trackpad sensitivity +input "43256:6199:Bastard_Keyboards_Dilemma_Max_Mouse" { + accel_profile flat + pointer_accel -0.15 +} + +# Layout configuration +#------------------------------------------------------------------------------- + +gaps inner 6 +gaps outer 0 + +default_border pixel 3 +default_floating_border pixel 3 + +smart_gaps on +smart_borders off + +# Autotiling +exec_always autotiling + +# Output configuration +#------------------------------------------------------------------------------- + +include $config_dir/sway/outputs.conf + +# Workspace configuration +#------------------------------------------------------------------------------- + +include $config_dir/sway/workspace.conf + +# Startup applications +#------------------------------------------------------------------------------- + +# Adjust screen brightness +exec wlsunset -l 52.155472 -L 5.389358 + +# Clean home +exec $scripts_dir/clean-home.sh + +# Theme configuration +#------------------------------------------------------------------------------- + +include $config_dir/sway/theme.conf + +# Apply wallpaper +exec waypaper --restore & + +# Start waybar +exec pkill -x waybar +exec waybar & + +# Window rules +#------------------------------------------------------------------------------- + +# Floating windows +for_window [app_id="org.gnome.gitlab.somas.Apostrophe"] floating enable +for_window [app_id="blueman-manager"] floating enable +for_window [app_id=".*floating"] floating enable +for_window [app_id="gcr-prompter"] floating enable +for_window [app_id="org.gnome.Nautilus"] floating enable +for_window [app_id="nwg-look"] floating enable +for_window [app_id="org.gnome.seahorse.Application"] floating enable +for_window [app_id="com.transmissionbt.transmission.*"] floating enable +for_window [app_id="transmission-gtk"] floating enable +for_window [app_id="waypaper"] floating enable +for_window [app_id="xdg-desktop-portal-gtk"] floating enable +for_window [app_id="yad"] floating enable +for_window [app_id="nm-connection-editor"] floating enable + +# Window sizes +for_window [app_id="blueman-manager"] resize set 800 600 +for_window [app_id="org.gnome.Nautilus"] resize set 1024 960 +for_window [app_id="nwg-look"] resize set 1024 960 +for_window [app_id="org.qutebrowser.qutebrowser"] resize set 1600 1200 + +# Server-side decorations +for_window [app_id="org.gnome.gitlab.somas.Apostrophe"] border normal +for_window [app_id="blueman-manager"] border normal +for_window [app_id="chromium"] border none +for_window [app_id="gcr-viewer"] border normal +for_window [app_id="gcr-prompter"] border normal +for_window [app_id="com.mitchellh.ghostty.*"] border normal +for_window [app_id="gtk-pipe-viewer"] border normal +for_window [app_id="gimp"] border normal +for_window [app_id="imv"] border normal +for_window [app_id="marker"] border normal +for_window [app_id="org.gnome.Nautilus"] border normal +for_window [app_id="nm-connection-editor"] border normal +for_window [app_id="nwg-look"] border normal +for_window [app_id="org.pulseaudio.pavucontrol"] border normal +for_window [app_id="org.gnome.seahorse.Application"] border normal +for_window [app_id="org.gnome.SimpleScan"] border normal +for_window [app_id="com.transmissionbt.transmission.*"] border normal +for_window [app_id="transmission-gtk"] border normal +for_window [app_id="waypaper"] border normal +for_window [app_id="org.wezfurlong.wezterm.*"] border normal +for_window [app_id="xdg-desktop-portal-gtk"] border normal +for_window [app_id="yad"] border normal +for_window [app_id="yad-settings"] border normal +for_window [app_id="org.pwmt.zathura"] border normal + +# Key mappings +#------------------------------------------------------------------------------- + +include $config_dir/sway/keymaps.conf + +# Include system config +#------------------------------------------------------------------------------- + +include /etc/sway/config.d/* diff --git a/config/sway/environment.sh b/config/sway/environment.sh new file mode 100755 index 0000000..4bc68c2 --- /dev/null +++ b/config/sway/environment.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------- +# Sway environment +#------------------------------------------------------------------------------- + +# Set cursor theme path. +export XCURSOR_PATH="/usr/share/icons" + +# QT performance flag. +export QT_QPA_PLATFORM=wayland +export QT_SCALE_FACTOR_ROUNDING_POLICY=round + +# XDG desktop portal integration. +export XDG_CURRENT_DESKTOP=sway diff --git a/config/sway/init b/config/sway/init new file mode 100755 index 0000000..5b257c6 --- /dev/null +++ b/config/sway/init @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec sway-run diff --git a/config/sway/init~sway b/config/sway/init~sway new file mode 100755 index 0000000..5b257c6 --- /dev/null +++ b/config/sway/init~sway @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec sway-run diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf new file mode 100644 index 0000000..a89e1b3 --- /dev/null +++ b/config/sway/keymaps.conf @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Sway key mappings +# +# See sway-bindsym(5) for keysym documentation +#------------------------------------------------------------------------------- + +# Mod key +#------------------------------------------------------------------------------- + +set $mod Mod4 + +# System mappings +#------------------------------------------------------------------------------- + +# Lock sway +bindsym $mod+Shift+z exec hyprlock + +# Exit sway +bindsym $mod+Shift+w exit + +# Reload sway configuration +bindsym $mod+Shift+r reload + +# Shortcut mappings +#------------------------------------------------------------------------------- + +# Run menu +bindsym $mod+Return exec $LAUNCHER + +# New terminal +bindsym $mod+t exec spawn-terminal.sh + +# New floating terminal +bindsym $mod+g exec spawn-terminal.sh --floating + +# New terminal in a directory +bindsym $mod+Shift+t exec open-terminal-cwd.sh + +# Browser +bindsym $mod+b exec $BROWSER + +# Browser session +bindsym $mod+Shift+b exec open-qutebrowser-session.sh + +# Process manager +bindsym $mod+m exec spawn-terminal.sh --command btop + +# Toggle waybar +bindsym $mod+r exec toggle-waybar.sh + +# Dismiss all notifications +bindsym $mod+y exec makoctl dismiss -a + +# Take screenshot of a selected rectangle +bindsym $mod+p exec screenshot-rectangle.sh +bindsym $mod+Shift+p exec screenshot-rectangle.sh --upload + +# Window mappings +#------------------------------------------------------------------------------- + +# Toggle window float +bindsym $mod+Space floating toggle + +# Toggle window fullscreen +bindsym $mod+f fullscreen toggle + +# Close window +bindsym $mod+w kill + +# Change focus +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+h focus left +bindsym $mod+l focus right + +# Move the focused window up/down +bindsym $mod+Control+j move down +bindsym $mod+Control+k move up + +# Move the focused window left/right +bindsym $mod+Control+h move left +bindsym $mod+Control+l move right + +# TODO: fix this +# Move windows with mouse +bindsym --whole-window $mod+button1 move + +# TODO: fix this +# Resize windows with mouse +bindsym --whole-window $mod+button3 resize + +# Close window with middle mouse button +bindsym --whole-window $mod+button2 kill + +# Resize (floating) window +bindsym $mod+Shift+d resize shrink height 100px +bindsym $mod+Shift+f resize grow height 100px +bindsym $mod+Shift+g resize grow width 200px +bindsym $mod+Shift+s resize shrink width 200px + +# Move (floating) window +bindsym $mod+Control+d move up 100px +bindsym $mod+Control+f move down 100px +bindsym $mod+Control+g move right 200px +bindsym $mod+Control+s move left 200px + +# Workspace mappings +#------------------------------------------------------------------------------- + +# Cycle focused workspaces +bindsym $mod+Shift+h exec sway-workspace prev-on-output +bindsym $mod+Shift+l exec sway-workspace next-on-output + +# Assign workspaces numerically +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 + +# TODO: implement +# Send window to workspace +# bindsym $mod+Control+1 exec $HOME/.config/sway/send-view-to-workspace.sh 1 +# bindsym $mod+Control+2 exec $HOME/.config/sway/send-view-to-workspace.sh 2 +# bindsym $mod+Control+3 exec $HOME/.config/sway/send-view-to-workspace.sh 3 +# bindsym $mod+Control+4 exec $HOME/.config/sway/send-view-to-workspace.sh 4 +# bindsym $mod+Control+5 exec $HOME/.config/sway/send-view-to-workspace.sh 5 +# bindsym $mod+Control+6 exec $HOME/.config/sway/send-view-to-workspace.sh 6 +# bindsym $mod+Control+7 exec $HOME/.config/sway/send-view-to-workspace.sh 7 +# bindsym $mod+Control+8 exec $HOME/.config/sway/send-view-to-workspace.sh 8 +# bindsym $mod+Control+9 exec $HOME/.config/sway/send-view-to-workspace.sh 9 + +# Layout mappings +#------------------------------------------------------------------------------- + +# Adjust split ratio (resize focused container) +bindsym $mod+Shift+equal resize grow width 5 ppt +bindsym $mod+minus resize shrink width 5 ppt diff --git a/config/sway/outputs.conf~home-dual b/config/sway/outputs.conf~home-dual new file mode 100644 index 0000000..22d7527 --- /dev/null +++ b/config/sway/outputs.conf~home-dual @@ -0,0 +1,11 @@ +#------------------------------------------------------------------------------- +# Sway output configuration - Dual monitor setup +# +# Based on way-displays configuration: +# - DP-2: Left monitor, rotated 90° clockwise +# - DP-1: Right monitor, normal orientation +#------------------------------------------------------------------------------- + +output DP-2 pos 0 0 transform 270 + +output DP-1 pos 1200 0 diff --git a/config/sway/outputs.conf~home-triple b/config/sway/outputs.conf~home-triple new file mode 100644 index 0000000..6661e30 --- /dev/null +++ b/config/sway/outputs.conf~home-triple @@ -0,0 +1,14 @@ +#------------------------------------------------------------------------------- +# Sway output configuration - Triple monitor setup (supertubes/cyxwel) +# +# Based on way-displays configuration: +# - HDMI-A-6: Left monitor, rotated 90° clockwise +# - DP-3: Center monitor, 2560x1440@240Hz, scaled 1.125 +# - DP-4: Right monitor, rotated 90° clockwise +#------------------------------------------------------------------------------- + +output HDMI-A-6 pos 0 0 transform 270 + +output DP-3 pos 1200 0 scale 1.125 mode 2560x1440@240Hz + +output DP-4 pos 3475 0 transform 270 diff --git a/config/sway/outputs.conf~intelic b/config/sway/outputs.conf~intelic new file mode 100644 index 0000000..361dfdf --- /dev/null +++ b/config/sway/outputs.conf~intelic @@ -0,0 +1,11 @@ +#------------------------------------------------------------------------------- +# Sway output configuration - Intelic laptop setup (vortex) +# +# Based on way-displays configuration: +# - LG ULTRAWIDE: External monitor, 3440x1440@60Hz +# - eDP-1: Laptop display, 2560x1600@120Hz, scaled 1.5 +#------------------------------------------------------------------------------- + +output "LG Electronics LG ULTRAWIDE 405NTPC4A128" pos 0 0 mode 3440x1440@60Hz + +output eDP-1 pos 3440 0 scale 1.5 mode 2560x1600@120Hz diff --git a/config/sway/refresh.sh b/config/sway/refresh.sh new file mode 100755 index 0000000..41d9ed4 --- /dev/null +++ b/config/sway/refresh.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------- +# Refresh the usual suspects. +#------------------------------------------------------------------------------- + +# Way-displays +#-------------------------------------------------------------------------------- + +pkill -x way-displays +way-displays > "/tmp/way-displays.${XDG_VTNR}.${USER}.log" 2>&1 & + +# NOTE: Way-displays needs a moment. +sleep 0.25 + +# Autotiling +#-------------------------------------------------------------------------------- + +pkill -x autotiling + +swaymsg "exec autotiling --outputs DP-3" +swaymsg "exec autotiling --outputs HDMI-A-6 DP-4 --splitratio 0.2" + +# Reload Sway configuration +#-------------------------------------------------------------------------------- + +swaymsg reload diff --git a/config/sway/sway-run.sh b/config/sway/sway-run.sh new file mode 100755 index 0000000..bd4eb78 --- /dev/null +++ b/config/sway/sway-run.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------- +# Run sway with custom environment and logging. +#------------------------------------------------------------------------------- + +set -euo pipefail + +# Load sway environment. +#------------------------------------------------------------------------------- + +# shellcheck disable=SC1091 +source "$XDG_CONFIG_HOME/sway/environment.sh" + +# Run sway with logging. +#------------------------------------------------------------------------------- + +# Ensure state directory exists. +if [[ ! -d "$XDG_STATE_HOME/sway" ]]; then + mkdir -p "$XDG_STATE_HOME/sway" +fi + +# Run sway and save session log file. +sway 2> "$XDG_STATE_HOME/sway/session-log-$(date -Iseconds)" diff --git a/config/sway/theme.conf~esh b/config/sway/theme.conf~esh new file mode 100644 index 0000000..6dccd67 --- /dev/null +++ b/config/sway/theme.conf~esh @@ -0,0 +1,15 @@ +<%! declare opt_dir=${XDG_OPT_HOME:-$HOME/.local/opt} %> +<%! source "$opt_dir/theme/theme.sh" %> +#------------------------------------------------------------------------------- +# Sway theme configuration (auto-generated) +#------------------------------------------------------------------------------- + +# Cursor theme +seat * xcursor_theme "<%= ${cursor_theme} %>" <%= ${cursor_size} %> + +# Color scheme +# class border background text indicator child_border +client.focused <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> +client.focused_inactive <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> +client.unfocused <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> +client.urgent <%= $(color_hash "${red_4}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf new file mode 100644 index 0000000..37fe05c --- /dev/null +++ b/config/sway/workspace.conf @@ -0,0 +1,36 @@ +#------------------------------------------------------------------------------- +# Workspace assignments +#------------------------------------------------------------------------------- + +workspace 1 output DP-3 +workspace 2 output DP-3 +workspace 3 output DP-3 +workspace 4 output DP-3 +workspace 5 output DP-3 +workspace 6 output DP-3 +workspace 7 output DP-3 +workspace 8 output DP-3 +workspace 9 output DP-3 +workspace 10 output DP-3 + +workspace 11 output HDMI-A-6 +workspace 12 output HDMI-A-6 +workspace 13 output HDMI-A-6 +workspace 14 output HDMI-A-6 +workspace 15 output HDMI-A-6 +workspace 16 output HDMI-A-6 +workspace 17 output HDMI-A-6 +workspace 18 output HDMI-A-6 +workspace 19 output HDMI-A-6 +workspace 20 output HDMI-A-6 + +workspace 21 output DP-4 +workspace 22 output DP-4 +workspace 23 output DP-4 +workspace 24 output DP-4 +workspace 25 output DP-4 +workspace 26 output DP-4 +workspace 27 output DP-4 +workspace 28 output DP-4 +workspace 29 output DP-4 +workspace 30 output DP-4 diff --git a/config/waybar/sway-config b/config/waybar/sway-config new file mode 100644 index 0000000..091b306 --- /dev/null +++ b/config/waybar/sway-config @@ -0,0 +1,135 @@ +{ + /* General + --------------------------------------------------------------------------*/ + "layer": "top", + "position": "top", + "height": 32, + "margin-top": -2, + "mode": "dock", + + /* Module layout + --------------------------------------------------------------------------*/ + "modules-left": [ + "sway/window" + ], + "modules-center": [ + "sway/workspaces" + ], + "modules-right": [ + "custom/tailscale", + "network", + "bluetooth", + "wireplumber", + "battery", + "cpu", + "memory", + "clock#calendar", + "clock" + ], + + /* Sway modules + --------------------------------------------------------------------------*/ + "sway/workspaces": { + "all-outputs": false, + "format": "{name}", + "disable-scroll": true, + }, + "sway/window": { + "max-length": 160, + "tooltip": false + }, + + /* Common modules + --------------------------------------------------------------------------*/ + "clock": { + "format": "󰥔 {:%H:%M}", + "tooltip": true, + "tooltip-format": "{:%A, %B %d, %Y %H:%M:%S (%Z)}" + }, + "clock#calendar": { + "format": "󰸘 {:%Y-%m-%d}", + "tooltip-format": "{calendar}", + "calendar": { + "mode" : "month", + "mode-mon-col" : 3, + "weeks-pos" : "right", + "on-scroll" : 1, + "format": { + /* TODO: templating for theme vars */ + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-scroll-up": "shift_down", + "on-scroll-down": "shift_up" + } + }, + "custom/tailscale": { + "exec": "${XDG_CONFIG_HOME}/waybar/tailscale.sh", + "format": "{}", + "interval": 5 + }, + "network": { + "format-ethernet": "󰲝 {ifname}", + "format-wifi": "󰖩 {essid}", + "format-disconnected": "󰲜 no network", + "tooltip": true, + "tooltip-format": "󰩟 {gwaddr} ↑{bandwidthUpBytes} ↓{bandwidthDownBytes}", + "tooltip-format-wifi": "󰤨 {signalStrength}% ↑{bandwidthUpBytes} ↓{bandwidthDownBytes}", + "tooltip-format-disconnected": "Disconnected" + }, + "bluetooth": { + "format": " {status}", + "tooltip": true, + "tooltip-format": "{device_address} · {device_alias}", + "tooltip-format-disabled": "controller disabled", + "tooltip-format-off": "controller off" + }, + "wireplumber": { + "format": "{icon} {volume}%", + "format-muted": "󰝟 {volume}%", + "format-icons": ["󰕿", "󰖀", "󰕾"], + "on-click": "pavucontrol", + "on-click-right": "wpctl set-mute 167 toggle" + }, + "cpu": { + "format": "cpu {usage}%", + "states": { + "medium": 50, + "heavy": 70, + "critical": 90 + } + }, + "memory": { + "interval": 30, + "format": "mem {percentage}%", + "states": { + "medium": 50, + "heavy": 70, + "critical": 90 + } + }, + + /* Laptop modules + --------------------------------------------------------------------------*/ + "battery": { + "format": "{icon} {capacity}%", + "format-icons": ["", "", "", "", ""], + "format-charging": " {icon} {capacity}%", + "format-plugged": " {icon} {capacity}%", + "format-full": "{icon} {capacity}%", + "interval": 5, + "states": { + "full": 100, + "normal": 99, + "warning": 30, + "critical": 15 + }, + "tooltip": true + } +} diff --git a/config/waybar/sway-style.css~esh b/config/waybar/sway-style.css~esh new file mode 100644 index 0000000..f410bf1 --- /dev/null +++ b/config/waybar/sway-style.css~esh @@ -0,0 +1,141 @@ +<% source $XDG_OPT_HOME/theme/theme.sh -%> +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: 'sans-serif'; + font-size: <%= $font_size_medium %>px; + font-weight: bold; +} + +window#waybar { + background: <% color_hash $primary_0 %>; + color: <% color_hash $system_text %>; + transition-property: background-color; + transition-duration: .5s; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 9px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 9px <% color_css_rgba $primary_12 0.45 %>; +} + +tooltip { + font-size: <%= $font_size_msmall %>px; + background: <% color_hash $primary_0 %>; + border: 1px solid <% color_hash $primary_8 %>; +} + +tooltip label { + color: <% color_hash $system_text %>; + padding: 0px 2px; +} + +/* All modules +*-----------------------------------------------------------------------------*/ +box > * > * { + padding-left: 10px; + padding-right: 10px; +} + +.modules-left > widget:first-child { + padding-left: 6px; +} + +.modules-right > widget:last-child { + padding-right: 6px; +} + +/* Sway workspaces +*-----------------------------------------------------------------------------*/ +#workspaces button { + padding: 2px 5px; + /* NOTE: Necessary to override a default transition effect. */ + background-color: transparent; + color: <% color_hash $system_text %>; +} + +#workspaces button.visible { + background-color: <% color_css_rgba $primary_3 0.85 %>; +} + +#workspaces button.focused { + background-color: <% color_hash $primary_8 %>; +} + +#workspaces button.urgent { + background-color: <% color_hash $red_4 %>; +} + +/* Network +*-----------------------------------------------------------------------------*/ + +#network { + color: <% color_hash $system_text %>; +} +#network.disabled { + color: <% color_hash $text_8 %>; +} +#network.disconnected { + color: <% color_hash $red_6 %>; +} + +/* Battery +*-----------------------------------------------------------------------------*/ +#battery.charging, #battery.plugged { + color: <% color_hash $green_5 %>; +} +#battery.full { + color: <% color_hash $primary_15 %>; +} +#battery.normal:not(.charging) { + color: <% color_hash $system_text %>; +} +#battery.warning:not(.charging) { + color: <% color_hash $orange_6 %>; +} +@keyframes blink { + to { + color: <% color_hash $red_2 %>; + } +} +#battery.critical:not(.charging) { + color: <% color_hash $red_6 %>; + animation-name: blink; + animation-duration: 0.5s; + /* NOTE: Using steps() instead of linear as a timing function to limit cpu usage */ + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; +} + +/* CPU +*-----------------------------------------------------------------------------*/ +#cpu.medium { + color: <% color_hash $yellow_7 %>; +} +#cpu.heavy { + color: <% color_hash $orange_6 %>; +} +#cpu.critical { + color: <% color_hash $red_6 %>; +} + +/* Memory +*-----------------------------------------------------------------------------*/ +#memory.medium { + color: <% color_hash $yellow_7 %>; +} +#memory.heavy { + color: <% color_hash $orange_6 %>; +} +#memory.critical { + color: <% color_hash $red_6 %>; +} diff --git a/deploy/deploy-desktop.sh b/deploy/deploy-desktop.sh index 44bb866..82cafb9 100755 --- a/deploy/deploy-desktop.sh +++ b/deploy/deploy-desktop.sh @@ -24,7 +24,7 @@ export XDG_SCRIPTS_HOME="$HOME/.local/scripts" export XDG_TEMPLATES_DIR="$HOME/.local/share/templates" export DEPLOY_PROFILE="desktop" export DEPLOY_DISTRO="$(get_distro_id)" -export DEPLOY_WM="river" +export DEPLOY_WM="sway" # Determine which shell the template engine executes export ESH_SHELL=/usr/bin/bash @@ -82,6 +82,7 @@ source "$base_dir/deploy/modules/scripts-markdown.sh" source "$base_dir/deploy/modules/scripts-misc.sh" source "$base_dir/deploy/modules/scripts-system-utils.sh" source "$base_dir/deploy/modules/ssh.sh" +source "$base_dir/deploy/modules/sway.sh" source "$base_dir/deploy/modules/syncthing.sh" source "$base_dir/deploy/modules/spotify.sh" source "$base_dir/deploy/modules/udiskie.sh" @@ -138,6 +139,7 @@ discord::install draw.io::install firefox::install fontconfig::install +fuzzel::install ghostty::install imv::install mako::install @@ -170,6 +172,10 @@ elif [[ $DEPLOY_WM == "river" ]]; then river::install hyprlock::install +elif [[ $DEPLOY_WM == "sway" ]]; then + sway::install + hyprlock::install + fi echo "Deploying desktop user services..." diff --git a/deploy/modules/sway.sh b/deploy/modules/sway.sh new file mode 100755 index 0000000..453112d --- /dev/null +++ b/deploy/modules/sway.sh @@ -0,0 +1,57 @@ +#------------------------------------------------------------------------------- +# Deploy sway configuration +#------------------------------------------------------------------------------- + + +script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) +base_dir=$(realpath "$script_dir/../..") +host=$(uname -n) + +source "$base_dir/config/lib-shell-utils/fs.sh" + + +sway::install () { + echo "└> Installing sway configuration." + + ensure_directory "$XDG_CONFIG_HOME/sway" + force_link "$base_dir/config/sway/config" "$XDG_CONFIG_HOME/sway/config" + force_link "$base_dir/config/sway/environment.sh" "$XDG_CONFIG_HOME/sway/environment.sh" + force_link "$base_dir/config/sway/keymaps.conf" "$XDG_CONFIG_HOME/sway/keymaps.conf" + + if [[ $host == "supertubes" ]] || [[ $host == "cyxwel" ]]; then + force_link "$base_dir/config/sway/outputs.conf~home-triple" "$XDG_CONFIG_HOME/sway/outputs.conf" + + elif [[ $host == "vortex" ]]; then + force_link "$base_dir/config/sway/outputs.conf~intelic" "$XDG_CONFIG_HOME/sway/outputs.conf" + + else + echo "└> Warning: No outputs.conf configuration for host '$host'." + fi + + esh -o "$XDG_CONFIG_HOME/sway/theme.conf" "$base_dir/config/sway/theme.conf~esh" + + echo "└> Installing sway shortcuts." + + ensure_directory "$XDG_BIN_HOME" + force_link "$base_dir/config/sway/sway-run.sh" "$XDG_BIN_HOME/sway-run" + + if [[ $DEPLOY_WM == "sway" ]]; then + echo "└> Autorun sway on login." + + force_link "$base_dir/config/sway/init~sway" "$XDG_BIN_HOME/init" + fi +} + +sway::uninstall () { + echo "└> Uninstalling sway configuration." + + rm -r "$XDG_CONFIG_HOME/sway" + + echo "└> Uninstalling sway shortcuts." + + rm "$XDG_BIN_HOME/sway-run" + + if same_file "$XDG_BIN_HOME/init" "$base_dir/config/sway/init~sway"; then + rm "$XDG_BIN_HOME/init" + fi +} diff --git a/deploy/modules/waybar.sh b/deploy/modules/waybar.sh index d5fa195..581edfd 100755 --- a/deploy/modules/waybar.sh +++ b/deploy/modules/waybar.sh @@ -26,6 +26,10 @@ waybar::install () { force_link "$base_dir/config/waybar/river-config" "$XDG_CONFIG_HOME/waybar/config" esh "$base_dir/config/waybar/river-style.css~esh" > "$XDG_CONFIG_HOME/waybar/style.css" + elif [[ $DEPLOY_WM == "sway" ]]; then + force_link "$base_dir/config/waybar/sway-config" "$XDG_CONFIG_HOME/waybar/config" + esh "$base_dir/config/waybar/sway-style.css~esh" > "$XDG_CONFIG_HOME/waybar/style.css" + elif [[ -z $DEPLOY_WM ]]; then echo "[$(basename "$0")] ERROR: \$DEPLOY_WM not set." exit 2 From 7e11bded9609a8726db5b3c0ba9e687d26f30138 Mon Sep 17 00:00:00 2001 From: Casper Date: Mon, 27 Oct 2025 22:56:00 +0100 Subject: [PATCH 04/18] [WIP] sway conf --- config/sway/config | 58 ++++++++++++++++---------------------- config/sway/keymaps.conf | 2 +- config/sway/workspace.conf | 57 ++++++++++++++++++++----------------- config/waybar/sway-config | 3 ++ 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/config/sway/config b/config/sway/config index 2b386f7..1b4ba44 100644 --- a/config/sway/config +++ b/config/sway/config @@ -10,14 +10,6 @@ set $config_dir $HOME/.config set $scripts_dir $HOME/.local/scripts -# Systemd integration -#------------------------------------------------------------------------------- - -exec dbus-update-activation-environment --systemd \ - XDG_CURRENT_DESKTOP \ - XDG_SESSION_TYPE \ - WAYLAND_DISPLAY - # Input configuration #------------------------------------------------------------------------------- @@ -64,7 +56,7 @@ smart_gaps on smart_borders off # Autotiling -exec_always autotiling +# exec_always autotiling # Output configuration #------------------------------------------------------------------------------- @@ -122,30 +114,30 @@ for_window [app_id="nwg-look"] resize set 1024 960 for_window [app_id="org.qutebrowser.qutebrowser"] resize set 1600 1200 # Server-side decorations -for_window [app_id="org.gnome.gitlab.somas.Apostrophe"] border normal -for_window [app_id="blueman-manager"] border normal -for_window [app_id="chromium"] border none -for_window [app_id="gcr-viewer"] border normal -for_window [app_id="gcr-prompter"] border normal -for_window [app_id="com.mitchellh.ghostty.*"] border normal -for_window [app_id="gtk-pipe-viewer"] border normal -for_window [app_id="gimp"] border normal -for_window [app_id="imv"] border normal -for_window [app_id="marker"] border normal -for_window [app_id="org.gnome.Nautilus"] border normal -for_window [app_id="nm-connection-editor"] border normal -for_window [app_id="nwg-look"] border normal -for_window [app_id="org.pulseaudio.pavucontrol"] border normal -for_window [app_id="org.gnome.seahorse.Application"] border normal -for_window [app_id="org.gnome.SimpleScan"] border normal -for_window [app_id="com.transmissionbt.transmission.*"] border normal -for_window [app_id="transmission-gtk"] border normal -for_window [app_id="waypaper"] border normal -for_window [app_id="org.wezfurlong.wezterm.*"] border normal -for_window [app_id="xdg-desktop-portal-gtk"] border normal -for_window [app_id="yad"] border normal -for_window [app_id="yad-settings"] border normal -for_window [app_id="org.pwmt.zathura"] border normal +for_window [app_id="org.gnome.gitlab.somas.Apostrophe"] border pixel 3 +for_window [app_id="blueman-manager"] border pixel 3 +for_window [app_id="chromium"] border pixel 3 +for_window [app_id="gcr-viewer"] border pixel 3 +for_window [app_id="gcr-prompter"] border pixel 3 +for_window [app_id="com.mitchellh.ghostty.*"] border pixel 3 +for_window [app_id="gtk-pipe-viewer"] border pixel 3 +for_window [app_id="gimp"] border pixel 3 +for_window [app_id="imv"] border pixel 3 +for_window [app_id="marker"] border pixel 3 +for_window [app_id="org.gnome.Nautilus"] border pixel 3 +for_window [app_id="nm-connection-editor"] border pixel 3 +for_window [app_id="nwg-look"] border pixel 3 +for_window [app_id="org.pulseaudio.pavucontrol"] border pixel 3 +for_window [app_id="org.gnome.seahorse.Application"] border pixel 3 +for_window [app_id="org.gnome.SimpleScan"] border pixel 3 +for_window [app_id="com.transmissionbt.transmission.*"] border pixel 3 +for_window [app_id="transmission-gtk"] border pixel 3 +for_window [app_id="waypaper"] border pixel 3 +for_window [app_id="org.wezfurlong.wezterm.*"] border pixel 3 +for_window [app_id="xdg-desktop-portal-gtk"] border pixel 3 +for_window [app_id="yad"] border pixel 3 +for_window [app_id="yad-settings"] border pixel 3 +for_window [app_id="org.pwmt.zathura"] border pixel 3 # Key mappings #------------------------------------------------------------------------------- diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index a89e1b3..74be2f8 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -111,7 +111,7 @@ bindsym $mod+Control+s move left 200px bindsym $mod+Shift+h exec sway-workspace prev-on-output bindsym $mod+Shift+l exec sway-workspace next-on-output -# Assign workspaces numerically +# Focus workspaces numerically bindsym $mod+1 workspace number 1 bindsym $mod+2 workspace number 2 bindsym $mod+3 workspace number 3 diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf index 37fe05c..e8445fe 100644 --- a/config/sway/workspace.conf +++ b/config/sway/workspace.conf @@ -6,31 +6,36 @@ workspace 1 output DP-3 workspace 2 output DP-3 workspace 3 output DP-3 workspace 4 output DP-3 -workspace 5 output DP-3 -workspace 6 output DP-3 -workspace 7 output DP-3 -workspace 8 output DP-3 -workspace 9 output DP-3 -workspace 10 output DP-3 +workspace home output DP-3 -workspace 11 output HDMI-A-6 -workspace 12 output HDMI-A-6 -workspace 13 output HDMI-A-6 -workspace 14 output HDMI-A-6 -workspace 15 output HDMI-A-6 -workspace 16 output HDMI-A-6 -workspace 17 output HDMI-A-6 -workspace 18 output HDMI-A-6 -workspace 19 output HDMI-A-6 -workspace 20 output HDMI-A-6 +workspace 5 output HDMI-A-6 +workspace 6 output HDMI-A-6 +workspace 7 output HDMI-A-6 +workspace 8 output HDMI-A-6 -workspace 21 output DP-4 -workspace 22 output DP-4 -workspace 23 output DP-4 -workspace 24 output DP-4 -workspace 25 output DP-4 -workspace 26 output DP-4 -workspace 27 output DP-4 -workspace 28 output DP-4 -workspace 29 output DP-4 -workspace 30 output DP-4 +workspace 9 output DP-4 +workspace 10 output DP-4 +workspace 11 output DP-4 +workspace 12 output DP-4 + +# workspace 11 output HDMI-A-6 +# workspace 12 output HDMI-A-6 +# workspace 13 output HDMI-A-6 +# workspace 14 output HDMI-A-6 +# workspace 15 output HDMI-A-6 +# workspace 16 output HDMI-A-6 +# workspace 17 output HDMI-A-6 +# workspace 18 output HDMI-A-6 +# workspace 19 output HDMI-A-6 +# workspace 20 output HDMI-A-6 + +# workspace 21 output DP-4 +# workspace 22 output DP-4 +# workspace 23 output DP-4 +# workspace 24 output DP-4 +# workspace 25 output DP-4 +# workspace 26 output DP-4 +# workspace 27 output DP-4 +# workspace 28 output DP-4 +# workspace 29 output DP-4 +# workspace 30 output DP-4 diff --git a/config/waybar/sway-config b/config/waybar/sway-config index 091b306..4afdf2e 100644 --- a/config/waybar/sway-config +++ b/config/waybar/sway-config @@ -33,6 +33,9 @@ "all-outputs": false, "format": "{name}", "disable-scroll": true, + "persistent-workspaces": [ + "home" + ] }, "sway/window": { "max-length": 160, From 4daa8436b435f57c32ace0e3ed653a56c0968959 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 28 Oct 2025 11:32:53 +0100 Subject: [PATCH 05/18] [WIP] sway workspace bindings --- config/sway/keymaps.conf | 43 ++++++++++++------------ config/sway/sws.sh | 48 ++++++++++++++++++++++++++ config/sway/theme.conf~esh | 10 +++--- config/sway/workspace.conf | 69 ++++++++++++++++++-------------------- deploy/modules/sway.sh | 2 ++ 5 files changed, 109 insertions(+), 63 deletions(-) create mode 100755 config/sway/sws.sh diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index 74be2f8..c7d4afd 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -111,28 +111,27 @@ bindsym $mod+Control+s move left 200px bindsym $mod+Shift+h exec sway-workspace prev-on-output bindsym $mod+Shift+l exec sway-workspace next-on-output -# Focus workspaces numerically -bindsym $mod+1 workspace number 1 -bindsym $mod+2 workspace number 2 -bindsym $mod+3 workspace number 3 -bindsym $mod+4 workspace number 4 -bindsym $mod+5 workspace number 5 -bindsym $mod+6 workspace number 6 -bindsym $mod+7 workspace number 7 -bindsym $mod+8 workspace number 8 -bindsym $mod+9 workspace number 9 - -# TODO: implement -# Send window to workspace -# bindsym $mod+Control+1 exec $HOME/.config/sway/send-view-to-workspace.sh 1 -# bindsym $mod+Control+2 exec $HOME/.config/sway/send-view-to-workspace.sh 2 -# bindsym $mod+Control+3 exec $HOME/.config/sway/send-view-to-workspace.sh 3 -# bindsym $mod+Control+4 exec $HOME/.config/sway/send-view-to-workspace.sh 4 -# bindsym $mod+Control+5 exec $HOME/.config/sway/send-view-to-workspace.sh 5 -# bindsym $mod+Control+6 exec $HOME/.config/sway/send-view-to-workspace.sh 6 -# bindsym $mod+Control+7 exec $HOME/.config/sway/send-view-to-workspace.sh 7 -# bindsym $mod+Control+8 exec $HOME/.config/sway/send-view-to-workspace.sh 8 -# bindsym $mod+Control+9 exec $HOME/.config/sway/send-view-to-workspace.sh 9 +# Focus workspaces numerically (display-aware) +bindsym $mod+1 exec $config_dir/sway/sws.sh focus 1 +bindsym $mod+2 exec $config_dir/sway/sws.sh focus 2 +bindsym $mod+3 exec $config_dir/sway/sws.sh focus 3 +bindsym $mod+4 exec $config_dir/sway/sws.sh focus 4 +bindsym $mod+5 exec $config_dir/sway/sws.sh focus 5 +bindsym $mod+6 exec $config_dir/sway/sws.sh focus 6 +bindsym $mod+7 exec $config_dir/sway/sws.sh focus 7 +bindsym $mod+8 exec $config_dir/sway/sws.sh focus 8 +bindsym $mod+9 exec $config_dir/sway/sws.sh focus 9 + +# Send window to workspace (display-aware) +bindsym $mod+Control+1 exec $config_dir/sway/sws.sh move 1 +bindsym $mod+Control+2 exec $config_dir/sway/sws.sh move 2 +bindsym $mod+Control+3 exec $config_dir/sway/sws.sh move 3 +bindsym $mod+Control+4 exec $config_dir/sway/sws.sh move 4 +bindsym $mod+Control+5 exec $config_dir/sway/sws.sh move 5 +bindsym $mod+Control+6 exec $config_dir/sway/sws.sh move 6 +bindsym $mod+Control+7 exec $config_dir/sway/sws.sh move 7 +bindsym $mod+Control+8 exec $config_dir/sway/sws.sh move 8 +bindsym $mod+Control+9 exec $config_dir/sway/sws.sh move 9 # Layout mappings #------------------------------------------------------------------------------- diff --git a/config/sway/sws.sh b/config/sway/sws.sh new file mode 100755 index 0000000..2ceef7d --- /dev/null +++ b/config/sway/sws.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------- +# Sway workspace switcher +# +# TODO: don't hardcode outputs +#------------------------------------------------------------------------------- + +set -euo pipefail + +if [[ $# -lt 2 ]]; then + echo "Usage: $0 " + echo " action: 'focus' or 'move'" + echo " workspace_number: 1-9" + exit 1 +fi + +action="$1" +workspace_num="$2" + +focused_output=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') + +case "$focused_output" in + "HDMI-A-6") + workspace_name="1${workspace_num}" + ;; + "DP-3") + workspace_name="${workspace_num}" + ;; + "DP-4") + workspace_name="2${workspace_num}" + ;; + *) + workspace_name="${workspace_num}" + ;; +esac + +case "$action" in + "focus") + swaymsg workspace "$workspace_name" + ;; + "move") + swaymsg move container to workspace "$workspace_name" + ;; + *) + echo "Invalid action: $action" + exit 1 + ;; +esac diff --git a/config/sway/theme.conf~esh b/config/sway/theme.conf~esh index 6dccd67..a557de8 100644 --- a/config/sway/theme.conf~esh +++ b/config/sway/theme.conf~esh @@ -8,8 +8,8 @@ seat * xcursor_theme "<%= ${cursor_theme} %>" <%= ${cursor_size} %> # Color scheme -# class border background text indicator child_border -client.focused <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> -client.focused_inactive <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> -client.unfocused <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> -client.urgent <%= $(color_hash "${red_4}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> +# class border bg text hint child +client.focused <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> +client.focused_inactive <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> +client.unfocused <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> +client.urgent <%= $(color_hash "${red_4}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf index e8445fe..277590e 100644 --- a/config/sway/workspace.conf +++ b/config/sway/workspace.conf @@ -1,41 +1,38 @@ #------------------------------------------------------------------------------- -# Workspace assignments +# Workspace assignments - Display-aware named workspaces #------------------------------------------------------------------------------- -workspace 1 output DP-3 -workspace 2 output DP-3 -workspace 3 output DP-3 -workspace 4 output DP-3 -workspace home output DP-3 +workspace 1:1 output DP-3 +workspace 2:2 output DP-3 +workspace 3:3 output DP-3 +workspace 4:4 output DP-3 +workspace 5:5 output DP-3 +workspace 6:6 output DP-3 +workspace 7:7 output DP-3 +workspace 8:8 output DP-3 +workspace 9:9 output DP-3 +workspace 10:10 output DP-3 -workspace 5 output HDMI-A-6 -workspace 6 output HDMI-A-6 -workspace 7 output HDMI-A-6 -workspace 8 output HDMI-A-6 +# left +workspace 11:11 output HDMI-A-6 +workspace 12:12 output HDMI-A-6 +workspace 13:13 output HDMI-A-6 +workspace 14:14 output HDMI-A-6 +workspace 15:15 output HDMI-A-6 +workspace 16:16 output HDMI-A-6 +workspace 17:17 output HDMI-A-6 +workspace 18:18 output HDMI-A-6 +workspace 19:19 output HDMI-A-6 +workspace 20:20 output HDMI-A-6 -workspace 9 output DP-4 -workspace 10 output DP-4 -workspace 11 output DP-4 -workspace 12 output DP-4 - -# workspace 11 output HDMI-A-6 -# workspace 12 output HDMI-A-6 -# workspace 13 output HDMI-A-6 -# workspace 14 output HDMI-A-6 -# workspace 15 output HDMI-A-6 -# workspace 16 output HDMI-A-6 -# workspace 17 output HDMI-A-6 -# workspace 18 output HDMI-A-6 -# workspace 19 output HDMI-A-6 -# workspace 20 output HDMI-A-6 - -# workspace 21 output DP-4 -# workspace 22 output DP-4 -# workspace 23 output DP-4 -# workspace 24 output DP-4 -# workspace 25 output DP-4 -# workspace 26 output DP-4 -# workspace 27 output DP-4 -# workspace 28 output DP-4 -# workspace 29 output DP-4 -# workspace 30 output DP-4 +# right +workspace 21:21 output DP-4 +workspace 22:22 output DP-4 +workspace 23:23 output DP-4 +workspace 24:24 output DP-4 +workspace 25:25 output DP-4 +workspace 26:26 output DP-4 +workspace 27:27 output DP-4 +workspace 28:28 output DP-4 +workspace 29:29 output DP-4 +workspace 30:30 output DP-4 diff --git a/deploy/modules/sway.sh b/deploy/modules/sway.sh index 453112d..5afc797 100755 --- a/deploy/modules/sway.sh +++ b/deploy/modules/sway.sh @@ -17,6 +17,8 @@ sway::install () { force_link "$base_dir/config/sway/config" "$XDG_CONFIG_HOME/sway/config" force_link "$base_dir/config/sway/environment.sh" "$XDG_CONFIG_HOME/sway/environment.sh" force_link "$base_dir/config/sway/keymaps.conf" "$XDG_CONFIG_HOME/sway/keymaps.conf" + force_link "$base_dir/config/sway/workspace.conf" "$XDG_CONFIG_HOME/sway/workspace.conf" + force_link "$base_dir/config/sway/sws.sh" "$XDG_CONFIG_HOME/sway/sws.sh" if [[ $host == "supertubes" ]] || [[ $host == "cyxwel" ]]; then force_link "$base_dir/config/sway/outputs.conf~home-triple" "$XDG_CONFIG_HOME/sway/outputs.conf" From 16fce9e5a1819ccdb68ea6d12e92aa16f36b2722 Mon Sep 17 00:00:00 2001 From: Casper Date: Wed, 29 Oct 2025 13:31:49 +0100 Subject: [PATCH 06/18] [WIP] sway urgency is dumb --- config/sway/theme.conf~esh | 2 +- config/waybar/sway-style.css~esh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/sway/theme.conf~esh b/config/sway/theme.conf~esh index a557de8..8f3a6b3 100644 --- a/config/sway/theme.conf~esh +++ b/config/sway/theme.conf~esh @@ -12,4 +12,4 @@ seat * xcursor_theme "<%= ${cursor_theme} %>" <%= ${cursor_size} %> client.focused <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> <%= $(color_hash "${primary_8}") %> client.focused_inactive <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> client.unfocused <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> -client.urgent <%= $(color_hash "${red_4}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> <%= $(color_hash "${red_4}") %> +client.urgent <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${system_bg}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> <%= $(color_hash "${primary_3}") %> diff --git a/config/waybar/sway-style.css~esh b/config/waybar/sway-style.css~esh index f410bf1..e2e599a 100644 --- a/config/waybar/sway-style.css~esh +++ b/config/waybar/sway-style.css~esh @@ -71,7 +71,7 @@ box > * > * { } #workspaces button.urgent { - background-color: <% color_hash $red_4 %>; + background-color: <% color_hash $primary_3 %>; } /* Network From 5badbb8ccc4f84168bcdba37da0b4d779847bfce Mon Sep 17 00:00:00 2001 From: Casper Date: Wed, 29 Oct 2025 23:16:14 +0100 Subject: [PATCH 07/18] [WIP] sway fix outer gaps --- config/sway/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sway/config b/config/sway/config index 1b4ba44..398349a 100644 --- a/config/sway/config +++ b/config/sway/config @@ -47,7 +47,7 @@ input "43256:6199:Bastard_Keyboards_Dilemma_Max_Mouse" { #------------------------------------------------------------------------------- gaps inner 6 -gaps outer 0 +gaps outer -6 default_border pixel 3 default_floating_border pixel 3 From d4371e5e386e38ee148f6c1a43baca13121d89b6 Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 30 Oct 2025 21:53:29 +0100 Subject: [PATCH 08/18] sway: Tweak workspaces. --- config/sway/workspace.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf index 277590e..b66eaf2 100644 --- a/config/sway/workspace.conf +++ b/config/sway/workspace.conf @@ -2,7 +2,7 @@ # Workspace assignments - Display-aware named workspaces #------------------------------------------------------------------------------- -workspace 1:1 output DP-3 +workspace 1 output DP-3 workspace 2:2 output DP-3 workspace 3:3 output DP-3 workspace 4:4 output DP-3 From 0b3bfde6625452a0db28420f586324c63858cf33 Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 31 Oct 2025 00:36:42 +0100 Subject: [PATCH 09/18] [WIP] --- config/sway/keymaps.conf | 4 +++- config/sway/refresh.sh | 23 +---------------------- config/sway/sws.sh | 2 +- deploy/modules/sway.sh | 3 ++- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index c7d4afd..43bc86c 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -19,7 +19,7 @@ bindsym $mod+Shift+z exec hyprlock bindsym $mod+Shift+w exit # Reload sway configuration -bindsym $mod+Shift+r reload +bindsym $mod+Shift+r reload, exec $config_dir/sway/refresh.sh # Shortcut mappings #------------------------------------------------------------------------------- @@ -121,6 +121,7 @@ bindsym $mod+6 exec $config_dir/sway/sws.sh focus 6 bindsym $mod+7 exec $config_dir/sway/sws.sh focus 7 bindsym $mod+8 exec $config_dir/sway/sws.sh focus 8 bindsym $mod+9 exec $config_dir/sway/sws.sh focus 9 +bindsym $mod+0 exec $config_dir/sway/sws.sh focus 10 # Send window to workspace (display-aware) bindsym $mod+Control+1 exec $config_dir/sway/sws.sh move 1 @@ -132,6 +133,7 @@ bindsym $mod+Control+6 exec $config_dir/sway/sws.sh move 6 bindsym $mod+Control+7 exec $config_dir/sway/sws.sh move 7 bindsym $mod+Control+8 exec $config_dir/sway/sws.sh move 8 bindsym $mod+Control+9 exec $config_dir/sway/sws.sh move 9 +bindsym $mod+Control+0 exec $config_dir/sway/sws.sh move 10 # Layout mappings #------------------------------------------------------------------------------- diff --git a/config/sway/refresh.sh b/config/sway/refresh.sh index 41d9ed4..3a130e9 100755 --- a/config/sway/refresh.sh +++ b/config/sway/refresh.sh @@ -1,26 +1,5 @@ #!/usr/bin/env bash #------------------------------------------------------------------------------- -# Refresh the usual suspects. +# Refresh the usual suspects #------------------------------------------------------------------------------- -# Way-displays -#-------------------------------------------------------------------------------- - -pkill -x way-displays -way-displays > "/tmp/way-displays.${XDG_VTNR}.${USER}.log" 2>&1 & - -# NOTE: Way-displays needs a moment. -sleep 0.25 - -# Autotiling -#-------------------------------------------------------------------------------- - -pkill -x autotiling - -swaymsg "exec autotiling --outputs DP-3" -swaymsg "exec autotiling --outputs HDMI-A-6 DP-4 --splitratio 0.2" - -# Reload Sway configuration -#-------------------------------------------------------------------------------- - -swaymsg reload diff --git a/config/sway/sws.sh b/config/sway/sws.sh index 2ceef7d..9bda5c3 100755 --- a/config/sway/sws.sh +++ b/config/sway/sws.sh @@ -10,7 +10,7 @@ set -euo pipefail if [[ $# -lt 2 ]]; then echo "Usage: $0 " echo " action: 'focus' or 'move'" - echo " workspace_number: 1-9" + echo " workspace_number: 1-10" exit 1 fi diff --git a/deploy/modules/sway.sh b/deploy/modules/sway.sh index 5afc797..fd03641 100755 --- a/deploy/modules/sway.sh +++ b/deploy/modules/sway.sh @@ -17,8 +17,9 @@ sway::install () { force_link "$base_dir/config/sway/config" "$XDG_CONFIG_HOME/sway/config" force_link "$base_dir/config/sway/environment.sh" "$XDG_CONFIG_HOME/sway/environment.sh" force_link "$base_dir/config/sway/keymaps.conf" "$XDG_CONFIG_HOME/sway/keymaps.conf" - force_link "$base_dir/config/sway/workspace.conf" "$XDG_CONFIG_HOME/sway/workspace.conf" + force_link "$base_dir/config/sway/refresh.conf" "$XDG_CONFIG_HOME/sway/refresh.conf" force_link "$base_dir/config/sway/sws.sh" "$XDG_CONFIG_HOME/sway/sws.sh" + force_link "$base_dir/config/sway/workspace.conf" "$XDG_CONFIG_HOME/sway/workspace.conf" if [[ $host == "supertubes" ]] || [[ $host == "cyxwel" ]]; then force_link "$base_dir/config/sway/outputs.conf~home-triple" "$XDG_CONFIG_HOME/sway/outputs.conf" From 8e11c2939bcbdfe821bdb09ab993419a2d32d203 Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 31 Oct 2025 00:56:34 +0100 Subject: [PATCH 10/18] [WIP] sway add special workspaces --- config/sway/keymaps.conf | 12 ++++++++++++ config/sway/workspace.conf | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index 43bc86c..9143c7c 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -123,6 +123,12 @@ bindsym $mod+8 exec $config_dir/sway/sws.sh focus 8 bindsym $mod+9 exec $config_dir/sway/sws.sh focus 9 bindsym $mod+0 exec $config_dir/sway/sws.sh focus 10 +# Focus special workspaces +bindsym $mod+F1 exec $config_dir/sway/sws.sh focus home +bindsym $mod+F2 exec $config_dir/sway/sws.sh focus work +bindsym $mod+F3 exec $config_dir/sway/sws.sh focus todo +bindsym $mod+F4 exec $config_dir/sway/sws.sh focus spotify + # Send window to workspace (display-aware) bindsym $mod+Control+1 exec $config_dir/sway/sws.sh move 1 bindsym $mod+Control+2 exec $config_dir/sway/sws.sh move 2 @@ -135,6 +141,12 @@ bindsym $mod+Control+8 exec $config_dir/sway/sws.sh move 8 bindsym $mod+Control+9 exec $config_dir/sway/sws.sh move 9 bindsym $mod+Control+0 exec $config_dir/sway/sws.sh move 10 +# Send to special workspaces +bindsym $mod+Control+F1 exec $config_dir/sway/sws.sh move home +bindsym $mod+Control+F2 exec $config_dir/sway/sws.sh move work +bindsym $mod+Control+F3 exec $config_dir/sway/sws.sh move todo +bindsym $mod+Control+F4 exec $config_dir/sway/sws.sh move spotify + # Layout mappings #------------------------------------------------------------------------------- diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf index b66eaf2..0937f71 100644 --- a/config/sway/workspace.conf +++ b/config/sway/workspace.conf @@ -12,6 +12,10 @@ workspace 7:7 output DP-3 workspace 8:8 output DP-3 workspace 9:9 output DP-3 workspace 10:10 output DP-3 +workspace home output DP-3 +workspace work output DP-3 +workspace todo output DP-3 +workspace spotify output DP-3 # left workspace 11:11 output HDMI-A-6 From 97421ed7c03104e3172b8286762c2accc64dc99c Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 31 Oct 2025 12:04:50 +0100 Subject: [PATCH 11/18] sway: Add refresh script. --- config/sway/keymaps.conf | 2 +- config/sway/refresh.sh | 3 +++ deploy/modules/sway.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index 9143c7c..75c9080 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -19,7 +19,7 @@ bindsym $mod+Shift+z exec hyprlock bindsym $mod+Shift+w exit # Reload sway configuration -bindsym $mod+Shift+r reload, exec $config_dir/sway/refresh.sh +bindsym $mod+Shift+r exec $config_dir/sway/refresh.sh # Shortcut mappings #------------------------------------------------------------------------------- diff --git a/config/sway/refresh.sh b/config/sway/refresh.sh index 3a130e9..bcde208 100755 --- a/config/sway/refresh.sh +++ b/config/sway/refresh.sh @@ -3,3 +3,6 @@ # Refresh the usual suspects #------------------------------------------------------------------------------- +swaymsg reload + +notify-send "Reloaded sway config." diff --git a/deploy/modules/sway.sh b/deploy/modules/sway.sh index fd03641..fc44c76 100755 --- a/deploy/modules/sway.sh +++ b/deploy/modules/sway.sh @@ -17,7 +17,7 @@ sway::install () { force_link "$base_dir/config/sway/config" "$XDG_CONFIG_HOME/sway/config" force_link "$base_dir/config/sway/environment.sh" "$XDG_CONFIG_HOME/sway/environment.sh" force_link "$base_dir/config/sway/keymaps.conf" "$XDG_CONFIG_HOME/sway/keymaps.conf" - force_link "$base_dir/config/sway/refresh.conf" "$XDG_CONFIG_HOME/sway/refresh.conf" + force_link "$base_dir/config/sway/refresh.sh" "$XDG_CONFIG_HOME/sway/refresh.sh" force_link "$base_dir/config/sway/sws.sh" "$XDG_CONFIG_HOME/sway/sws.sh" force_link "$base_dir/config/sway/workspace.conf" "$XDG_CONFIG_HOME/sway/workspace.conf" From 2a6bae171a2f81142c69844a2f6d59ba3c611467 Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 31 Oct 2025 12:05:47 +0100 Subject: [PATCH 12/18] [WIP] sway workspaces --- config/sway/workspace.conf | 42 ----------------------- config/sway/workspace.conf~home-triple | 46 ++++++++++++++++++++++++++ config/sway/workspace.conf~intelic | 33 ++++++++++++++++++ deploy/modules/sway.sh | 3 +- 4 files changed, 81 insertions(+), 43 deletions(-) delete mode 100644 config/sway/workspace.conf create mode 100644 config/sway/workspace.conf~home-triple create mode 100644 config/sway/workspace.conf~intelic diff --git a/config/sway/workspace.conf b/config/sway/workspace.conf deleted file mode 100644 index 0937f71..0000000 --- a/config/sway/workspace.conf +++ /dev/null @@ -1,42 +0,0 @@ -#------------------------------------------------------------------------------- -# Workspace assignments - Display-aware named workspaces -#------------------------------------------------------------------------------- - -workspace 1 output DP-3 -workspace 2:2 output DP-3 -workspace 3:3 output DP-3 -workspace 4:4 output DP-3 -workspace 5:5 output DP-3 -workspace 6:6 output DP-3 -workspace 7:7 output DP-3 -workspace 8:8 output DP-3 -workspace 9:9 output DP-3 -workspace 10:10 output DP-3 -workspace home output DP-3 -workspace work output DP-3 -workspace todo output DP-3 -workspace spotify output DP-3 - -# left -workspace 11:11 output HDMI-A-6 -workspace 12:12 output HDMI-A-6 -workspace 13:13 output HDMI-A-6 -workspace 14:14 output HDMI-A-6 -workspace 15:15 output HDMI-A-6 -workspace 16:16 output HDMI-A-6 -workspace 17:17 output HDMI-A-6 -workspace 18:18 output HDMI-A-6 -workspace 19:19 output HDMI-A-6 -workspace 20:20 output HDMI-A-6 - -# right -workspace 21:21 output DP-4 -workspace 22:22 output DP-4 -workspace 23:23 output DP-4 -workspace 24:24 output DP-4 -workspace 25:25 output DP-4 -workspace 26:26 output DP-4 -workspace 27:27 output DP-4 -workspace 28:28 output DP-4 -workspace 29:29 output DP-4 -workspace 30:30 output DP-4 diff --git a/config/sway/workspace.conf~home-triple b/config/sway/workspace.conf~home-triple new file mode 100644 index 0000000..5f96a73 --- /dev/null +++ b/config/sway/workspace.conf~home-triple @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------- +# Workspace configuration at home +#------------------------------------------------------------------------------- + +set $primary "DP-3" +set $left "HDMI-A-6" +set $right "DP-4" + +workspace 1 output $primary +workspace 2:2 output $primary +workspace 3:3 output $primary +workspace 4:4 output $primary +workspace 5:5 output $primary +workspace 6:6 output $primary +workspace 7:7 output $primary +workspace 8:8 output $primary +workspace 9:9 output $primary +workspace 10:10 output $primary +workspace home output $primary +workspace work output $primary +workspace todo output $primary +workspace spotify output $primary + +# left +workspace 11:11 output $left +workspace 12:12 output $left +workspace 13:13 output $left +workspace 14:14 output $left +workspace 15:15 output $left +workspace 16:16 output $left +workspace 17:17 output $left +workspace 18:18 output $left +workspace 19:19 output $left +workspace 20:20 output $left + +# right +workspace 21:21 output $right +workspace 22:22 output $right +workspace 23:23 output $right +workspace 24:24 output $right +workspace 25:25 output $right +workspace 26:26 output $right +workspace 27:27 output $right +workspace 28:28 output $right +workspace 29:29 output $right +workspace 30:30 output $right diff --git a/config/sway/workspace.conf~intelic b/config/sway/workspace.conf~intelic new file mode 100644 index 0000000..47e561b --- /dev/null +++ b/config/sway/workspace.conf~intelic @@ -0,0 +1,33 @@ +#------------------------------------------------------------------------------- +# Workspace configuration at Intelic +#------------------------------------------------------------------------------- + +set $primary "LG Electronics LG ULTRAWIDE 405NTPC4A128" +set $laptop "eDP-1" + +workspace 1 output $primary +workspace 2:2 output $primary +workspace 3:3 output $primary +workspace 4:4 output $primary +workspace 5:5 output $primary +workspace 6:6 output $primary +workspace 7:7 output $primary +workspace 8:8 output $primary +workspace 9:9 output $primary +workspace 10:10 output $primary +workspace home output $primary +workspace work output $primary +workspace todo output $primary +workspace spotify output $primary + +# laptop +workspace 11:11 output $laptop +workspace 12:12 output $laptop +workspace 13:13 output $laptop +workspace 14:14 output $laptop +workspace 15:15 output $laptop +workspace 16:16 output $laptop +workspace 17:17 output $laptop +workspace 18:18 output $laptop +workspace 19:19 output $laptop +workspace 20:20 output $laptop diff --git a/deploy/modules/sway.sh b/deploy/modules/sway.sh index fc44c76..a4ec978 100755 --- a/deploy/modules/sway.sh +++ b/deploy/modules/sway.sh @@ -19,13 +19,14 @@ sway::install () { force_link "$base_dir/config/sway/keymaps.conf" "$XDG_CONFIG_HOME/sway/keymaps.conf" force_link "$base_dir/config/sway/refresh.sh" "$XDG_CONFIG_HOME/sway/refresh.sh" force_link "$base_dir/config/sway/sws.sh" "$XDG_CONFIG_HOME/sway/sws.sh" - force_link "$base_dir/config/sway/workspace.conf" "$XDG_CONFIG_HOME/sway/workspace.conf" if [[ $host == "supertubes" ]] || [[ $host == "cyxwel" ]]; then force_link "$base_dir/config/sway/outputs.conf~home-triple" "$XDG_CONFIG_HOME/sway/outputs.conf" + force_link "$base_dir/config/sway/workspace.conf~home-triple" "$XDG_CONFIG_HOME/sway/workspace.conf" elif [[ $host == "vortex" ]]; then force_link "$base_dir/config/sway/outputs.conf~intelic" "$XDG_CONFIG_HOME/sway/outputs.conf" + force_link "$base_dir/config/sway/workspace.conf~intelic" "$XDG_CONFIG_HOME/sway/workspace.conf" else echo "└> Warning: No outputs.conf configuration for host '$host'." From 5b8baa231ea06727497087d8845b2445261d63d5 Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 31 Oct 2025 12:09:53 +0100 Subject: [PATCH 13/18] sway: Fix alacritty missing SSD. --- config/scripts-desktop/spawn-terminal.sh | 2 +- config/sway/config | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/scripts-desktop/spawn-terminal.sh b/config/scripts-desktop/spawn-terminal.sh index 8d81ba1..6824e8a 100755 --- a/config/scripts-desktop/spawn-terminal.sh +++ b/config/scripts-desktop/spawn-terminal.sh @@ -177,7 +177,7 @@ if [[ $TERMINAL == "alacritty" ]]; then terminal_cmd=("alacritty") if [[ "$floating" = true ]]; then - args+=("--class=floating") + args+=("--class=Alacritty.floating") args+=("-o window.dimensions.columns=120") args+=("-o window.dimensions.lines=32") fi diff --git a/config/sway/config b/config/sway/config index 398349a..45e0a1c 100644 --- a/config/sway/config +++ b/config/sway/config @@ -114,6 +114,7 @@ for_window [app_id="nwg-look"] resize set 1024 960 for_window [app_id="org.qutebrowser.qutebrowser"] resize set 1600 1200 # Server-side decorations +for_window [app_id="Alacritty"] border pixel 3 for_window [app_id="org.gnome.gitlab.somas.Apostrophe"] border pixel 3 for_window [app_id="blueman-manager"] border pixel 3 for_window [app_id="chromium"] border pixel 3 From 80cbd8dcddb4afef5a1b391073e76d8e7d2f5905 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 28 Oct 2025 15:11:46 +0100 Subject: [PATCH 14/18] [WIP] hyprlock... --- install/ubuntu.sh | 261 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 244 insertions(+), 17 deletions(-) diff --git a/install/ubuntu.sh b/install/ubuntu.sh index d3aec25..207ac2d 100755 --- a/install/ubuntu.sh +++ b/install/ubuntu.sh @@ -496,40 +496,267 @@ install_gtk_theme() { log_success "GTK theme installed" } +install_sdbus_cpp() { + if dpkg -l | grep -q "^ii libsdbus-c++-dev"; then + log_info "Removing conflicting old libsdbus-c++-dev package..." + sudo apt remove -y libsdbus-c++-dev libsdbus-c++1 + fi + + local current_version + current_version=$(pkg-config --modversion sdbus-c++ 2>/dev/null || echo "0.0.0") + + if [[ "$(printf '%s\n' "2.0.0" "$current_version" | sort -V | head -n1)" == "2.0.0" ]]; then + log_success "sdbus-c++ >= 2.0.0 is already installed (version $current_version)" + return + fi + + log_info "Installing sdbus-c++ >= 2.0.0..." + + install_apt_packages libsystemd-dev libexpat1-dev + + pushd /tmp >/dev/null + + local tag="v2.0.0" + local build_dir="sdbus-cpp-build-$$" + + if git clone --depth 1 -b $tag https://github.com/Kistler-Group/sdbus-cpp.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. + make -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + sudo make install + + popd >/dev/null + rm -rf "$build_dir" + + if [[ ! -f /etc/ld.so.conf.d/usr-local.conf ]]; then + echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/usr-local.conf > /dev/null + echo "/usr/local/lib/x86_64-linux-gnu" | sudo tee -a /etc/ld.so.conf.d/usr-local.conf > /dev/null + fi + + sudo ldconfig + log_success "sdbus-c++ installed" + else + log_error "Download failed for sdbus-c++" + fi + + popd >/dev/null +} + +install_hyprutils() { + if pkg-config --exists hyprutils; then + log_success "hyprutils is already installed" + return + fi + + log_info "Installing hyprutils..." + pushd /tmp >/dev/null + + local tag="v0.8.2" + local build_dir="hyprutils-build-$$" + + if git clone -b $tag https://github.com/hyprwm/hyprutils.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -S . -B ./build + cmake --build ./build --config Release --target hyprutils -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + sudo cmake --install build + + popd >/dev/null + rm -rf "$build_dir" + log_success "hyprutils installed" + else + log_error "Download failed for hyprutils" + fi + + popd >/dev/null +} + +install_hyprlang() { + if pkg-config --exists hyprlang; then + log_success "hyprlang is already installed" + return + fi + + log_info "Installing hyprlang..." + install_apt_packages gcc-14 g++-14 + + pushd /tmp >/dev/null + + local tag="v0.6.4" + local build_dir="hyprlang-build-$$" + + if git clone --recursive -b $tag https://github.com/hyprwm/hyprlang.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + + cmake --no-warn-unused-cli \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ + -DCMAKE_C_COMPILER=/usr/bin/gcc-14 \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++-14 \ + -S . -B ./build + cmake --build ./build --config Release --target hyprlang -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + sudo cmake --install ./build + + popd >/dev/null + rm -rf "$build_dir" + log_success "hyprlang installed" + else + log_error "Download failed for hyprlang" + fi + + popd >/dev/null +} + +install_hyprwayland_scanner() { + if command_exists hyprwayland-scanner; then + log_success "hyprwayland-scanner is already installed" + return + fi + + log_info "Installing hyprwayland-scanner..." + install_apt_packages libpugixml-dev + + pushd /tmp >/dev/null + + local tag="v0.4.5" + local build_dir="hyprwayland-scanner-build-$$" + + if git clone --recursive -b $tag https://github.com/hyprwm/hyprwayland-scanner.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + cmake -DCMAKE_INSTALL_PREFIX=/usr -B build + cmake --build build -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + sudo cmake --install build + + popd >/dev/null + rm -rf "$build_dir" + log_success "hyprwayland-scanner installed" + else + log_error "Download failed for hyprwayland-scanner" + fi + + popd >/dev/null +} + +install_hyprgraphics() { + if pkg-config --exists hyprgraphics; then + log_success "hyprgraphics is already installed" + return + fi + + log_info "Installing hyprgraphics..." + install_apt_packages libjpeg-dev libwebp-dev libpng-dev + + pushd /tmp >/dev/null + + local tag="v0.1.5" + local build_dir="hyprgraphics-build-$$" + + if git clone --recursive -b $tag https://github.com/hyprwm/hyprgraphics.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build + cmake --build ./build --config Release --target hyprgraphics -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + sudo cmake --install ./build + + popd >/dev/null + rm -rf "$build_dir" + log_success "hyprgraphics installed" + else + log_error "Download failed for hyprgraphics" + fi + + popd >/dev/null +} + install_hyprlock() { if command_exists hyprlock; then log_success "hyprlock is already installed" return fi - log_info "Installing hyprlock..." + log_info "Installing hyprlock dependencies..." install_apt_packages \ libpam0g-dev libgbm-dev libdrm-dev libmagic-dev libaudit-dev \ - libsdbus-c++-dev libgl1-mesa-dev + libgl1-mesa-dev \ + libwayland-dev libcairo2-dev libpango1.0-dev libxkbcommon-dev - local tag="v0.9.1" + install_sdbus_cpp + install_hyprutils + install_hyprlang + install_hyprwayland_scanner + install_hyprgraphics - local hyprlock_dir="/tmp/hyprlock-build-$$" - mkdir -p "$hyprlock_dir" + if [[ ! -f /etc/ld.so.conf.d/usr-local.conf ]]; then + echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/usr-local.conf > /dev/null + echo "/usr/local/lib/x86_64-linux-gnu" | sudo tee -a /etc/ld.so.conf.d/usr-local.conf > /dev/null + fi - pushd "$hyprlock_dir" >/dev/null + sudo ldconfig - if git clone --recursive -b $tag https://github.com/hyprwm/hyprlock.git; then - pushd hyprlock >/dev/null + log_info "Building hyprlock..." - cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build - cmake --build ./build --config Release --target hyprlock -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + local old_sdbus_moved=false + if [[ -f /lib/x86_64-linux-gnu/libsdbus-c++.so.1 ]]; then + log_info "Temporarily moving conflicting libsdbus-c++.so.1..." + sudo mv /lib/x86_64-linux-gnu/libsdbus-c++.so.1 /lib/x86_64-linux-gnu/libsdbus-c++.so.1.backup 2>/dev/null && old_sdbus_moved=true + sudo mv /lib/x86_64-linux-gnu/libsdbus-c++.so /lib/x86_64-linux-gnu/libsdbus-c++.so.backup 2>/dev/null + sudo ldconfig + fi - if sudo cmake --install build 2>&1 ; then - log_success "hyprlock $tag installed successfully." + pushd /tmp >/dev/null - else - log_error "Installation failed for hyprlock $tag" - fi + local tag="v0.9.1" + local build_dir="hyprlock-build-$$" + + if git clone --recursive -b $tag https://github.com/hyprwm/hyprlock.git "$build_dir"; then + pushd "$build_dir" >/dev/null + + rm -f src/auth/Fingerprint.cpp src/auth/Fingerprint.hpp + sed -i '/#include.*Fingerprint.hpp/d' src/auth/Auth.cpp + sed -i '/#include.*Fingerprint.hpp/d' src/core/hyprlock.cpp + sed -i '1i#include ' src/auth/Auth.cpp + sed -i '/ENABLEFINGERPRINT/,/makeShared()/d' src/auth/Auth.cpp + sed -i 's/std::ranges::any_of/std::any_of/g' src/auth/Auth.cpp + sed -i 's|return std::any_of.*|return std::any_of(m_vImpls.begin(), m_vImpls.end(), [](const auto\& i) { return i->checkWaiting(); });|' src/auth/Auth.cpp + sed -i '/fingerprintAuth.*g_pAuth->getImpl/d' src/core/hyprlock.cpp + sed -i '/dbusConn.*CFingerprint/d' src/core/hyprlock.cpp + sed -i 's/fdcount = dbusConn ? 2 : 1/fdcount = 1/g' src/core/hyprlock.cpp + sed -i '/if (dbusConn) {/,/^ }/d' src/core/hyprlock.cpp + sed -i '/if (pollfds\[1\]\.revents.*dbus/,/^ }/d' src/core/hyprlock.cpp + + export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" + + cmake --no-warn-unused-cli \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_PREFIX="$HOME/.local" \ + -DCMAKE_C_COMPILER=/usr/bin/gcc-14 \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++-14 \ + -DCMAKE_PREFIX_PATH=/usr/local \ + -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" \ + -S . -B ./build + cmake --build ./build --config Release --target hyprlock -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF) + cmake --install build popd >/dev/null + rm -rf "$build_dir" + log_success "hyprlock installed" else - log_error "Download failed for hyprlock $tag" + log_error "Download failed for hyprlock" + fi + + if [[ "$old_sdbus_moved" == "true" ]]; then + log_info "Restoring old libsdbus-c++ libraries..." + sudo mv /lib/x86_64-linux-gnu/libsdbus-c++.so.1.backup /lib/x86_64-linux-gnu/libsdbus-c++.so.1 2>/dev/null + sudo mv /lib/x86_64-linux-gnu/libsdbus-c++.so.backup /lib/x86_64-linux-gnu/libsdbus-c++.so 2>/dev/null + sudo ldconfig fi popd >/dev/null @@ -574,7 +801,7 @@ install_sway() { log_info "Installing sway..." install_apt_packages \ - sway waybar hyprlock fuzzel mako-notifier + sway waybar fuzzel mako-notifier cargo install sway-workspace pipx install autotiling From 52c3e84fe9632a6044da864a9a3b60493d000054 Mon Sep 17 00:00:00 2001 From: Casper Date: Sat, 1 Nov 2025 15:06:43 +0100 Subject: [PATCH 15/18] sway: Improve workspace switcher. --- config/sway/sws.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/sway/sws.sh b/config/sway/sws.sh index 9bda5c3..1e731e7 100755 --- a/config/sway/sws.sh +++ b/config/sway/sws.sh @@ -19,16 +19,18 @@ workspace_num="$2" focused_output=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') + case "$focused_output" in - "HDMI-A-6") - workspace_name="1${workspace_num}" - ;; - "DP-3") + "DP-3"|"LG Electronics LG ULTRAWIDE 405NTPC4A128") workspace_name="${workspace_num}" ;; + "HDMI-A-6 | eDP-1") + workspace_name="1${workspace_num}" + ;; "DP-4") workspace_name="2${workspace_num}" ;; + *) workspace_name="${workspace_num}" ;; From 07985856a8e7a0f128817d9d21d6375bc7beb5b8 Mon Sep 17 00:00:00 2001 From: Casper Date: Sat, 1 Nov 2025 20:10:51 +0100 Subject: [PATCH 16/18] [WIP] sway conf --- config/sway/config | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/sway/config b/config/sway/config index 45e0a1c..385e3b0 100644 --- a/config/sway/config +++ b/config/sway/config @@ -55,9 +55,6 @@ default_floating_border pixel 3 smart_gaps on smart_borders off -# Autotiling -# exec_always autotiling - # Output configuration #------------------------------------------------------------------------------- From 9a02531877b62cfe1013f60cc7dddd1992820af3 Mon Sep 17 00:00:00 2001 From: Casper Date: Sat, 1 Nov 2025 20:14:14 +0100 Subject: [PATCH 17/18] sway: Fix mouse bindings. --- config/sway/keymaps.conf | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index 75c9080..f5db2d8 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -58,6 +58,9 @@ bindsym $mod+Shift+p exec screenshot-rectangle.sh --upload # Window mappings #------------------------------------------------------------------------------- +# Drag windows with mouse +floating_modifier $mod normal + # Toggle window float bindsym $mod+Space floating toggle @@ -81,14 +84,6 @@ bindsym $mod+Control+k move up bindsym $mod+Control+h move left bindsym $mod+Control+l move right -# TODO: fix this -# Move windows with mouse -bindsym --whole-window $mod+button1 move - -# TODO: fix this -# Resize windows with mouse -bindsym --whole-window $mod+button3 resize - # Close window with middle mouse button bindsym --whole-window $mod+button2 kill From 5d3f2d3669ae6b8db02fb8bd93e9ee5951f0dd08 Mon Sep 17 00:00:00 2001 From: Casper Date: Sat, 1 Nov 2025 20:21:53 +0100 Subject: [PATCH 18/18] sway: Add keybinding to center floating window. --- config/sway/keymaps.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/sway/keymaps.conf b/config/sway/keymaps.conf index f5db2d8..250d57b 100644 --- a/config/sway/keymaps.conf +++ b/config/sway/keymaps.conf @@ -64,6 +64,9 @@ floating_modifier $mod normal # Toggle window float bindsym $mod+Space floating toggle +# Center floating window +bindsym $mod+c move position center + # Toggle window fullscreen bindsym $mod+f fullscreen toggle