From: Christian Heller Date: Mon, 7 Sep 2026 01:26:01 +0000 (+0000) Subject: Add sway config, first stab at status bar. X-Git-Url: https://plomlompom.com/repos/foo.html?a=commitdiff_plain;h=1dd9d3a5151b92206940b54c59287426f6085002;p=confplom Add sway config, first stab at status bar. --- diff --git a/home_user/.config/sway/config b/home_user/.config/sway/config new file mode 100644 index 0000000..f35e643 --- /dev/null +++ b/home_user/.config/sway/config @@ -0,0 +1,100 @@ +# because these are included by /etc/sway/config for probably good reason … +include /etc/sway/config-vars.d/* +include /etc/sway/config.d/* + +# font for wm text +font pango:Terminus 16px + +# force "tabbed" as default layout for new windows +workspace_layout tabbed + +# simple green background +output * background #559911 solid_color + +# keyboard layout +input * xkb_layout "us" + +# deactivate t490s touchpad +input 1267:47:Elan_Touchpad events disabled + +# status bar +bar { + position top + tray_output none + status_command ~/.config/sway/status.py +} + +# make Windows key modifier key for all wm actions +set $mod Mod4 +floating_modifier $mod + +# move pointer in 1px units +bindsym --no-repeat $mod+h seat * cursor move -1 0 +bindsym --no-repeat $mod+j seat * cursor move 0 1 +bindsym --no-repeat $mod+k seat * cursor move 0 -1 +bindsym --no-repeat $mod+l seat * cursor move 1 0 + +# program launcher +bindsym $mod+x exec wmenu-run + +# launch terminal emulator +bindsym $mod+Return exec foot --font="Courier New:size=14.5" + +# kill window +bindsym $mod+Shift+q kill + +# move focus between windows, but not by mouse +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +focus_follows_mouse no + +# move windows +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# resize windows +bindsym $mod+Shift+h resize shrink width 1 ppt +bindsym $mod+Shift+j resize shrink height 1 ppt +bindsym $mod+Shift+k resize grow height 1 ppt +bindsym $mod+Shift+l resize grow width 1 ppt + +# toggle fullscreen for focused window +bindsym $mod+f fullscreen + +# toggle floating of window, focus on floating or tabbed windows. +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle + +# reload config file +bindsym $mod+Shift+c reload + +# stop wm +bindsym $mod+Shift+p exit + +# switch workspaces +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move window to workspace +bindsym $mod+Shift+1 move workspace 1 +bindsym $mod+Shift+2 move workspace 2 +bindsym $mod+Shift+3 move workspace 3 +bindsym $mod+Shift+4 move workspace 4 +bindsym $mod+Shift+5 move workspace 5 +bindsym $mod+Shift+6 move workspace 6 +bindsym $mod+Shift+7 move workspace 7 +bindsym $mod+Shift+8 move workspace 8 +bindsym $mod+Shift+9 move workspace 9 +bindsym $mod+Shift+0 move workspace 10 diff --git a/home_user/.config/sway/status.py b/home_user/.config/sway/status.py new file mode 100755 index 0000000..187b602 --- /dev/null +++ b/home_user/.config/sway/status.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +'Sway bar status line generator.' +from json import dumps as json_dumps +from datetime import datetime +from time import sleep + +METADATA = {'version': 1} + + +if __name__ == '__main__': + print(json_dumps(METADATA)) + print('[', end='') + while True: + print(json_dumps([ + {'full_text': str(datetime.now().isoformat(' ', 'seconds'))}, + ]), end=',\n', flush=True) + sleep(1) diff --git a/start_root.sh b/start_root.sh index f51d169..5e00f2e 100755 --- a/start_root.sh +++ b/start_root.sh @@ -10,7 +10,7 @@ PATH_UDEV_RULES=/etc/udev/rules.d # constants we might want to change at some point FNAME_UDEV_RULES_BACKLIGHT=90-backlight.rules LOCALE=C.UTF-8 -TO_INSTALL="ack man-db ntpsec-ntpdate sudo sway tlp vim-gtk3 xwayland" +TO_INSTALL="ack man-db ntpsec-ntpdate sudo sway tlp vim-gtk3 wmenu xwayland" USERNAME=plom PRINTK_LEVELS="4 4 1 7" TLP_THRESH_START=40