diff --git a/sway/config b/sway/config index d54518c..c888040 100644 --- a/sway/config +++ b/sway/config @@ -22,7 +22,8 @@ include $HOME/.config/sway/definitions.d/*.conf include /etc/sway/inputs/* # enable modes -include /etc/sway/modes/* +#include /etc/sway/modes/* +include $HOME/.config/sway/modes/* # only enable this if every app you use is compatible with wayland # xwayland disable @@ -32,3 +33,5 @@ include /etc/sway/config.d/* # user config include $HOME/.config/sway/config.d/*.conf + +workspace 8 output HDMI-A-1 diff --git a/sway/config.d/lock.conf b/sway/config.d/lock.conf new file mode 100644 index 0000000..acc3c2f --- /dev/null +++ b/sway/config.d/lock.conf @@ -0,0 +1 @@ +bindsym $mod+x exec $locking diff --git a/sway/config.d/zeit.conf b/sway/config.d/zeit.conf new file mode 100644 index 0000000..0ef55a7 --- /dev/null +++ b/sway/config.d/zeit.conf @@ -0,0 +1 @@ +# bindsym $mod+z exec $term_float "zeit stats" diff --git a/sway/cow.jpg b/sway/cow.jpg new file mode 100644 index 0000000..d498afd Binary files /dev/null and b/sway/cow.jpg differ diff --git a/sway/definitions.d/bg.conf b/sway/definitions.d/bg.conf index ea46694..aa12dfb 100644 --- a/sway/definitions.d/bg.conf +++ b/sway/definitions.d/bg.conf @@ -1 +1 @@ -set $background /home/krichtof/.config/sway/bg.png +set $background /home/krichtof/.config/sway/cow.jpg diff --git a/sway/modes/default b/sway/modes/default new file mode 100644 index 0000000..c18d41a --- /dev/null +++ b/sway/modes/default @@ -0,0 +1,201 @@ +### Key bindings +# +# Basics: +# +## Launch // Terminal ## +$bindsym $mod+Return exec $term_cwd +$bindsym $mod+Shift+Return exec $term + +## Action // Kill focused window ## +$bindsym $mod+Shift+q kill + +## Launch // Open launcher ## +$bindsym $mod+d exec $menu +$bindsym $alt_mod+space exec $menu + +## Launch // Open clipboard ## +$bindsym $mod+Shift+p exec $clipboard + +# 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 + +## Action // Reload Sway Configuration ## +$bindsym $mod+Shift+c reload + +## Action // Toggle Waybar ## +$bindsym $mod+Shift+b exec pkill -x -SIGUSR1 waybar + +# --locked flags allow the buttons to be used whilst the screen is locked. +$bindsym --locked XF86AudioRaiseVolume exec $volume_up + +$bindsym --locked XF86AudioLowerVolume exec $volume_down + +# $bindsym --locked XF86AudioMute exec $volume_mute + +$bindsym XF86AudioMicMute exec $mic_mute + +$bindsym --locked XF86MonBrightnessUp exec $brightness_up + +$bindsym --locked XF86MonBrightnessDown exec $brightness_down + +$bindsym --locked XF86AudioPlay exec playerctl play-pause + +$bindsym XF86AudioNext exec playerctl next + +$bindsym XF86AudioPrev exec playerctl previous + +$bindsym XF86Search exec $menu + +$bindsym XF86PowerOff exec $shutdown + +$bindsym XF86TouchpadToggle input type:touchpad events toggle enabled disabled + +# Moving around: +# +# Move your focus around +## Navigation // Move focus // $mod + ↑ ↓ ← → ## +$bindsym $mod+$left focus left +$bindsym $mod+$down focus down +$bindsym $mod+$up focus up +$bindsym $mod+$right focus right + +$bindsym $mod+$left_alt focus left +$bindsym $mod+$down_alt focus down +$bindsym $mod+$up_alt focus up +$bindsym $mod+$right_alt focus right + +## Navigation // Move focused window // $mod + 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 + +$bindsym $mod+Shift+$left_alt move left +$bindsym $mod+Shift+$down_alt move down +$bindsym $mod+Shift+$up_alt move up +$bindsym $mod+Shift+$right_alt move right + +## Navigation // Move focused workspace // $mod + Alt + ↑ ↓ ← → ## +$bindsym $mod+Alt+$right move workspace to output right +$bindsym $mod+Alt+$left move workspace to output left +$bindsym $mod+Alt+$down move workspace to output down +$bindsym $mod+Alt+$up move workspace to output up + +$bindsym $mod+Alt+$right_alt move workspace to output right +$bindsym $mod+Alt+$left_alt move workspace to output left +$bindsym $mod+Alt+$down_alt move workspace to output down +$bindsym $mod+Alt+$up_alt move workspace to output up + +## Navigation // List all open windows in last-recently-used order ## +# $bindsym $mod+p exec env RUST_BACKTRACE=1 swayr switch-window &>> /tmp/swayr.log + +## Navigation // Switch to the last recently used window ## +$bindsym Mod1+Tab exec env RUST_BACKTRACE=1 swayr switch-to-urgent-or-lru-window &>> /tmp/swayr.log + +## Navigation // Switch to the last recently used workspace ## +$bindsym $mod+Tab workspace back_and_forth + +# +# Workspaces: +# +## Navigation // Switch workspace // $mod + [number] ## +$bindsym $mod+1 workspace $ws1 +$bindsym $mod+2 workspace $ws2 +$bindsym $mod+3 workspace $ws3 +$bindsym $mod+4 workspace $ws4 +$bindsym $mod+5 workspace $ws5 +$bindsym $mod+6 workspace $ws6 +$bindsym $mod+7 workspace $ws7 +$bindsym $mod+8 workspace $ws8 +$bindsym $mod+9 workspace $ws9 +$bindsym $mod+0 workspace $ws10 + +set $focus_ws [ "$focus_after_move" == 'true' ] && swaymsg workspace + +## Action // Move focused window to workspace // $mod + Shift + [number] ## +$bindsym $mod+Shift+1 move container to workspace $ws1, exec $focus_ws $ws1 +$bindsym $mod+Shift+2 move container to workspace $ws2, exec $focus_ws $ws2 +$bindsym $mod+Shift+3 move container to workspace $ws3, exec $focus_ws $ws3 +$bindsym $mod+Shift+4 move container to workspace $ws4, exec $focus_ws $ws4 +$bindsym $mod+Shift+5 move container to workspace $ws5, exec $focus_ws $ws5 +$bindsym $mod+Shift+6 move container to workspace $ws6, exec $focus_ws $ws6 +$bindsym $mod+Shift+7 move container to workspace $ws7, exec $focus_ws $ws7 +$bindsym $mod+Shift+8 move container to workspace $ws8, exec $focus_ws $ws8 +$bindsym $mod+Shift+9 move container to workspace $ws9, exec $focus_ws $ws9 +$bindsym $mod+Shift+0 move container to workspace $ws10, exec $focus_ws $ws10 + +## Launch // Open launcher in a new workspace ## +$bindsym $mod+Shift+d exec /usr/share/sway/scripts/first-empty-workspace.py --switch, exec $menu + +## Navigation // Switch to a new workspace ## +$bindsym $mod+n exec /usr/share/sway/scripts/first-empty-workspace.py --switch + +## Action // Move focused window to a new workspace ## +$bindsym $mod+Shift+n exec /usr/share/sway/scripts/first-empty-workspace.py --move + +## Action // Move focused window to a new workspace and switch there ## +$bindsym $mod+Shift+m exec /usr/share/sway/scripts/first-empty-workspace.py --move --switch + +# +# Layout stuff: +# +## Setting // Split windows horizontally ## +$bindsym $mod+b splith +## Setting // Split windows vertically ## +$bindsym $mod+v splitv + +## Action // Switch to window stacking ## +$bindsym $mod+s layout stacking +## Action // Switch to window tabbing ## +$bindsym $mod+w layout tabbed +## Action // Switch to window tiling ## +$bindsym $mod+e layout toggle split + +## Action // Toggle fullscreen ## +$bindsym $mod+f fullscreen + +## Action // Toggle global fullscreen ## +$bindsym $mod+Shift+f fullscreen global + +## Action // Scale up  ## +$bindsym $alt_mod+plus exec $scale_up + +## Action // Scale down  ## +$bindsym $alt_mod+minus exec $scale_down + +## Action // Scale default  ## +$bindsym $mod+equal exec $scale_default + +## Action // Toggle floating ## +$bindsym $mod+Shift+space floating toggle + +## Navigation // Toggle focus between tiling and floating ## +$bindsym $mod+space focus mode_toggle + +## Navigation // Swap focus to the parent window ## +$bindsym $mod+a focus parent + +## Launch // Toggle Help ## +$bindsym $mod+question exec $help + +## Launch // Open Support ## +$bindsym $mod+Shift+s exec xdg-open https://github.com/Manjaro-Sway/manjaro-sway/blob/main/SUPPORT.md + +## Launch // Inhibit Idle ## +$bindsym $mod+Shift+i exec inhibit-idle interactive + +default_border pixel 1 +hide_edge_borders smart + +# allow to kill focused floating shell windows using Esc +$bindsym --release Escape [app_id="floating_shell" con_id=__focused__] kill + +## Launch // Task Manager ## +$bindsym Ctrl+Alt+Delete exec $task_manager + +## Launch // Emoji Picker ## +$bindsym Alt+Shift+e exec $emoji_picker diff --git a/sway/modes/pomodoro b/sway/modes/pomodoro new file mode 100644 index 0000000..b902fcf --- /dev/null +++ b/sway/modes/pomodoro @@ -0,0 +1,20 @@ +set $mode_pomodoro "\ + \ + \ +(s)start \ +(r)resume \ +(t)toggle \ +(w)work \ +(b)break \ +" + +mode --pango_markup $mode_pomodoro { + $bindsym s exec uair, mode "default" + $bindsym r exec uairctl resume, mode "default" + $bindsym t exec uairctl toggle, mode "default" + $bindsym b exec uairctl jump rest, mode "default" + $bindsym w exec uairctl jump work, mode "default" + $bindsym Escape mode "default" +} + +$bindsym $mod+p mode $mode_pomodoro diff --git a/sway/modes/recording b/sway/modes/recording new file mode 100644 index 0000000..666ac38 --- /dev/null +++ b/sway/modes/recording @@ -0,0 +1,19 @@ +set $mode_recording " \ +Record (r) \ ++ [Shift for 󰍮]" + +set $recorder /usr/share/sway/scripts/recorder.sh + +mode --pango_markup $mode_recording { + $bindsym r exec $recorder, mode "default" + $bindsym Shift+r exec $recorder -a, mode "default" + + # Return to default mode. + $bindsym Escape mode "default" +} + +## Launch // Recording Mode ## +$bindsym $mod+Shift+r mode $mode_recording + +## Launch // Stop Recording Mode ## +$bindsym $mod+Escape exec killall -s SIGINT wf-recorder \ No newline at end of file diff --git a/sway/modes/resize b/sway/modes/resize new file mode 100644 index 0000000..7c117cc --- /dev/null +++ b/sway/modes/resize @@ -0,0 +1,42 @@ +set $mode_resize "󰉸 \ +Resize (↑ ↓ ← →) \ +Increase Gaps (+) \ +Decrease Gaps (-)" + +mode --pango_markup $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 + + $bindsym $left_alt resize shrink width 10px + $bindsym $down_alt resize grow height 10px + $bindsym $up_alt resize shrink height 10px + $bindsym $right_alt resize grow width 10px + + $bindsym Shift+$left resize shrink width 50px + $bindsym Shift+$down resize grow height 50px + $bindsym Shift+$up resize shrink height 50px + $bindsym Shift+$right resize grow width 50px + + $bindsym Shift+$left_alt resize shrink width 50px + $bindsym Shift+$down_alt resize grow height 50px + $bindsym Shift+$up_alt resize shrink height 50px + $bindsym Shift+$right_alt resize grow width 50px + + ## Resize // Window Gaps // + - ## + $bindsym minus gaps inner current minus 5px + $bindsym plus gaps inner current plus 5px + + # Return to default mode + $bindsym Return mode "default" + $bindsym Escape mode "default" +} +## Launch // Resize Mode ## +$bindsym $mod+r mode $mode_resize +gaps inner 5px +gaps outer 5px diff --git a/sway/modes/scratchpad b/sway/modes/scratchpad new file mode 100644 index 0000000..a526530 --- /dev/null +++ b/sway/modes/scratchpad @@ -0,0 +1,12 @@ +# +# Scratchpad: +# +# Sway has a "scratchpad", which is a bag of holding for windows. +# You can send windows there and get them back later. + +## Action // Move window to scratchpad ## +$bindsym $mod+Shift+minus move scratchpad, exec "waybar-signal scratchpad" + +# If there are multiple scratchpad windows, this command cycles through them. +## Action // Toggle scratchpad ## +$bindsym $mod+minus scratchpad show, exec "waybar-signal scratchpad" diff --git a/sway/modes/screenshot b/sway/modes/screenshot new file mode 100644 index 0000000..1cb1c90 --- /dev/null +++ b/sway/modes/screenshot @@ -0,0 +1,20 @@ +set $mode_screenshot "󰄄 \ +Pick (p) \ +Output (o) \ ++ Shift for " + +mode --pango_markup $mode_screenshot { + # output = currently active output + $bindsym o mode "default", exec $screenshot_screen + $bindsym Shift+o mode "default", exec $screenshot_screen_upload + + # pick the region to screenshot + $bindsym p mode "default", exec $screenshot_selection + $bindsym Shift+p mode "default", exec $screenshot_selection_upload + + # Return to default mode. + $bindsym Escape mode "default" +} + +## Launch // Screenshot Mode ## +$bindsym Print mode $mode_screenshot diff --git a/sway/modes/shutdown b/sway/modes/shutdown new file mode 100644 index 0000000..096a723 --- /dev/null +++ b/sway/modes/shutdown @@ -0,0 +1,34 @@ +set $mode_shutdown "\ + \ + \ +(l)lock \ +(e)logout \ +(r)reboot \ +(u)suspend \ +(s)shutdown \ +" + +set $purge_cliphist [ $purge_cliphist_logout == 'true' ] && rm -f $HOME/.cache/cliphist/db || exit 0 + +mode --pango_markup $mode_shutdown { + # lock + $bindsym l mode "default", exec $locking + + # logout + $bindsym e exec $purge_cliphist; exec swaymsg exit + + # suspend + $bindsym u mode "default", exec systemctl sleep + + # shutdown + $bindsym s exec $purge_cliphist; exec systemctl poweroff + + # reboot + $bindsym r exec $purge_cliphist; exec systemctl reboot + + # Return to default mode. + $bindsym Escape mode "default" +} + +## Launch // Exit Menu ## +$bindsym $mod+Shift+e mode $mode_shutdown