mirror of https://github.com/ericonr/dotfiles.git
Refactor sway config files, making them usable.
This commit is contained in:
parent
30f6ed6d5c
commit
d3b932795e
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
alacritty --dimensions 60 30 --title launcher --command bash -c 'compgen -c | sort -u | fzf --border | xargs lnch'
|
||||||
|
|
|
@ -1,110 +1,129 @@
|
||||||
# This file has been auto-generated by i3-config-wizard(1).
|
# ericonr's config for sway
|
||||||
# It will not be overwritten, so edit it as you like.
|
|
||||||
#
|
|
||||||
# Should you change your keyboard layout some time, delete
|
|
||||||
# this file and re-run i3-config-wizard(1).
|
|
||||||
#
|
|
||||||
|
|
||||||
# i3 config file (v4)
|
## Defaults
|
||||||
#
|
set $term alacritty
|
||||||
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
set $menu launcher
|
||||||
|
set $editor emacs
|
||||||
|
|
||||||
|
## Set keyboard controls
|
||||||
|
# Logo key
|
||||||
set $mod Mod4
|
set $mod Mod4
|
||||||
|
# Change focus like VIM
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
|
||||||
# is used in the bar {} block below.
|
|
||||||
font pango:monospace 8
|
|
||||||
|
|
||||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
|
||||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
|
||||||
#font pango:DejaVu Sans Mono 8
|
|
||||||
|
|
||||||
# Before i3 v4.8, we used to recommend this one as the default:
|
|
||||||
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|
||||||
# The font above is very space-efficient, that is, it looks good, sharp and
|
|
||||||
# clear in small sizes. However, its unicode glyph coverage is limited, the old
|
|
||||||
# X core fonts rendering does not support right-to-left and this being a bitmap
|
|
||||||
# font, it doesn’t scale on retina/hidpi displays.
|
|
||||||
|
|
||||||
# gaps conf
|
|
||||||
for_window [class=".*"] border pixel 0
|
|
||||||
gaps outer 2
|
|
||||||
gaps inner 4
|
|
||||||
#smart_gaps on
|
|
||||||
|
|
||||||
# quick launch
|
|
||||||
bindsym $mod+t exec --no-startup-id alacritty -e tmux
|
|
||||||
bindsym $mod+Shift+w exec --no-startup-id launch_browsers
|
|
||||||
bindsym $mod+Shift+f exec --no-startup-id dolphin
|
|
||||||
|
|
||||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
|
||||||
floating_modifier $mod
|
|
||||||
|
|
||||||
# start a terminal
|
|
||||||
bindsym $mod+Return exec --no-startup-id alacritty
|
|
||||||
|
|
||||||
# kill focused window
|
|
||||||
bindsym $mod+Shift+q kill
|
|
||||||
|
|
||||||
# start dmenu (a program launcher)
|
|
||||||
# bindsym $mod+d exec dmenu_run
|
|
||||||
# There also is the (new) i3-dmenu-desktop which only displays applications
|
|
||||||
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
|
|
||||||
# installed.
|
|
||||||
bindsym $mod+d exec --no-startup-id dmenu
|
|
||||||
|
|
||||||
# change focus
|
|
||||||
bindsym $mod+h focus left
|
bindsym $mod+h focus left
|
||||||
bindsym $mod+j focus down
|
bindsym $mod+j focus down
|
||||||
bindsym $mod+k focus up
|
bindsym $mod+k focus up
|
||||||
bindsym $mod+l focus right
|
bindsym $mod+l focus right
|
||||||
|
# You can also use the cursor keys
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
bindsym $mod+Left focus left
|
bindsym $mod+Left focus left
|
||||||
bindsym $mod+Down focus down
|
bindsym $mod+Down focus down
|
||||||
bindsym $mod+Up focus up
|
bindsym $mod+Up focus up
|
||||||
bindsym $mod+Right focus right
|
bindsym $mod+Right focus right
|
||||||
|
# Move focused window
|
||||||
# move focused window
|
|
||||||
bindsym $mod+Shift+h move left
|
bindsym $mod+Shift+h move left
|
||||||
bindsym $mod+Shift+j move down
|
bindsym $mod+Shift+j move down
|
||||||
bindsym $mod+Shift+k move up
|
bindsym $mod+Shift+k move up
|
||||||
bindsym $mod+Shift+l move right
|
bindsym $mod+Shift+l move right
|
||||||
|
# You can also use the cursor keys
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
bindsym $mod+Shift+Left move left
|
bindsym $mod+Shift+Left move left
|
||||||
bindsym $mod+Shift+Down move down
|
bindsym $mod+Shift+Down move down
|
||||||
bindsym $mod+Shift+Up move up
|
bindsym $mod+Shift+Up move up
|
||||||
bindsym $mod+Shift+Right move right
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
# split in horizontal orientation
|
## System tasks
|
||||||
bindsym $mod+g split h
|
# Reload configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
# Restart sway inplace (can be used to upgrade sway)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
# Exit sway
|
||||||
|
bindsym $mod+Shift+e 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'
|
||||||
|
|
||||||
# split in vertical orientation
|
## Input settings
|
||||||
bindsym $mod+v split v
|
# Change keyboard layout
|
||||||
|
set $keyboard "1:1:AT_Translated_Set_2_keyboard"
|
||||||
|
input $keyboard {
|
||||||
|
xkb_layout "us,br"
|
||||||
|
}
|
||||||
|
#TODO: make script that automatically switches inputs
|
||||||
|
bindsym $mod+Space input $keyboard xkb_switch_layout 0
|
||||||
|
bindsym $mod+Shift+Space input $keyboard xkb_switch_layout 1
|
||||||
|
# Touchpad
|
||||||
|
set $touchpad "1739:31251:SYNA2393:00_06CB:7A13_Touchpad"
|
||||||
|
input $touchpad {
|
||||||
|
tap enabled
|
||||||
|
natural_scroll disabled
|
||||||
|
}
|
||||||
|
# Media keys
|
||||||
|
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||||
|
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||||
|
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||||
|
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||||
|
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||||
|
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
|
||||||
|
#TODO: use keys XF86AudioPlay, XF86AudioPause, XF86AudioPrev, XF86AudioNext
|
||||||
|
|
||||||
# enter fullscreen mode for the focused container
|
## Launching applications
|
||||||
|
# Start a terminal
|
||||||
|
bindsym $mod+Return exec $term
|
||||||
|
# Start a terminal with tmux
|
||||||
|
bindsym $mod+t exec $term -e tmux
|
||||||
|
# Launch editor
|
||||||
|
bindsym $mod+Shift+w exec $editor
|
||||||
|
# Start Dolphin file browser
|
||||||
|
bindsym $mod+Shift+f exec dolphin
|
||||||
|
# Kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
# Start launcher
|
||||||
|
bindsym $mod+d exec $menu
|
||||||
|
for_window [title="launcher"] floating enable; border none
|
||||||
|
# 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
|
||||||
|
|
||||||
|
## Appearance
|
||||||
|
# Default wallpaper
|
||||||
|
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||||
|
# Font for window titles
|
||||||
|
font pango:Liberation Sans 8
|
||||||
|
# Gaps configuration
|
||||||
|
for_window [class=".*"] border none
|
||||||
|
gaps outer 3
|
||||||
|
gaps inner 3
|
||||||
|
|
||||||
|
## Idle configuration
|
||||||
|
# Automatic behavior
|
||||||
|
exec swayidle -w \
|
||||||
|
timeout 300 'swaylock' \
|
||||||
|
timeout 600 'swaymsg "output * dpms off"' \
|
||||||
|
resume 'swaymsg "output * dpms on"' \
|
||||||
|
before-sleep 'swaylock'
|
||||||
|
# Manual behavior
|
||||||
|
bindsym $mod+Shift+x exec swaylock -f -c 000000
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
# Split in horizontal orientation
|
||||||
|
bindsym $mod+g splith
|
||||||
|
# Split in vertical orientation
|
||||||
|
bindsym $mod+v splitv
|
||||||
|
# Enter fullscreen mode for the focused container
|
||||||
bindsym $mod+f fullscreen toggle
|
bindsym $mod+f fullscreen toggle
|
||||||
|
# Change container layout (stacked, tabbed, toggle split)
|
||||||
# change container layout (stacked, tabbed, toggle split)
|
|
||||||
bindsym $mod+q layout stacking
|
bindsym $mod+q layout stacking
|
||||||
bindsym $mod+w layout tabbed
|
bindsym $mod+w layout tabbed
|
||||||
bindsym $mod+e layout toggle split
|
bindsym $mod+e layout toggle split
|
||||||
|
# Toggle the current focus between tiling and floating mode
|
||||||
# toggle tiling / floating
|
bindsym $mod+Shift+z floating toggle
|
||||||
bindsym $mod+Shift+space floating toggle
|
# Swap focus between the tiling area and the floating area
|
||||||
|
bindsym $mod+z focus mode_toggle
|
||||||
# change focus between tiling / floating windows
|
# Move focys to the parent container
|
||||||
bindsym $mod+space focus mode_toggle
|
|
||||||
|
|
||||||
# focus the parent container
|
|
||||||
bindsym $mod+a focus parent
|
bindsym $mod+a focus parent
|
||||||
|
# Move focus to the child container
|
||||||
|
bindsym $mod+Shift+a focus child
|
||||||
|
|
||||||
# focus the child container
|
## Workspaces
|
||||||
#bindsym $mod+d focus child
|
# Workspace name
|
||||||
|
|
||||||
# Define names for default workspaces for which we configure key bindings later on.
|
|
||||||
# We use variables to avoid repeating the names in multiple places.
|
|
||||||
set $ws1 "1"
|
set $ws1 "1"
|
||||||
set $ws2 "2"
|
set $ws2 "2"
|
||||||
set $ws3 "3"
|
set $ws3 "3"
|
||||||
|
@ -115,13 +134,12 @@ set $ws7 "7"
|
||||||
set $ws8 "8"
|
set $ws8 "8"
|
||||||
set $ws9 "9"
|
set $ws9 "9"
|
||||||
set $ws10 "10"
|
set $ws10 "10"
|
||||||
set $ws11 "media"
|
set $wsb "browser"
|
||||||
set $ws12 "nwork"
|
set $wsn "nth"
|
||||||
set $ws13 "brow"
|
set $wsm "media"
|
||||||
set $ws14 "pdf"
|
set $wso "oh"
|
||||||
set $ws16 "og"
|
set $wsp "pdf"
|
||||||
|
# Switch to workspace
|
||||||
# switch to workspace
|
|
||||||
bindsym $mod+1 workspace $ws1
|
bindsym $mod+1 workspace $ws1
|
||||||
bindsym $mod+2 workspace $ws2
|
bindsym $mod+2 workspace $ws2
|
||||||
bindsym $mod+3 workspace $ws3
|
bindsym $mod+3 workspace $ws3
|
||||||
|
@ -132,13 +150,12 @@ bindsym $mod+7 workspace $ws7
|
||||||
bindsym $mod+8 workspace $ws8
|
bindsym $mod+8 workspace $ws8
|
||||||
bindsym $mod+9 workspace $ws9
|
bindsym $mod+9 workspace $ws9
|
||||||
bindsym $mod+0 workspace $ws10
|
bindsym $mod+0 workspace $ws10
|
||||||
bindsym $mod+m workspace $ws11
|
bindsym $mod+b workspace $wsb
|
||||||
bindsym $mod+n workspace $ws12
|
bindsym $mod+n workspace $wsn
|
||||||
bindsym $mod+b workspace $ws13
|
bindsym $mod+m workspace $wsm
|
||||||
bindsym $mod+p workspace $ws14
|
bindsym $mod+o workspace $wso
|
||||||
bindsym $mod+o workspace $ws16
|
bindsym $mod+p workspace $wsp
|
||||||
|
# Move focused container to workspace
|
||||||
# move focused container to workspace
|
|
||||||
bindsym $mod+Shift+1 move container to workspace $ws1
|
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||||
bindsym $mod+Shift+2 move container to workspace $ws2
|
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||||
bindsym $mod+Shift+3 move container to workspace $ws3
|
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||||
|
@ -149,79 +166,70 @@ bindsym $mod+Shift+7 move container to workspace $ws7
|
||||||
bindsym $mod+Shift+8 move container to workspace $ws8
|
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||||
bindsym $mod+Shift+9 move container to workspace $ws9
|
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||||
bindsym $mod+Shift+0 move container to workspace $ws10
|
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||||
bindsym $mod+Shift+m move container to workspace $ws11
|
bindsym $mod+Shift+b move container to workspace $wsb
|
||||||
bindsym $mod+Shift+n move container to workspace $ws12
|
bindsym $mod+Shift+n move container to workspace $wsn
|
||||||
bindsym $mod+Shift+b move container to workspace $ws13
|
bindsym $mod+Shift+m move container to workspace $wsm
|
||||||
bindsym $mod+Shift+p move container to workspace $ws14
|
bindsym $mod+Shift+o move container to workspace $wso
|
||||||
bindsym $mod+Shift+o move container to workspace $ws16
|
bindsym $mod+Shift+p move container to workspace $wsp
|
||||||
|
|
||||||
# reload the configuration file
|
## Scratchpad
|
||||||
bindsym $mod+Shift+c reload
|
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
# You can send windows there and get them back later.
|
||||||
bindsym $mod+Shift+r restart
|
# Move the currently focused window to the scratchpad
|
||||||
# exit i3 (logs you out of your X session)
|
bindsym $mod+Shift+minus move scratchpad
|
||||||
bindsym $mod+Shift+x 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'"
|
# 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
|
||||||
|
|
||||||
# resize window (you can also use the mouse for that)
|
## Resizing containers
|
||||||
mode "resize" {
|
mode "resize" {
|
||||||
# These bindings trigger as soon as you enter the resize mode
|
# Pressing left will shrink the window’s width
|
||||||
|
# Pressing right will grow the window’s width
|
||||||
# Pressing left will shrink the window’s width.
|
# Pressing up will shrink the window’s height
|
||||||
# Pressing right will grow the window’s width.
|
# Pressing down will grow the window’s height
|
||||||
# Pressing up will shrink the window’s height.
|
bindsym h resize shrink width 5px
|
||||||
# Pressing down will grow the window’s height.
|
bindsym j resize grow height 5px
|
||||||
bindsym h resize shrink width 5 px or 5 ppt
|
bindsym k resize shrink height 5px
|
||||||
bindsym j resize grow height 5 px or 5 ppt
|
bindsym l resize grow width 5px
|
||||||
bindsym k resize shrink height 5 px or 5 ppt
|
# Same bindings, but for the arrow keys
|
||||||
bindsym l resize grow width 5 px or 5 ppt
|
|
||||||
|
|
||||||
# same bindings, but for the arrow keys
|
|
||||||
bindsym Left resize shrink width 5 px or 5 ppt
|
bindsym Left resize shrink width 5 px or 5 ppt
|
||||||
bindsym Down resize grow height 5 px or 5 ppt
|
bindsym Down resize grow height 5 px or 5 ppt
|
||||||
bindsym Up resize shrink height 5 px or 5 ppt
|
bindsym Up resize shrink height 5 px or 5 ppt
|
||||||
bindsym Right resize grow width 5 px or 5 ppt
|
bindsym Right resize grow width 5 px or 5 ppt
|
||||||
|
# Back to normal: Enter or Escape or $mod+r
|
||||||
# back to normal: Enter or Escape or $mod+r
|
|
||||||
bindsym Return mode "default"
|
bindsym Return mode "default"
|
||||||
bindsym Escape mode "default"
|
bindsym Escape mode "default"
|
||||||
bindsym $mod+r mode "default"
|
bindsym $mod+r mode "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
bindsym $mod+r mode "resize"
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
## Status bar
|
||||||
# finds out, if available)
|
|
||||||
bar {
|
bar {
|
||||||
|
position top
|
||||||
status_command i3status
|
status_command i3status
|
||||||
#status_command polybar example
|
|
||||||
|
colors {
|
||||||
|
statusline #ffffff
|
||||||
|
background #323232
|
||||||
|
inactive_workspace #32323200 #32323200 #5c5c5c
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input "1739:31251:SYNA2393:00_06CB:7A13_Touchpad" {
|
## Pre-configured workspaces
|
||||||
tap enabled
|
# Music
|
||||||
natural_scroll enabled
|
exec swaymsg 'workspace media; layout tabbed'
|
||||||
}
|
for_window [class="spotify"] move container to workspace $wsm
|
||||||
|
# Work
|
||||||
|
exec swaymsg 'workspace nth; layout tabbed'
|
||||||
|
assign [class="Kicad"] $wsn
|
||||||
|
assign [title="CubeMX"] $wsn
|
||||||
|
# PDF
|
||||||
|
exec swaymsg 'workspace pdf; layout tabbed'
|
||||||
|
assign [class="okular"] $wsp
|
||||||
|
# Return to first workspace
|
||||||
|
exec swaymsg 'workspace 1'
|
||||||
|
|
||||||
# music
|
## Application specific settings
|
||||||
exec --no-startup-id "i3-msg 'workspace media; layout tabbed'"
|
|
||||||
for_window [class="spotify"] move container to workspace $ws11
|
|
||||||
|
|
||||||
# work
|
|
||||||
exec --no-startup-id "i3-msg 'workspace nwork; layout tabbed'"
|
|
||||||
assign [class="Kicad"] $ws12
|
|
||||||
assign [title="CubeMX"] $ws12
|
|
||||||
|
|
||||||
# pdf
|
|
||||||
exec --no-startup-id "i3-msg 'workspace pdf; layout tabbed'"
|
|
||||||
assign [class="okular"] $ws14
|
|
||||||
|
|
||||||
for_window [title="Desktop — Plasma"] kill;
|
|
||||||
for_window [class="plasmashell"] floating enable;
|
|
||||||
for_window [class="Plasma"] floating enable;
|
|
||||||
for_window [title="plasma-desktop"] floating enable;
|
|
||||||
for_window [title="win7"] floating enable;
|
|
||||||
for_window [class="krunner"] floating enable;
|
for_window [class="krunner"] floating enable;
|
||||||
for_window [class="Kmix"] floating enable; border none
|
|
||||||
for_window [class="konsole"] floating enable;
|
for_window [class="konsole"] floating enable;
|
||||||
#for_window [class="Klipper"] floating enable; border none
|
|
||||||
for_window [class="Plasmoidviewer"] floating enable; border none
|
|
||||||
#for_window [class="(?i)*nextcloud*"] floating disable
|
|
||||||
|
|
Loading…
Reference in New Issue