Skip to content

Instantly share code, notes, and snippets.

@Mel34
Created September 1, 2019 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mel34/a56ca05b66d6d631ce1436efbf7d7d4f to your computer and use it in GitHub Desktop.
Save Mel34/a56ca05b66d6d631ce1436efbf7d7d4f to your computer and use it in GitHub Desktop.
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Your preferred terminal emulator
set $term konsole
# Your preferred application launcher
# Note: it's recommended that you pass the final command to sway
set $uifont "Ubuntu 14"
set $highlight #5983c5
set $transparent #00000000
set $prompt #18b218
set $bground #000000
set $lock swaylock -f -c 000000
set $coords slurp -c '$highlight'
set $wallpaper ~/Pictures/DzNT32SVAAU2o1D.jpg
#set $lock swaylock -f -i $wallpaper -s fill
#set $menu bemenu-run -b --line-height 27 --fn "$uifont" -p "▶" --tf "$prompt" --hf "$highlight"
#set $menu dot-desktop | bemenu -b --line-height 27 --fn "$uifont" -p "▶" --tf "$prompt" --hf "$highlight"
set $menu wldash
### Needed for xdg-desktop-portal-kde
exec_always dbus-launch --exit-with-session
exec_always dbus-update-activation-environment --systemd --all
### Needed for pkexec
exec_always /usr/lib/polkit-kde-authentication-agent-1
exec_always import-gsettings gtk-theme:gtk-theme-name icon-theme:gtk-icon-theme-name cursor-theme:gtk-cursor-theme-name
### 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
# You can get the names of your outputs by running: swaymsg -t get_outputs
output HDMI-A-2 resolution 2560x1080 position 0,0
output DVI-D-1 resolution 1920x1080 position 2560,0
#output * background $wallpaper fill
output * bg $bground solid_color
### Idle configuration
#
# Example 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
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# 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 "2385:5815:Kingston_HyperX_Alloy_FPS_Mechanical_Gaming_Keyboard" {
xkb_layout hr(us)
xkb_numlock enable
}
# Mouse doesn't jump screens when we move containers
mouse_warping none
# Mouse hiding
# seat * hide_cursor 30000
### Key bindings
#
# Basics:
#
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+q kill
bindsym mod1+F4 kill
# start your launcher
#bindsym Grave exec $menu
#bindcode 133 --release exec $menu
#bindsym --release Super_L exec pkill wldash
#bindsym --release Super_L exec $menu
bindsym $mod+r exec $menu start-or-kill
bindsym Super_L exec pkill wldash
#bindcode 133 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+c reload
# exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym Control+Mod1+Backspace exec swaymsg exit
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_role="About"] floating enable
for_window [class="xdg-desktop-portal-kde"] floating enable
for_window [class="ksysguard"] floating enable
for_window [class="ksysguard"] sticky enable
for_window [app_id="ksysguard"] floating enable
for_window [app_id="ksysguard"] sticky enable
for_window [class="Wine"] fullscreen enable
for_window [title="Euro Truck Simulator 2"] floating enable
assign [class="Wine"] output HDMI-A-2
assign [class="cantata"] output DVI-D-1
assign [class="ktorrent"] output DVI-D-1
for_window [title="^(File|Folder)\s*Already Exists\s*—\s*Dolphin" window_type="dialog"] move scratchpad
for_window [title="^(Copying|Moving)\s*—\s*Dolphin" window_type="dialog"] scratchpad show
bindsym $mod+F12 exec shutdown now
bindsym $mod+F11 exec swaymsg output DVI-D-1 toggle
bindsym $mod+F10 exec swaymsg output HDMI-A-2 toggle
bindsym Mod4+L exec $lock
bindsym Control+Mod1+Delete exec ksysguard
bindsym $mod+F1 exec dolphin
bindsym $mod+e exec dolphin
bindsym $mod+F2 exec cantata
bindsym $mod+F3 exec mpv --player-operation-mode=pseudo-gui
bindsym $mod+F4 exec firefox
bindsym $mod+F5 exec kate
bindsym $mod+F6 exec lutris
bindsym $mod+F7 exec notify-send "Weather" "$(weather)"
bindsym $mod+F8 exec makoctl dismiss --all
bindsym $mod+F9 exec pkill pavucontrol-qt || pavucontrol-qt
bindsym $mod+Shift+F4 exec firefox --private-window
bindsym Print exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') $(xdg-user-dir)/Pictures/Screenshot_$(date +'%Y-%m-%d-%H%M%S.png')
bindsym Alt+Print exec grim $(xdg-user-dir)/Pictures/Screenshot_$(date +'%Y-%m-%d-%H%M%S.png')
bindsym Control+Print exec grim -g "$($coords)" $(xdg-user-dir)/Pictures/Screenshot_$(date +'%Y-%m-%d-%H%M%S.png')
bindsym $mod+Print exec grim -g "$(fcoords)" $(xdg-user-dir)/Pictures/Screenshot_$(date +'%Y-%m-%d-%H%M%S.png') | wl-copy
bindsym Shift+Print exec grim -g "$($coords)" - | wl-copy
bindsym $mod+Shift+Print exec grim -g "$(fcoords)" - | wl-copy
bindsym $mod+tab workspace back_and_forth
#
# Multimedia keys
#
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
#
# Moving around:
#
# Move your focus around 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
#bindsym $mod+Prior workspace prev
#bindsym $mod+Next workspace next
bindsym $mod+Prior workspace prev_on_output --create prev
bindsym $mod+Next workspace next_on_output --create next
bindsym --whole-window $mod+Button4 workspace prev_on_output --create prev
bindsym --whole-window $mod+Button5 workspace next_on_output --create next
# _move_ the focused window with the same, but add Shift 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 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 focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindsym --whole-window $mod+Shift+Button4 move left
bindsym --whole-window $mod++Shift+Button5 move right
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
# Odds left monitor
workspace 1 output HDMI-A-2
workspace 3 output HDMI-A-2
workspace 5 output HDMI-A-2
workspace 7 output HDMI-A-2
workspace 9 output HDMI-A-2
# Evens right monitor
workspace 2 output DVI-D-1
workspace 4 output DVI-D-1
workspace 6 output DVI-D-1
workspace 8 output DVI-D-1
workspace 10 output DVI-D-1
#
# 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
# Switch the current container between different layout styles
bindsym $mod+k layout stacking
bindsym $mod+h layout tabbed
bindsym $mod+j layout toggle split
# Make the current focus fullscreen
bindsym F11 fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+Shift+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
bindsym $mod+Shift+Menu 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
bindsym $mod+Menu scratchpad show
#
# Resizing containers:
#
bindsym $mod+Control+Left resize shrink width 10px
bindsym $mod+Control+Down resize grow height 10px
bindsym $mod+Control+Up resize shrink height 10px
bindsym $mod+Control+Right resize grow width 10px
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
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Control+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
#position top
mode hide
hidden_state hide
#modifier $mod
font $uifont
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
#status_command while date +'%-d.%-m.%Y. %H:%M:%S %p'; do sleep 1; done
status_command swaybar_json.sh
colors {
statusline $highlight
#background $bground
background $transparent
focused_workspace $highlight $highlight #ffffff
active_workspace $highlight #464646 #ffffff
inactive_workspace $highlight #7f8c8d #000000
}
}
#
# Titlebars
#
default_border pixel
default_floating_border pixel
hide_edge_borders none
#
# Colors
#
# class border backgr. text indicator child_border
client.focused #4c7899 #285577 #ffffff $highlight $highlight
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
client.unfocused #333333 #222222 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
include /etc/sway/config.d/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment