This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dotfiles/sway.conf

393 lines
9.5 KiB
Plaintext
Raw Normal View History

2020-06-21 00:07:53 +02:00
# {{@@ header() @@}}
2019-12-09 19:25:42 +01:00
# _____ ____ _ _ _
2019-12-01 17:36:00 +01:00
# / __\ \ /\ / / _` | | | |
# \__ \\ V V / (_| | |_| |
# |___/ \_/\_/ \__,_|\__, |
2019-12-09 19:25:42 +01:00
# |___/
2019-12-05 18:18:09 +01:00
2019-10-21 21:06:39 +02:00
# Variables {{{
2019-12-09 19:25:42 +01:00
#
2019-10-21 21:06:39 +02:00
# Logo key.
2019-10-16 02:28:41 +02:00
set $mod Mod4
# Home row direction keys, like vim
2020-06-20 18:58:49 +02:00
set $left {{@@ key.left @@}}
set $down {{@@ key.down @@}}
set $up {{@@ key.up @@}}
set $right {{@@ key.right @@}}
2020-08-20 07:10:31 +02:00
set $menu s
2020-05-18 00:40:41 +02:00
set $mus r
2019-10-16 02:28:41 +02:00
2020-04-22 19:34:34 +02:00
set $term terminal
2020-04-19 21:17:46 +02:00
# set $menu wofi --show drun --allow-images --insensitive --term $term -p'Iniciar: '
# set $menu bmenu run $term
2020-10-27 06:59:47 +01:00
font {{@@ font.interface @@}} {{@@ font.size.medium @@}}px
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
#{%@@ if color.type == 'dark' @@%}#
2020-10-02 04:04:49 +02:00
set $wallPath ~/.local/share/wallpapers/assembly.png
2020-10-21 08:52:40 +02:00
#{%@@ else @@%}#
2020-10-10 05:14:55 +02:00
set $wallPath ~/.local/share/wallpapers/austria.jpg
2020-10-21 08:52:40 +02:00
#{%@@ endif @@%}#
2020-09-30 23:15:58 +02:00
2019-10-21 21:06:39 +02:00
# }}}
# Output configuration {{{
2019-10-16 02:28:41 +02:00
#
2020-06-16 21:58:16 +02:00
# output * bg '#252525' solid_color
2020-10-10 05:14:55 +02:00
output * bg $wallPath fill
2020-03-13 03:13:31 +01:00
# Output HDMI-A-1 resolution 1280x720
2019-10-16 02:28:41 +02:00
2020-03-13 03:13:31 +01:00
# Disable laptop screen if closed, --reload is important
2020-11-29 20:18:58 +01:00
# set $laptop eDP-1
# bindswitch --reload lid:on output $laptop disable
# bindswitch --reload lid:off output $laptop enable
2020-04-17 06:54:35 +02:00
2020-04-19 21:17:46 +02:00
# output $laptop disable
2020-04-17 06:54:35 +02:00
# bindsym $mod+o output eDP-1 toggle
# exec_always swaymsg -t get_outputs | grep HDMI || swaymsg 'output eDP-1 enable'
2019-10-16 02:28:41 +02:00
# Backlight settings for laptops
2020-07-04 01:35:32 +02:00
exec light -N 1
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5
2019-10-16 02:28:41 +02:00
2019-10-21 21:06:39 +02:00
# }}}
# Input configuration {{{
2019-12-09 19:25:42 +01:00
#hide the mouse after 10 seconds
seat * hide_cursor 10000
2020-10-10 06:47:05 +02:00
seat * xcursor_theme {{@@ cursor_theme @@}} {{@@ cursor_size @@}}
2019-12-09 19:25:42 +01:00
input "type:touchpad" {
#disable while typing
2020-07-11 04:33:04 +02:00
dwt disabled
2019-10-16 02:28:41 +02:00
natural_scroll enabled
tap enabled
}
input * {
2020-10-22 17:09:42 +02:00
# {%@@ if key_layout == "colemak" @@%}
2020-10-02 04:04:49 +02:00
#
2020-10-24 18:41:16 +02:00
xkb_layout "us(colemak),br"
2020-10-24 22:18:42 +02:00
xkb_options "lv3:lsgt_switch,grp:shifts_toggle"
2020-10-22 17:09:42 +02:00
# {%@@ elif key_layout == "dvorak" @@%}
2020-10-02 04:04:49 +02:00
#
xkb_layout us(dvorak)
# {%@@ endif @@%}
2020-06-25 23:14:45 +02:00
xkb_options caps:backspace
2019-10-16 02:28:41 +02:00
xkb_numlock enabled
}
2019-12-09 19:25:42 +01:00
2019-10-21 21:06:39 +02:00
# }}}
# Key bindings: {{{
2019-12-09 19:25:42 +01:00
2020-10-21 08:52:40 +02:00
# mouse button for dragging.
floating_modifier $mod normal
2019-12-09 19:25:42 +01:00
2020-10-21 08:52:40 +02:00
bindsym {
# Basic {{{
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Start a terminal
$mod+Return exec $term
2019-11-23 18:35:46 +01:00
2020-10-21 08:52:40 +02:00
#start web browser
$mod+b exec qutebrowser
2020-06-22 23:39:00 +02:00
2020-10-21 08:52:40 +02:00
#start file manager
2020-11-23 22:28:07 +01:00
$mod+Control+Return exec {{@@ file_manager @@}}
2019-10-16 02:28:41 +02:00
2020-10-22 17:09:42 +02:00
$mod+g exec emoji
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Kill focused window
$mod+x kill
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Start your launcher
$mod+$menu exec launcher
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Fill passwords
$mod+p exec wpass
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Reload the configuration file
$mod+Shift+c reload
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Lock Sway
--locked $mod+Control+z exec loginctl suspend || systemctl suspend
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Exit sway (logs you out of your Wayland session)
$mod+Shift+q exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'
2019-12-13 03:25:15 +01:00
Control+Alt+delete exit
2019-12-09 19:25:42 +01:00
2020-10-21 08:52:40 +02:00
# }}}
# Moving around: {{{
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Move your focus around
#{%@@ for d in "up,down,left,right".split(',') @@%}#
$mod+${{@@ d @@}} focus {{@@ d @@}}
$mod+{{@@ d.capitalize() @@}} focus {{@@ d @@}}
$mod+Shift+${{@@ d @@}} move {{@@ d @@}}
#{%@@ endfor @@%}#
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Resizing containers:
$mod+Control+$left resize shrink width 20px
$mod+Control+$down resize grow height 20px
$mod+Control+$up resize shrink height 20px
$mod+Control+$right resize grow width 20px
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
#}}}
# Workspaces: {{{
2019-12-09 19:25:42 +01:00
2020-11-01 22:39:14 +01:00
# Mouse prev/next button
--whole-window $mod+button8 workspace next_on_output
--whole-window $mod+button9 workspace prev_on_output
$mod+{{@@ key.tabL @@}} workspace prev_on_output
$mod+{{@@ key.tabR @@}} workspace next_on_output
$mod+Shift+{{@@ key.tabL @@}} move workspace prev_on_output
$mod+Shift+{{@@ key.tabR @@}} move workspace next_on_output
2020-06-24 05:36:42 +02:00
2020-10-21 08:52:40 +02:00
# Switch to workspace
# Move focused container to workspace
#{%@@ for i in range(1,11) @@%}#
$mod+{{@@ i % 10 @@}} workspace {{@@ i @@}}
$mod+Shift+{{@@ i % 10 @@}} move container to workspace {{@@ i @@}}
#{%@@ endfor @@%}#
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# }}}
# Layout stuff: {{{
#
# Splits
# bindsym $mod+b splith
$mod+v splitv
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Layout styles
$mod+t layout tabbed
$mod+r layout toggle split
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Make the current focus fullscreen
$mod+f fullscreen
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Floating
$mod+Shift+space floating toggle
$mod+space focus mode_toggle
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Move focus to the parent container
$mod+a focus parent
$mod+z focus child
2019-12-09 19:25:42 +01:00
2020-10-21 08:52:40 +02:00
# }}}
# Screenshots: {{{
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Screens to file
Print exec screenshotsh def
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Screen area to file
Shift+Print exec screenshotsh area
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Screen area to clipboard
Control+Shift+Print exec screenshotsh area-clip
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Focused monitor to clipboard
Control+Print exec screenshotsh clip
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Screen recorder
Control+Alt+Shift+r exec wf-recorder -a
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Mirror selection as window
$mod+Alt+r exec sssway
2020-08-20 07:10:31 +02:00
2020-10-21 08:52:40 +02:00
# Color picker
$mod+c exec color-picker
2019-12-13 03:45:04 +01:00
2020-10-21 08:52:40 +02:00
# show keys being pressed
$mod+k exec showkeys
2020-10-03 02:34:21 +02:00
2020-10-21 08:52:40 +02:00
# }}}
# Audio: {{{
2019-10-16 02:28:41 +02:00
2020-10-21 08:52:40 +02:00
# Volume controll
# script in dotfiles
--locked XF86AudioRaiseVolume exec volumesh -i 10
--locked XF86AudioLowerVolume exec volumesh -d 10
--locked XF86AudioMute exec volumesh -t
2019-12-18 01:36:42 +01:00
2020-10-21 08:52:40 +02:00
# Media player controls
--locked XF86AudioPlay exec mpc toggle
--locked XF86AudioNext exec mpc next
--locked XF86AudioPrev exec mpc prev
# }}}
# Special Keys{{{
XF86Calculator exec $term ipython
XF86Mail exec $term neomutt
2020-11-23 22:28:07 +01:00
XF86Explorer exec {{@@ file_manager @@}}
2020-10-21 08:52:40 +02:00
XF86HomePage exec xdg-open http://start.duckduckgo.com
2019-12-18 01:36:42 +01:00
2020-05-03 02:26:06 +02:00
2020-10-21 08:52:40 +02:00
# }}}
}
# Modes {{{
2020-11-01 22:35:07 +01:00
set $dexec mode default;exec
# Music {{{
bindsym $mod+m mode Music
2020-11-02 23:49:05 +01:00
mode Music bindsym {
2020-11-01 22:35:07 +01:00
2020-11-02 01:34:38 +01:00
m exec volumesh -t
{{@@ key.tabL @@}} exec volumesh -d 10
{{@@ key.tabR @@}} exec volumesh -i 10
2020-11-02 01:33:41 +01:00
{{@@ key.right @@}} exec mpc next
{{@@ key.left @@}} exec mpc prev
2020-11-02 23:49:05 +01:00
{{@@ key.up @@}} exec volumesh --mpd -i 10
{{@@ key.down @@}} exec volumesh --mpd -d 10
2020-11-01 22:35:07 +01:00
space $dexec mpc toggle
p $dexec mpc toggle
d $dexec musmenu delete
f $dexec musmenu search
a $dexec dzadd
s $dexec pulse-sink
escape mode default
q mode default
2020-11-02 23:49:05 +01:00
2020-11-01 22:35:07 +01:00
}
# }}}
2020-10-21 08:52:40 +02:00
mode Passthrough {
bindsym $mod+escape mode default
}
bindsym $mod+escape mode Passthrough
# }}}
2019-10-21 21:06:39 +02:00
# }}}
# Visual: {{{
2019-10-16 02:28:41 +02:00
#
2020-10-25 22:10:20 +01:00
set $accent {{@@ accent_color @@}}
2020-06-20 18:58:49 +02:00
set $fg_color {{@@ color.txt @@}}
2020-06-22 21:44:03 +02:00
set $bg_color {{@@ color.bg_dark @@}}
2019-10-16 02:28:41 +02:00
set $alert #000000
2019-10-17 16:36:48 +02:00
2019-10-16 02:28:41 +02:00
# border background text indicator child_border
client.focused $accent $accent $fg_color $accent $accent
2019-12-03 04:38:10 +01:00
client.focused_inactive $bg_color $bg_color $fg_color $bg_color $bg_color
client.unfocused $bg_color $bg_color $fg_color $bg_color $bg_color
2019-10-16 02:28:41 +02:00
client.urgent $alert $alert $fg_color $alert $alert
2020-06-22 01:28:39 +02:00
{%@@ if bar == "waybar" @@%}
# Wake up pulseaudio
exec pactl set-sink-volume @DEFAULT_SINK@ +0%
2019-11-26 04:25:42 +01:00
bar swaybar_command waybar
2020-06-22 01:28:39 +02:00
{%@@ else @@%}
2020-10-21 08:52:40 +02:00
# I rarely use this
2020-06-22 01:28:39 +02:00
bar {
position {{@@ bar_pos @@}}
# status_command i3blocks
2019-12-26 05:23:47 +01:00
# gaps 5px
2020-10-10 06:47:05 +02:00
icon_theme {{@@ icon_theme @@}}
2020-06-22 01:28:39 +02:00
font {{@@ font.interface @@}} 14px
colors {
statusline $fg_color
background $bg_color
focused_workspace $accent $bg_color $fg_color
}
}
{%@@ endif @@%}
2019-11-26 04:25:42 +01:00
2019-10-16 02:28:41 +02:00
default_border pixel 2px
2020-06-20 18:58:49 +02:00
default_floating_border normal 2px
2019-10-16 02:28:41 +02:00
gaps inner 5px
2020-06-16 21:58:16 +02:00
smart_gaps on
2020-10-02 04:04:49 +02:00
smart_borders on
2019-10-21 22:55:20 +02:00
2019-12-23 01:36:47 +01:00
# for_window [app_id=mpv] floating enable
2020-10-24 01:45:03 +02:00
for_window [app_id=weather] fullscreen
2019-12-05 20:48:20 +01:00
# for_window [app_id=weather] resize set 635px 700px
2020-10-24 01:45:03 +02:00
# for_window [app_id=weather] resize set 1500px 750px
2019-11-24 18:33:26 +01:00
# set theme
set $gnome-schema org.gnome.desktop.interface
exec_always {
2020-10-11 00:12:02 +02:00
kvantummanager --set '{{@@ kvantum_theme @@}}'
2020-10-10 06:47:05 +02:00
gsettings set $gnome-schema gtk-theme '{{@@ gtk_theme @@}}'
gsettings set $gnome-schema icon-theme '{{@@ icon_theme @@}}'
gsettings set $gnome-schema cursor-theme '{{@@ cursor_theme @@}}'
2019-11-24 18:33:26 +01:00
}
2019-10-21 21:06:39 +02:00
# }}}
2020-10-21 08:52:40 +02:00
# Assigns {{{
for_window [app_id=pavucontrol] floating enable
2020-10-09 17:02:19 +02:00
assign [app_id=qutebrowser] workspace 2
assign [class=qutebrowser] workspace 2
assign [class=Steam] workspace 9
assign [app_id=telegram.?desktop] workspace 10
assign [class=TelegramDesktop] workspace 10
assign [class=discord] workspace 10
#}}}
2019-10-21 21:06:39 +02:00
# Daemons {{{
2019-10-16 02:28:41 +02:00
#
2019-11-25 05:02:00 +01:00
2020-10-21 08:52:40 +02:00
# start dbusd just in case
2020-06-22 01:28:39 +02:00
exec 'dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus'
2020-10-21 08:52:40 +02:00
2019-10-16 02:28:41 +02:00
#Notification Daemon
2020-10-24 18:43:02 +02:00
exec_always pidof mako || mako
2019-10-16 02:28:41 +02:00
# Block device Mounter to /run/media/<username>
exec udiskie
2019-12-09 19:25:42 +01:00
# gesture daemon
2019-12-14 23:54:01 +01:00
exec fusuma
2020-04-19 21:17:46 +02:00
# exec sh -c 'pkill fusuma; fusuma'
2019-10-16 02:28:41 +02:00
# Blue light filter
2020-10-24 18:43:02 +02:00
exec_always pidof redshift || redshift
2019-11-26 04:25:42 +01:00
# kde connect
2019-11-23 20:29:02 +01:00
exec /usr/lib/kdeconnectd
2019-11-26 04:25:42 +01:00
exec kdeconnect-indicator
# Telegram
2020-03-13 03:13:31 +01:00
exec telegram-desktop-bin || telegram-desktop
2019-11-26 14:02:22 +01:00
# Music Player Daemon
2020-10-06 08:58:33 +02:00
exec pidof mpd || mpd
2020-10-09 05:25:09 +02:00
exec pgrep -f mpDris2|| mpDris2
2020-09-30 23:15:58 +02:00
2020-10-21 08:52:40 +02:00
# Prevent the screen from locking if fullscreen
for_window [title=.*] inhibit_idle fullscreen
2020-09-30 23:15:58 +02:00
2020-10-08 17:14:32 +02:00
# Lock configuration
2020-10-09 06:24:27 +02:00
set $lock swaylock -f \
2020-10-08 17:14:32 +02:00
--image $wallPath \
2020-10-21 08:52:40 +02:00
--font '{{@@ font.interface @@}}' \
2020-10-08 17:14:32 +02:00
2020-10-09 06:24:27 +02:00
set $screenReload \
pkill kanshi; \
2020-10-10 02:38:58 +02:00
kanshi & disown\
2020-10-09 06:24:27 +02:00
2020-10-08 17:14:32 +02:00
# Idle daemon
2020-10-09 06:24:27 +02:00
exec_always pkill swayidle && false || \
exec swayidle -w \
before-sleep '$lock' \
after-resume '$screenReload' \
2020-11-12 00:21:38 +01:00
timeout 360 '$lock' \
2020-10-09 06:24:27 +02:00
resume '$screenReload' \
2020-10-03 02:01:15 +02:00
timeout 1800 'swaymsg "output * dpms off"' \
2020-10-09 21:48:17 +02:00
resume 'swaymsg "output * dpms on";$screenReload' \
2020-10-09 06:24:27 +02:00
# Screen manager
exec_always $screenReload
2019-10-16 02:28:41 +02:00
2020-04-20 04:27:35 +02:00
include /etc/sway/config.d/
#}}}
2020-11-12 20:15:55 +01:00
# vim:filetype=sh:foldmethod=marker