diff --git a/.bin/.e b/.bin/.e index 14410e9..8393274 100755 --- a/.bin/.e +++ b/.bin/.e @@ -25,6 +25,8 @@ declare -A mapper=( ["rclone"]="$HOME/.config/rclone/rclone.conf" ["ssh"]="$HOME/.ssh/config" ["starship"]="$HOME/.config/starship.toml" + ["sway"]="$HOME/.config/sway/config" + ["sway.d"]="$HOME/.config/sway/config.d" ["sxhkd"]="$HOME/.config/sxhkd/sxhkdrc" ["vim"]="$HOME/.config/vim/vimrc" ["wakatime"]="$HOME/.config/wakatime/.wakatime.cfg##template" @@ -51,6 +53,8 @@ declare -A directory=( declare -A hooks=( ["qutebrowser"]="qutebrowser :config-source" ["qutebrowser-kiosk"]="qutebrowser-kiosk :config-source" # broken due to qutebrowser-kiosk being an alias + ["sway"]="sway reload" + ["sway.d"]="sway reload" ["waybar"]="killall -SIGUSR2 waybar" ["yadm"]="yadm alt" ) diff --git a/.bin/host-mode##hostname.portalo b/.bin/host-mode##hostname.portalo index cb394c9..464e9b0 100755 --- a/.bin/host-mode##hostname.portalo +++ b/.bin/host-mode##hostname.portalo @@ -12,6 +12,8 @@ portalo_mode_monitor () { if [ -n "$1" ]; then yadm config --add local.class "$1" fi + + swaymsg reload } portalo_mode_zellij () { diff --git a/.config/autostart.toml b/.config/autostart.toml index 00b2638..d28d8aa 100644 --- a/.config/autostart.toml +++ b/.config/autostart.toml @@ -1,5 +1,10 @@ [hosts.portalo] -groups = ['common', 'wayland', 'chat', 'messenger'] +groups = ['common', 'wayland', 'chat', 'messenger', 'sway'] + +[apps.autotiling] +command = 'autotiling' +hosts = [] +group = 'sway' [apps.ckb-next] command = 'ckb-next --background' @@ -127,4 +132,4 @@ group = 'x11' [apps.waybar] command = 'waybar' hosts = [] -group = 'wayland' +group = 'hyprland' diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..b5f5f29 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,5 @@ +include ~/.config/sway/config.d/*.conf + +bar swaybar_command waybar + +exec_always autostart-manage run-wayland diff --git a/.config/sway/config.d/.gitignore b/.config/sway/config.d/.gitignore new file mode 100644 index 0000000..77c72bf --- /dev/null +++ b/.config/sway/config.d/.gitignore @@ -0,0 +1 @@ +10-host.conf diff --git a/.config/sway/config.d/00-defaults.conf b/.config/sway/config.d/00-defaults.conf new file mode 100644 index 0000000..7d9668f --- /dev/null +++ b/.config/sway/config.d/00-defaults.conf @@ -0,0 +1,17 @@ +set $ws_01 01 +set $ws_02 02 +set $ws_03 03 +set $ws_04 04 +set $ws_05 05 +set $ws_06 06 +set $ws_07 07 +set $ws_08 08 +set $ws_09 09 +set $ws_10 10 + +set $ws_web $ws_01 +set $ws_terminal $ws_02 +set $ws_focus $ws_07 +set $ws_media $ws_08 +set $ws_chat $ws_09 +set $ws_messenger $ws_10 diff --git a/.config/sway/config.d/05-systemd.conf b/.config/sway/config.d/05-systemd.conf new file mode 100644 index 0000000..a72a65d --- /dev/null +++ b/.config/sway/config.d/05-systemd.conf @@ -0,0 +1 @@ +exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target" diff --git a/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single b/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single new file mode 100644 index 0000000..485de10 --- /dev/null +++ b/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single @@ -0,0 +1,12 @@ +# monitors +set $monitor_primary DP-1 +set $monitor_secondary HDMI-A-1 +set $monitor $monitor_primary + +output $monitor_primary enable +output $monitor_secondary disable + +#output $monitor_primary pos 1920 0 res 2560x1440@144Hz +output $monitor_primary pos 1920 0 res 1920x1080@60Hz + +include ~/.config/sway/lib/layout-10.conf diff --git a/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single-sec b/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single-sec new file mode 100644 index 0000000..ed1f5f3 --- /dev/null +++ b/.config/sway/config.d/10-host.conf##hostname.portalo,class.monitor-single-sec @@ -0,0 +1,11 @@ +# monitors +set $monitor_primary DP-1 +set $monitor_secondary HDMI-A-1 +set $monitor $monitor_secondary + +output $monitor_primary disable +output $monitor_secondary enable + +output $monitor_secondary pos 0 0 res 1920x1080 + +include ~/.config/sway/lib/layout-10.conf diff --git a/.config/sway/config.d/10-host.conf##hostname.portalo,default b/.config/sway/config.d/10-host.conf##hostname.portalo,default new file mode 100644 index 0000000..17c8042 --- /dev/null +++ b/.config/sway/config.d/10-host.conf##hostname.portalo,default @@ -0,0 +1,12 @@ +# monitors +set $monitor_primary DP-1 +set $monitor_secondary HDMI-A-1 + +output $monitor_primary enable +output $monitor_secondary enable + +#output $monitor_primary pos 1920 0 res 2560x1440@144Hz +output $monitor_primary pos 1920 0 res 1920x1080@60Hz +output $monitor_secondary pos 0 0 res 1920x1080 + +include ~/.config/sway/lib/layout-7-3.conf diff --git a/.config/sway/config.d/20-vars.conf b/.config/sway/config.d/20-vars.conf new file mode 100644 index 0000000..691496d --- /dev/null +++ b/.config/sway/config.d/20-vars.conf @@ -0,0 +1,40 @@ +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu j4-dmenu-desktop --dmenu="$DMENU" | xargs swaymsg exec -- + +output * bg #1E1F29 solid_color + +### Idle configuration +exec swayidle -w \ + timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + timeout 600 'swaylock -f -c 000000' \ + before-sleep 'swaylock -f -c 000000' + +### Input configuration +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. +input * { + xkb_layout "de" + xkb_numlock enable + xkb_options "caps:none" + accel_profile flat +} + +mouse_warping none +focus_follows_mouse always + +default_border pixel 1 +default_floating_border pixel 1 + +smart_borders on +smart_gaps on +gaps inner 10 diff --git a/.config/sway/config.d/30-binds.conf b/.config/sway/config.d/30-binds.conf new file mode 100644 index 0000000..77a6207 --- /dev/null +++ b/.config/sway/config.d/30-binds.conf @@ -0,0 +1,145 @@ +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $TERMINAL + bindsym $mod+Shift+Return exec $TERMINAL --class term-floating + + # Close focused window + bindsym $mod+q kill + # Kill focused window + bindsym $mod+Shift+q exec swaymsg -t get_tree | \ + jq 'recurse(.nodes[], .floating_nodes[]) | select(.focused).pid' | \ + xargs -L 1 kill -9 + + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+r reload + + bindsym $mod+Pause exec menu-shutdown + + bindsym $mod+Print exec screenshot + bindsym $mod+Ctrl+Print exec screenshot no_upload + + bindsym $mod+t exec ts-control + bindsym $mod+m exec host-mode + + bindsym $mod+c exec $TERMINAL --class term-floating -e python + +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace $ws_01 + bindsym $mod+2 workspace $ws_02 + bindsym $mod+3 workspace $ws_03 + bindsym $mod+4 workspace $ws_04 + bindsym $mod+5 workspace $ws_05 + bindsym $mod+6 workspace $ws_06 + bindsym $mod+7 workspace $ws_07 + bindsym $mod+8 workspace $ws_08 + bindsym $mod+9 workspace $ws_09 + bindsym $mod+0 workspace $ws_10 + ## Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace $ws_01 + bindsym $mod+Shift+2 move container to workspace $ws_02 + bindsym $mod+Shift+3 move container to workspace $ws_03 + bindsym $mod+Shift+4 move container to workspace $ws_04 + bindsym $mod+Shift+5 move container to workspace $ws_05 + bindsym $mod+Shift+6 move container to workspace $ws_06 + bindsym $mod+Shift+7 move container to workspace $ws_07 + bindsym $mod+Shift+8 move container to workspace $ws_08 + bindsym $mod+Shift+9 move container to workspace $ws_09 + bindsym $mod+Shift+0 move container to workspace $ws_10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. + + bindsym $mod+dead_circumflex workspace $ws_focus + bindsym $mod+Shift+dead_circumflex move container to workspace $ws_focus + +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+s floating toggle + +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" diff --git a/.config/sway/config.d/40-window-rules.conf b/.config/sway/config.d/40-window-rules.conf new file mode 100644 index 0000000..9fa6fda --- /dev/null +++ b/.config/sway/config.d/40-window-rules.conf @@ -0,0 +1,44 @@ +for_window [app_id="term-floating"] floating enable + +assign [app_id="org.qutebrowser.qutebrowser"] $ws_web +assign [class="firefox"] $ws_web + +for_window [class="jetbrains-*"] { + move container to workspace $ws_focus + focus +} +for_window [class="jetbrains-*" title="win0"] floating enable + +for_window [app_id="(mpv|vlc|org.qutebrowser.qutebrowser-kiosk)"] { + move container to workspace $ws_media + fullscreen enable + focus +} +for_window [class="(FreeTube|[Cc]hromium|Brave-browser)"] { + move container to workspace $ws_media + focus +} + +assign [class="TeamSpeak 3"] $ws_chat +assign [class="discord"] $ws_chat +assign [class="Element"] $ws_chat + +assign [class="(Signal)"] $ws_messenger +assign [app_id="([Tt]hunderbird)"] $ws_messenger + +for_window [class="(xdg-desktop-portal-gtk|Pinentry-gtk*)"] { + floating enable +} + +for_window [class="steam" title="Friends List"] { + move container to workspace $ws_chat +} + +for_window [class="zenity" title="Progress"] { + floating enable +} + +for_window [class="(steam_app_*|^cs2$)"] { + move container to workspace $ws_focus + fullscreen enable +} diff --git a/.config/sway/config.d/99-dracula.conf b/.config/sway/config.d/99-dracula.conf new file mode 100644 index 0000000..d9f32e3 --- /dev/null +++ b/.config/sway/config.d/99-dracula.conf @@ -0,0 +1,8 @@ + # class border bground text indicator child_border +client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4 +client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A +client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36 +client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555 +client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36 + +client.background #F8F8F2 diff --git a/.config/sway/lib/layout-10.conf b/.config/sway/lib/layout-10.conf new file mode 100644 index 0000000..4a356e7 --- /dev/null +++ b/.config/sway/lib/layout-10.conf @@ -0,0 +1,10 @@ +workspace $ws_01 output $monitor +workspace $ws_02 output $monitor +workspace $ws_03 output $monitor +workspace $ws_04 output $monitor +workspace $ws_05 output $monitor +workspace $ws_06 output $monitor +workspace $ws_07 output $monitor +workspace $ws_08 output $monitor +workspace $ws_09 output $monitor +workspace $ws_10 output $monitor diff --git a/.config/sway/lib/layout-7-3.conf b/.config/sway/lib/layout-7-3.conf new file mode 100644 index 0000000..016a3e5 --- /dev/null +++ b/.config/sway/lib/layout-7-3.conf @@ -0,0 +1,11 @@ +workspace $ws_01 output $monitor_primary +workspace $ws_02 output $monitor_primary +workspace $ws_03 output $monitor_primary +workspace $ws_04 output $monitor_primary +workspace $ws_05 output $monitor_primary +workspace $ws_06 output $monitor_primary +workspace $ws_07 output $monitor_primary + +workspace $ws_08 output $monitor_secondary +workspace $ws_09 output $monitor_secondary +workspace $ws_10 output $monitor_secondary diff --git a/.config/systemd/user/sway-session.target b/.config/systemd/user/sway-session.target new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/.config/systemd/user/sway-session.target @@ -0,0 +1,6 @@ +[Unit] +Description=sway compositor session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target diff --git a/.config/waybar/config b/.config/waybar/config index f079c98..3e98a79 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -4,7 +4,8 @@ "height": 28, "spacing": 6, "modules-left": [ - "hyprland/workspaces" + "hyprland/workspaces", + "sway/workspaces" ], "modules-center": [ "mpris" diff --git a/.config/waybar/custom/ts3-status b/.config/waybar/custom/ts3-status new file mode 100755 index 0000000..3efb20f --- /dev/null +++ b/.config/waybar/custom/ts3-status @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ts-control "status-icon" diff --git a/.config/waybar/default-modules.json b/.config/waybar/default-modules.json index cebe655..438153f 100644 --- a/.config/waybar/default-modules.json +++ b/.config/waybar/default-modules.json @@ -7,6 +7,11 @@ "hyprland/window": { "max-length": 128 }, + "sway/workspaces": { + "on-click": "activate", + "all-outputs": true, + "disable-scroll": true + }, "clock": { "interval": 1, "format": " {:%Y-%m-%d %H:%M:%S}", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 358f42b..4b7abd7 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -40,6 +40,7 @@ window#waybar { } #workspaces button { + padding: 0 10px; background: none; border-bottom: solid 2px @background; }