From c6ab0cad8f86db4814117a6f83c5d8f570e20829 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Wed, 31 Jul 2024 22:52:37 +0200 Subject: [PATCH] sway: update anthy, keybinds, locking --- README.md | 7 +- .../.config/environment.d/envvars.conf | 21 +++-- files/sway/.config/sway/config | 84 ++++++++++--------- files/sway/.config/sway/screenshot | 2 + files/waybar/.config/waybar/config | 10 +-- 5 files changed, 71 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index fa80cb0..6d1a6b1 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,9 @@ Use ./stow.sh --stow to deploy configuration Use ./stow.sh --unstow to remove configuration ``` -`helix(1)` should be built from [source](https://docs.helix-editor.com/install.html), remember to link the `runtime/` to `$HOME/config/helix/runtime`. +Remove CSD for browser, etc.: +```bash +$ gsettings get org.gnome.desktop.wm.preferences button-layout +'icon:close' +$ gsettings set org.gnome.desktop.wm.preferences button-layout '' +``` diff --git a/files/environment/.config/environment.d/envvars.conf b/files/environment/.config/environment.d/envvars.conf index 395d330..82dc1fd 100644 --- a/files/environment/.config/environment.d/envvars.conf +++ b/files/environment/.config/environment.d/envvars.conf @@ -1,18 +1,23 @@ PATH=$HOME/.dots/scripts:$HOME/.cargo/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH EDITOR=hx VISUAL=hx - SSH_AUTH_SOCK=/run/user/1000/keyring/ssh +_JAVA_AWT_WM_NONREPARENTING=1 # XXX: render shadow on wayland # KITTY_DISABLE_WAYLAND=1 # KITTY_ENABLE_WAYLAND=1 -_JAVA_AWT_WM_NONREPARENTING=1 - # support jp input in gnome -GTK_IM_MODULE=ibus -QT_IM_MODULE=ibus -XMODIFIERS=@im=ibus -SDL_IM_MODULE=ibus -GLFW_IM_MODULE=ibus +# GTK_IM_MODULE=ibus +# QT_IM_MODULE=ibus +# XMODIFIERS=@im=ibus +# SDL_IM_MODULE=ibus +# GLFW_IM_MODULE=ibus + +# sway - fcitx5 fcitx5-configtool-gtk fcitx5-anthy +GTK_IM_MODULE=fcitx +QT_IM_MODULE=fcitx +XMODIFIERS=@im=fcitx +SDL_IM_MODULE=fcitx +GLFW_IM_MODULE=fcitx diff --git a/files/sway/.config/sway/config b/files/sway/.config/sway/config index f4e7ccb..f69cf72 100644 --- a/files/sway/.config/sway/config +++ b/files/sway/.config/sway/config @@ -13,24 +13,32 @@ workspace_layout tabbed smart_borders on - # default_border none + set $lock swaylock -i ~/cloud/images/wallpaper/lock.png -s center -u exec swayidle -w \ - timeout 300 'swaylock -i ~/cloud/images/wallpaper/lock.png -s center -u' \ - timeout 600 'systemctl suspend' \ - before-sleep 'swaylock -i ~/cloud/images/wallpaper/lock.png -s center -u' + timeout 600 '$lock' \ + timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + timeout 1200 'systemctl suspend' \ + before-sleep '$lock' ### Input configuration input "type:keyboard" { xkb_layout eu xkb_options caps:swapescape - repeat_delay 200 + repeat_delay 250 repeat_rate 100 } -bindgesture swipe:right workspace prev -bindgesture swipe:left workspace next +input "type:pointer" { + accel_profile flat +} + +bindgesture swipe:3:right workspace next +bindgesture swipe:3:left workspace prev + +bindgesture swipe:4:right focus right +bindgesture swipe:4:left focus left ### Key bindings @@ -42,9 +50,10 @@ bindgesture swipe:left workspace next bindsym --locked XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.2 bindsym --locked XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.2 - bindsym $mod+Control+BackSpace exec swaylock -i ~/cloud/images/wallpaper/lock.png -s center -u + bindsym $mod+Control+BackSpace exec $lock bindsym $mod+Control+Shift+BackSpace exec systemctl suspend + # https://github.com/moverest/sway-interactive-screenshot bindsym $mod+Shift+s exec ~/.config/sway/screenshot -s region bindsym $mod+Shift+c reload @@ -68,6 +77,9 @@ bindgesture swipe:left workspace next bindsym $mod+$up focus up bindsym $mod+$right focus right + bindsym $mod+Tab focus right + bindsym $mod+Shift+Tab focus left + # Move the focused window with the same, but add Shift bindsym $mod+Shift+$left move left bindsym $mod+Shift+$down move down @@ -102,45 +114,39 @@ bindgesture swipe:left workspace next bindsym $mod+f fullscreen bindsym $mod+Shift+space floating toggle bindsym $mod+space focus mode_toggle - bindsym $mod+a focus parent # Scratchpad bindsym $mod+Shift+minus move scratchpad bindsym $mod+minus scratchpad show -# Theming -font pango: JetBrainsMono Nerd Font Mono 10 -bar { - position top - mode dock - output * +### Theming - # status_command while ~/.config/sway/status.sh; do sleep 1; done - swaybar_command waybar - - colors { - statusline #5c6a72 - background #fdf6e3 - inactive_workspace #fdf6e3 #fdf6e3 #5c6a72 - focused_workspace #8da101 #8da101 #fdf6e3 + font pango: JetBrainsMono Nerd Font Mono 10 + bar { + swaybar_command waybar } -} -client.focused #A7C080 #A7C080 #2D353B #A7C080 #A7C080 -client.focused_inactive #3D484D #2D353B #859289 #3D484D #3D484D -client.unfocused #3D484D #2D353B #859289 #3D484D #3D484D -client.urgent #E67E80 #E67E80 #2D353B #E67E80 #E67E80 -client.placeholder #2D353B #2D353B #859289 #2D353B #2D353B -client.background #2D353B + client.focused #A7C080 #A7C080 #2D353B #A7C080 #A7C080 + client.focused_inactive #3D484D #2D353B #859289 #3D484D #3D484D + client.unfocused #3D484D #2D353B #859289 #3D484D #3D484D + client.urgent #E67E80 #E67E80 #2D353B #E67E80 #E67E80 + client.placeholder #2D353B #2D353B #859289 #2D353B #2D353B + client.background #2D353B -include /etc/sway/config.d/* - -# Autostart -exec --no-startup-id netbird-ui -exec --no-startup-id nm-applet -exec --no-startup-id keepassxc -exec --no-startup-id nextcloud +### Autostart # SSH -exec eval $(gnome-keyring-daemon --start) -exec export SSH_AUTH_SOCK + exec eval $(gnome-keyring-daemon --start) + # SSH_AUTH_SOCK must also be exported as env separately later + exec export SSH_AUTH_SOCK + +# Programs + exec --no-startup-id netbird-ui + exec --no-startup-id nm-applet + exec --no-startup-id swaync + exec --no-startup-id nextcloud --background + exec --no-startup-id pasystray + exec --no-startup-id fcitx5 + +### Sway defaults + include /etc/sway/config.d/* diff --git a/files/sway/.config/sway/screenshot b/files/sway/.config/sway/screenshot index c58ae0c..07e4cb3 100755 --- a/files/sway/.config/sway/screenshot +++ b/files/sway/.config/sway/screenshot @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +# https://github.com/moverest/sway-interactive-screenshot + import abc import argparse import os diff --git a/files/waybar/.config/waybar/config b/files/waybar/.config/waybar/config index 432bc60..74736fd 100755 --- a/files/waybar/.config/waybar/config +++ b/files/waybar/.config/waybar/config @@ -26,8 +26,9 @@ "modules-center": [ ], "modules-right": [ + "tray", // "network", - "pulseaudio", + // "pulseaudio", // "memory", // "cpu", // "temperature", @@ -35,8 +36,7 @@ // "custom/keyboard-layout", "battery", "clock#date", - "clock#time", - "tray" + "clock#time" ], @@ -51,7 +51,7 @@ "critical": 15 }, // Connected to AC - "format": " {icon} {capacity}%", // Icon: bolt + "format": " {capacity}%", // Icon: bolt // Not connected to AC // "format-discharging": "{icon} {capacity}%", "format-discharging": "{capacity}%", @@ -178,7 +178,7 @@ "tray": { "icon-size": 15, - "spacing": 10 + "spacing": 20 } }