From 41e97c7e0f71edc76fa387cbac64eaee84a6244b Mon Sep 17 00:00:00 2001 From: Pierre-Marie Charavel Date: Sun, 8 Jun 2025 18:38:53 -0400 Subject: [PATCH 1/2] Sway update --- .bashrc | 15 ++++++++---- .config/sway/config | 8 +++---- .config/sway/config.d/50-systemd-user.conf | 16 +++++++++++++ .config/sway/config.d/theme.conf | 27 ++++++++-------------- .config/waybar/config.jsonc | 2 +- 5 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 .config/sway/config.d/50-systemd-user.conf diff --git a/.bashrc b/.bashrc index 17ebf54..28f1d1e 100644 --- a/.bashrc +++ b/.bashrc @@ -10,10 +10,6 @@ alias grep='grep --color=auto' alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' PS1='[\u@\h \W]\$ ' -if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] ; then - exec sway -fi - # pnpm export PNPM_HOME="/home/pmcc/.local/share/pnpm" case ":$PATH:" in @@ -25,4 +21,13 @@ esac eval "$(starship init bash)" alias reboot-to-windows='sudo grub-reboot "Windows Boot Manager (on /dev/nvme1n1p1)" && sudo reboot' -export PATH=~/.npm-global/bin:~/.local/bin:$PATH +export PATH=~/.npm-global/bin:$PATH +export SSH_AUTH_SOCK=~/.1password/agent.sock + +if uwsm check may-start; then + exec uwsm start sway.desktop +fi + +#if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] ; then +# exec sway +#fi diff --git a/.config/sway/config b/.config/sway/config index d4ead64..5ad1695 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -56,10 +56,10 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill # Basics: # # Start a terminal - bindsym $mod+Return exec $term + bindsym $mod+Return exec uwsm app -- $term # Start your launcher - bindsym $mod+space exec $menu + bindsym $mod+space exec uwsm app -- $menu # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. @@ -72,7 +72,7 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill bindsym $mod+Shift+c reload # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+backspace exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + bindsym $mod+Shift+backspace exec uwsm stop # # Layout stuff: @@ -151,6 +151,4 @@ bindsym $mod+r mode "resize" for_window [shell="xwayland"] title_format "[XWayland] %title" -#xwayland disable - include ~/.config/sway/config.d/* diff --git a/.config/sway/config.d/50-systemd-user.conf b/.config/sway/config.d/50-systemd-user.conf new file mode 100644 index 0000000..8781db9 --- /dev/null +++ b/.config/sway/config.d/50-systemd-user.conf @@ -0,0 +1,16 @@ +# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment +# See FS#63021 +# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal. + +# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to. +exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway +exec systemctl --user import-environment DISPLAY \ + SWAYSOCK \ + WAYLAND_DISPLAY \ + XDG_CURRENT_DESKTOP + +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY \ + SWAYSOCK \ + XDG_CURRENT_DESKTOP=sway \ + WAYLAND_DISPLAY diff --git a/.config/sway/config.d/theme.conf b/.config/sway/config.d/theme.conf index bed0f77..80457bf 100644 --- a/.config/sway/config.d/theme.conf +++ b/.config/sway/config.d/theme.conf @@ -28,29 +28,22 @@ set $mantle #181825 set $crust #11111b # Warm Sunset Window Colors -client.focused $peach $base $text $yellow $peach -client.focused_inactive $surface1 $base $subtext1 $yellow $surface1 -client.unfocused $surface0 $base $subtext0 $yellow $surface0 +client.focused $peach $peach $mantle $yellow $peach +client.focused_inactive $lavender $lavender $mantle $yellow $lavender +client.unfocused $blue $blue $mantle $yellow $blue client.urgent $red $base $text $surface0 $red -client.placeholder $surface0 $base $text $surface0 $surface0 +client.placeholder $surface0 $surface0 $text $surface0 $surface0 client.background $base # Gaps and borders -gaps inner 8 -gaps outer 5 -default_border normal 2 +gaps inner 4 +gaps outer 10 +default_border normal 4 default_floating_border normal 4 +font pango:"JetBrainsMono Nerd Font" Normal 14 + # Status bar bar { - position top - colors { - statusline $text - background $surface0 - separator $overlay0 - inactive_workspace $surface1 $surface0 $text - active_workspace $surface2 $surface0 $text - focused_workspace $peach $surface0 $text - urgent_workspace $red $surface0 $text - } + swaybar_command waybar } diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index b84985b..a5b0150 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -115,7 +115,7 @@ "network": { // "interface": "wlp2*", // (Optional) To force the use of this interface "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "⇓{bandwidthDownBytes} ⇑{bandwidthUpBytes} ", + "format-ethernet": "▼{bandwidthDownBytes} ▲{bandwidthUpBytes} ", "tooltip-format": "{ifname} via {gwaddr} ", "format-linked": "{ifname} (No IP) ", "format-disconnected": "Disconnected ⚠", From 453c3ff85acb35be2dcf185f582a0d8d693f9953 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Charavel Date: Sat, 21 Jun 2025 18:13:50 -0400 Subject: [PATCH 2/2] Update all the thing --- .bashrc | 3 +- .config/alacritty/alacritty.toml | 3 - .config/sway/config | 4 +- .config/sway/config.d/keybinds.conf | 5 + .config/sway/config.d/outputs | 2 - .config/sway/config.d/outputs.conf | 3 + .config/sway/config.d/theme.conf | 8 +- .config/sway/config.d/windows.conf | 5 + .config/waybar/config | 61 +++++++++++ .config/waybar/config.jsonc | 159 ---------------------------- .config/waybar/mocha.css | 26 +++++ .config/waybar/style.css | 101 ++++++++++++++++++ .config/waybar/waybar-roon.json | 12 +++ 13 files changed, 220 insertions(+), 172 deletions(-) delete mode 100644 .config/sway/config.d/outputs create mode 100644 .config/sway/config.d/outputs.conf create mode 100644 .config/sway/config.d/windows.conf create mode 100644 .config/waybar/config delete mode 100644 .config/waybar/config.jsonc create mode 100644 .config/waybar/mocha.css create mode 100644 .config/waybar/style.css create mode 100644 .config/waybar/waybar-roon.json diff --git a/.bashrc b/.bashrc index 28f1d1e..0667b09 100644 --- a/.bashrc +++ b/.bashrc @@ -21,7 +21,7 @@ esac eval "$(starship init bash)" alias reboot-to-windows='sudo grub-reboot "Windows Boot Manager (on /dev/nvme1n1p1)" && sudo reboot' -export PATH=~/.npm-global/bin:$PATH +export PATH=~/.npm-global/bin:~/.local/bin:$PATH export SSH_AUTH_SOCK=~/.1password/agent.sock if uwsm check may-start; then @@ -31,3 +31,4 @@ fi #if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] ; then # exec sway #fi +alias claude="/home/pmcc/.config/claude/local/claude" diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index d4151cc..1d09392 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,6 +1,3 @@ -[font] -size = 16.0 - [font.normal] family = "JetBrainsMono Nerd Font" diff --git a/.config/sway/config b/.config/sway/config index 5ad1695..9990ea6 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -146,9 +146,7 @@ bindsym $mod+r mode "resize" # Special keys to adjust brightness via brightnessctl bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ - # Special key to take a screenshot with grim - bindsym Print exec grim -for_window [shell="xwayland"] title_format "[XWayland] %title" +#xwayland disable include ~/.config/sway/config.d/* diff --git a/.config/sway/config.d/keybinds.conf b/.config/sway/config.d/keybinds.conf index 3c6c5ce..ff1af30 100644 --- a/.config/sway/config.d/keybinds.conf +++ b/.config/sway/config.d/keybinds.conf @@ -36,5 +36,10 @@ bindsym $mod+Shift+s move down bindsym $mod+Shift+w move up bindsym $mod+Shift+d move right +bindsym $mod+Shift+f floating toggle + ## Layout management bindsym $mod+tab layout tabbed + +## Utils +bindsym Print exec ~/.local/bin/snag -d ~/screenshots/ diff --git a/.config/sway/config.d/outputs b/.config/sway/config.d/outputs deleted file mode 100644 index 8b1c4b1..0000000 --- a/.config/sway/config.d/outputs +++ /dev/null @@ -1,2 +0,0 @@ -output DP-1 mode 3840x2160@240.000Hz pos 0 0 scale 1 render_bit_depth 10 adaptive_sync on -output DP-2 mode 2560x1440@240.000Hz pos 3840 0 scale 1 transform 90 adaptive_sync off diff --git a/.config/sway/config.d/outputs.conf b/.config/sway/config.d/outputs.conf new file mode 100644 index 0000000..bbb6f40 --- /dev/null +++ b/.config/sway/config.d/outputs.conf @@ -0,0 +1,3 @@ +output DP-1 mode 3840x2160@240.000Hz pos 0 0 scale 1.6 adaptive_sync on allow_tearing yes +output DP-2 mode 2560x1440@240.000Hz pos 2400 0 scale 1.25 transform 90 adaptive_sync off +output * max_render_time off diff --git a/.config/sway/config.d/theme.conf b/.config/sway/config.d/theme.conf index 80457bf..4338232 100644 --- a/.config/sway/config.d/theme.conf +++ b/.config/sway/config.d/theme.conf @@ -29,9 +29,9 @@ set $crust #11111b # Warm Sunset Window Colors client.focused $peach $peach $mantle $yellow $peach -client.focused_inactive $lavender $lavender $mantle $yellow $lavender -client.unfocused $blue $blue $mantle $yellow $blue -client.urgent $red $base $text $surface0 $red +client.focused_inactive $surface2 $lavender $mantle $yellow $lavender +client.unfocused $surface2 $blue $mantle $yellow $blue +client.urgent $crust $red $crust $surface0 $red client.placeholder $surface0 $surface0 $text $surface0 $surface0 client.background $base @@ -41,7 +41,7 @@ gaps outer 10 default_border normal 4 default_floating_border normal 4 -font pango:"JetBrainsMono Nerd Font" Normal 14 +#font pango:"JetBrainsMono Nerd Font" Normal 14 # Status bar bar { diff --git a/.config/sway/config.d/windows.conf b/.config/sway/config.d/windows.conf new file mode 100644 index 0000000..0931278 --- /dev/null +++ b/.config/sway/config.d/windows.conf @@ -0,0 +1,5 @@ +for_window [shell="xwayland"] title_format "[XWayland] %title" + +assign [class="Unity"] workspace number 2 +for_window [title="Unity"] no_focus, move position 400 400 +for_window [title="Picture-in-Picture"] floating enable diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..f0eb97c --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,61 @@ +{ + "layer": "top", // Waybar at top layer + "position": "top", // Waybar position (top|bottom|left|right) + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces"], + "modules-center": ["pulseaudio", "clock"], + "modules-right": ["tray"], + "sway/workspaces": { + "disable-scroll": true, + "sort-by-name": true, + "format": " {index} {icon} ", + "format-icons": { + "default": "○", + "focused": "◉", + }, + }, + "tray": { + "icon-size": 21, + "spacing": 10 + }, + "custom/music": { + "format": " {}", + "escape": true, + "interval": 5, + "tooltip": false, + "exec": "playerctl metadata --format='{{ title }}'", + "on-click": "playerctl play-pause", + "max-length": 50 + }, + "clock": { + "timezone": "America/Montreal", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": " {:%H:%M %d/%m/%y} " + }, + "backlight": { + "device": "intel_backlight", + "format": "{icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{icon}", + "format-charging": "", + "format-plugged": "", + "format-alt": "{icon}", + "format-icons": ["", "", "", "", "", "", "", "", "", "", "", ""] + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon} {volume}%", + "format-muted": "", + "format-icons": { + "default": ["", "", " "] + }, + "on-click": "pavucontrol" + }, +} diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc deleted file mode 100644 index a5b0150..0000000 --- a/.config/waybar/config.jsonc +++ /dev/null @@ -1,159 +0,0 @@ -// -*- mode: jsonc -*- -{ - // "layer": "top", // Waybar at top layer - // "position": "bottom", // Waybar position (top|bottom|left|right) - "height": 30, // Waybar height (to be removed for auto height) - // "width": 1280, // Waybar width - "spacing": 4, // Gaps between modules (4px) - // Choose the order of the modules - "modules-left": [ - "hyprland/workspaces", - ], - "modules-center": [ - "hyprland/window" - ], - "modules-right": [ - "mpd", -// "idle_inhibitor", - "pulseaudio", - "network", - "cpu", - "memory", - "temperature", - "backlight", - "keyboard-state", - "clock", - "tray", - ], - // Modules configuration - // "sway/workspaces": { - // "disable-scroll": true, - // "all-outputs": true, - // "warp-on-scroll": false, - // "format": "{name}: {icon}", - // "format-icons": { - // "1": "", - // "2": "", - // "3": "", - // "4": "", - // "5": "", - // "urgent": "", - // "focused": "", - // "default": "" - // } - // }, - "keyboard-state": { - "numlock": true, - "capslock": true, - "format": "{name} {icon}", - "format-icons": { - "locked": "", - "unlocked": "" - } - }, - "mpd": { - "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", - "format-disconnected": "Disconnected ", - "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", - "unknown-tag": "N/A", - "interval": 5, - "consume-icons": { - "on": " " - }, - "random-icons": { - "off": " ", - "on": " " - }, - "repeat-icons": { - "on": " " - }, - "single-icons": { - "on": "1 " - }, - "state-icons": { - "paused": "", - "playing": "" - }, - "tooltip-format": "MPD (connected)", - "tooltip-format-disconnected": "MPD (disconnected)" - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, - "tray": { - // "icon-size": 21, - "spacing": 10, - // "icons": { - // "blueman": "bluetooth", - // "TelegramDesktop": "$HOME/.local/share/icons/hicolor/16x16/apps/telegram.png" - // } - }, - "clock": { - // "timezone": "America/New_York", - "tooltip-format": "{:%Y %B}\n{calendar}", - "format-alt": "{:%Y-%m-%d}" - }, - "cpu": { - "format": "{usage}% ", - "tooltip": false - }, - "memory": { - "format": "{}% " - }, - "temperature": { - // "thermal-zone": 2, - // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", - "critical-threshold": 80, - // "format-critical": "{temperatureC}°C {icon}", - "format": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""] - }, - "network": { - // "interface": "wlp2*", // (Optional) To force the use of this interface - "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "▼{bandwidthDownBytes} ▲{bandwidthUpBytes} ", - "tooltip-format": "{ifname} via {gwaddr} ", - "format-linked": "{ifname} (No IP) ", - "format-disconnected": "Disconnected ⚠", - "format-alt": "{ifname} {ipaddr}" - }, - "pulseaudio": { - // "scroll-step": 1, // %, can be a float - "format": "{volume}% {icon} {format_source}", - "format-bluetooth": "{volume}% {icon} {format_source}", - "format-bluetooth-muted": " {icon} {format_source}", - "format-muted": " {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", "", ""] - }, - "on-click": "pavucontrol" - }, - "custom/media": { - "format": "{icon} {text}", - "return-type": "json", - "max-length": 40, - "format-icons": { - "spotify": "", - "default": "🎜" - }, - "escape": true, - "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder - // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name - }, - "hyprland/workspaces": { - "active-only": true, - "all-outputs": true, - } -} diff --git a/.config/waybar/mocha.css b/.config/waybar/mocha.css new file mode 100644 index 0000000..75cfb9d --- /dev/null +++ b/.config/waybar/mocha.css @@ -0,0 +1,26 @@ +@define-color rosewater #f5e0dc; +@define-color flamingo #f2cdcd; +@define-color pink #f5c2e7; +@define-color mauve #cba6f7; +@define-color red #f38ba8; +@define-color maroon #eba0ac; +@define-color peach #fab387; +@define-color yellow #f9e2af; +@define-color green #a6e3a1; +@define-color teal #94e2d5; +@define-color sky #89dceb; +@define-color sapphire #74c7ec; +@define-color blue #89b4fa; +@define-color lavender #b4befe; +@define-color text #cdd6f4; +@define-color subtext1 #bac2de; +@define-color subtext0 #a6adc8; +@define-color overlay2 #9399b2; +@define-color overlay1 #7f849c; +@define-color overlay0 #6c7086; +@define-color surface2 #585b70; +@define-color surface1 #45475a; +@define-color surface0 #313244; +@define-color base #1e1e2e; +@define-color mantle #181825; +@define-color crust #11111b; diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..49ddf4e --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,101 @@ +@import "mocha.css"; + +* { + font-family: JetBrainsMono Nerd Font; + min-height: 0; +} + +#waybar { + background: transparent; + color: @text; + margin: 5px 5px; +} + +#workspaces { + border-radius: 1rem; + margin: 5px; + background-color: @surface0; + margin-left: 1rem; +} + +#workspaces button { + color: @lavender; + border-radius: 1rem; + padding: 0.4rem; +} + +#workspaces button.active { + color: @sky; + border-radius: 1rem; +} + +#workspaces button:hover { + color: @sapphire; + border-radius: 1rem; +} + +#custom-music, +#tray, +#backlight, +#clock, +#battery, +#pulseaudio, +#custom-lock, +#custom-power { + background-color: @surface0; + padding: 0.5rem 1rem; + margin: 5px 0; +} + +#clock { + color: @blue; + border-radius: 0px 1rem 1rem 0px; + margin-right: 1rem; +} + +#battery { + color: @green; +} + +#battery.charging { + color: @green; +} + +#battery.warning:not(.charging) { + color: @red; +} + +#backlight { + color: @yellow; +} + +#backlight, #battery { + border-radius: 0; +} + +#pulseaudio { + color: @maroon; + border-radius: 1rem 0px 0px 1rem; + margin-left: 1rem; +} + +#custom-music { + color: @mauve; + border-radius: 1rem; +} + +#custom-lock { + border-radius: 1rem 0px 0px 1rem; + color: @lavender; +} + +#custom-power { + margin-right: 1rem; + border-radius: 0px 1rem 1rem 0px; + color: @red; +} + +#tray { + margin-right: 1rem; + border-radius: 1rem; +} diff --git a/.config/waybar/waybar-roon.json b/.config/waybar/waybar-roon.json new file mode 100644 index 0000000..dc06f79 --- /dev/null +++ b/.config/waybar/waybar-roon.json @@ -0,0 +1,12 @@ +{ + "zone_name": "SMSL 400", + "format": { + "playing": "󰐊 {artist} - {title}", + "paused": "󰏤 {artist} - {title}", + "stopped": "󰓛 Stopped", + "loading": "󰄰 Loading...", + "no_zone": "󰓛 No Zone" + }, + "max_length": 60, + "update_interval": 1 +} \ No newline at end of file