config: add basic configuration for sway and waybar
This commit is contained in:
parent
6984c5f047
commit
6059f7c564
4 changed files with 568 additions and 0 deletions
236
config/sway/config
Normal file
236
config/sway/config
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
### Variables
|
||||
#
|
||||
# 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
|
||||
|
||||
# Workspace names
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "A"
|
||||
|
||||
# Your preferred terminal emulator
|
||||
set $term gnome-terminal
|
||||
# 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 dmenu_path | dmenu | xargs swaymsg exec --
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
|
||||
# Disable monitor when closing lid and enable it again when opening lid
|
||||
bindswitch --reload --locked lid:on output ePD-1 disable
|
||||
bindswitch --reload --locked lid:off output ePD-1 enable
|
||||
|
||||
# Laptop monitor
|
||||
output eDP-1 pos 3840 0 scale 2
|
||||
|
||||
# External monitors via docking station
|
||||
output DP-6 pos 0 0 scale 1
|
||||
output DP-7 pos 1920 0 scale 1
|
||||
|
||||
### Idle configuration
|
||||
exec swayidle -w \
|
||||
timeout 300 'swaylock -f -c 000000' \
|
||||
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep 'swaylock -f -c 000000'
|
||||
#
|
||||
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||
# your displays after another 300 seconds, and turn your screens back on when
|
||||
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||
|
||||
### Input configuration
|
||||
input type:touchpad {
|
||||
natural_scroll enabled
|
||||
click_method clickfinger
|
||||
}
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout "us,de"
|
||||
xkb_variant "altgr-intl,"
|
||||
xkb_options "ctrl:nocaps,compose:menu,compose:ralt,grp:shifts_toggle"
|
||||
xkb_numlock "enabled"
|
||||
}
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Start your launcher
|
||||
bindsym $mod+d exec $menu
|
||||
|
||||
bindsym $mod+b exec chromium
|
||||
bindsym $mod+p exec passmenu # TODO: add --type as soon as pass is updated
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+c kill
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Shift+r reload
|
||||
|
||||
# Start lockscreen
|
||||
bindsym $mod+q exec swaylock
|
||||
# Exit sway
|
||||
bindsym $mod+Shift+q exit
|
||||
|
||||
# Audio keybindings
|
||||
bindsym XF86AudioMute exec "pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
||||
bindsym XF86AudioLowerVolume exec "pactl set-sink-mute @DEFAULT_SINK@ false && pactl set-sink-volume @DEFAULT_SINK@ '-5%'"
|
||||
bindsym XF86AudioRaiseVolume exec "pactl set-sink-mute @DEFAULT_SINK@ false && pactl set-sink-volume @DEFAULT_SINK@ '+5%'"
|
||||
bindsym XF86AudioMicMute exec "pactl set-source-mute 1 toggle"
|
||||
|
||||
# Brightness control
|
||||
bindsym XF86MonBrightnessDown exec "brightnessctl set 4%-"
|
||||
bindsym XF86MonBrightnessUp exec "brightnessctl set 4%+"
|
||||
|
||||
# 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
|
||||
|
||||
#
|
||||
# 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 $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
|
||||
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# Split in horizontal orientation
|
||||
bindsym $mod+u split h
|
||||
# Split in vertical orientation
|
||||
bindsym $mod+o split v
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
#
|
||||
# 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"
|
||||
|
||||
# Do not focus container behind mouse
|
||||
focus_follows_mouse no
|
||||
|
||||
font pango:DejaVu Sans 8
|
||||
|
||||
# Add external bar
|
||||
bar {
|
||||
position top
|
||||
swaybar_command waybar
|
||||
font pango:DejaVu Sans, FontAwesome 1
|
||||
}
|
||||
|
||||
exec --no-startup-id nm-applet --indicator
|
||||
|
||||
include /etc/sway/config.d/*
|
||||
Loading…
Add table
Add a link
Reference in a new issue