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

373 lines
10 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
set $suspend b
set $kill x
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-02 04:04:49 +02:00
font {{@@ font.interface @@}} 14px
2019-10-16 02:28:41 +02:00
2020-10-10 05:14:55 +02:00
{%@@ if color.type == 'dark' @@%}
2020-10-02 04:04:49 +02:00
set $wallPath ~/.local/share/wallpapers/assembly.png
2020-10-10 05:14:55 +02:00
{%@@ else @@%}
set $wallPath ~/.local/share/wallpapers/austria.jpg
{%@@ 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
2019-10-16 02:28:41 +02:00
set $laptop eDP-1
2019-11-23 02:23:15 +01:00
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-02 04:04:49 +02:00
# {%@@ if key.layout == "colemak" @@%}
#
xkb_layout us(colemak)
xkb_options lv3:lsgt_switch
# {%@@ elif key.layout == "dvorak" @@%}
#
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: {{{
# Basic {{{
2019-12-09 19:25:42 +01:00
2019-10-16 02:28:41 +02:00
# Start a terminal
2019-12-09 19:25:42 +01:00
bindsym $mod+Return exec $term
2019-10-16 02:28:41 +02:00
#start web browser
2020-05-18 00:40:41 +02:00
bindsym $mod+b exec qutebrowser
2019-10-16 02:28:41 +02:00
2019-11-23 18:35:46 +01:00
#start file manager
2020-10-06 08:59:37 +02:00
bindsym $mod+m exec thunar
2019-11-23 18:35:46 +01:00
2020-08-20 07:10:31 +02:00
bindsym $mod+j exec emoji
2020-06-22 23:39:00 +02:00
2019-10-16 02:28:41 +02:00
# Kill focused window
2020-05-18 00:40:41 +02:00
bindsym $mod+$kill kill
2019-10-16 02:28:41 +02:00
# Start your launcher
2020-05-18 00:40:41 +02:00
bindsym $mod+$menu exec launcher
2019-10-16 02:28:41 +02:00
# Fill passwords
2020-10-02 03:55:32 +02:00
bindsym $mod+p exec wpass
2019-10-16 02:28:41 +02:00
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
2019-10-16 02:28:41 +02:00
# Lock Sway
2020-09-30 23:15:58 +02:00
bindsym $mod+Control+$suspend exec loginctl suspend || systemctl suspend
2019-10-16 02:28:41 +02:00
# Exit sway (logs you out of your Wayland session)
2020-08-20 07:10:31 +02:00
bindsym $mod+Shift+q exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'
2019-10-16 02:28:41 +02:00
2019-12-13 03:25:15 +01:00
bindsym Control+Shift+BackSpace exit
2019-10-21 21:06:39 +02:00
# }}}
# Moving around: {{{
2019-12-09 19:25:42 +01:00
# Move your focus around
2020-05-18 00:40:41 +02:00
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
2019-10-16 02:28:41 +02:00
bindsym $mod+$right focus right
2020-05-18 00:40:41 +02:00
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
2019-10-16 02:28:41 +02:00
2019-12-09 19:25:42 +01:00
# Move the focused window with the same, but add Shift
2020-05-18 00:40:41 +02:00
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
2019-10-16 02:28:41 +02:00
2020-10-20 21:19:29 +02:00
bindsym $mod+Shift+{{@@ key.tabL @@}} move workspace prev
bindsym $mod+Shift+{{@@ key.tabR @@}} move workspace next
2019-12-09 19:25:42 +01:00
# Resizing containers:
2020-04-17 06:54:35 +02:00
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
2019-10-16 02:28:41 +02:00
2019-12-09 19:25:42 +01:00
#}}}
2019-10-21 21:06:39 +02:00
# Workspaces: {{{
2019-12-09 19:25:42 +01:00
2020-10-02 04:04:49 +02:00
bindsym $mod+{{@@ key.tabL @@}} workspace prev
bindsym $mod+{{@@ key.tabR @@}} workspace next
2020-06-24 05:36:42 +02:00
2019-12-09 19:25:42 +01:00
# Switch to workspace
# Move focused container to workspace
2020-06-29 04:23:15 +02:00
{%@@ for i in range(1,11) @@%}
bindsym $mod+{{@@ i % 10 @@}} workspace {{@@ i @@}}
bindsym $mod+Shift+{{@@ i % 10 @@}} move container to workspace {{@@ i @@}}
2020-06-24 05:36:42 +02:00
{%@@ endfor @@%}
2019-10-16 02:28:41 +02:00
2019-10-21 21:06:39 +02:00
# }}}
# Layout stuff: {{{
2019-12-09 19:25:42 +01:00
#
2019-10-16 02:28:41 +02:00
# Splits
2020-05-18 00:40:41 +02:00
# bindsym $mod+b splith
2019-10-16 02:28:41 +02:00
bindsym $mod+v splitv
# Layout styles
2020-08-20 07:10:31 +02:00
bindsym $mod+t layout tabbed
bindsym $mod+r layout toggle split
2019-10-16 02:28:41 +02:00
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
2019-12-09 19:25:42 +01:00
bindsym $mod+z focus child
2019-10-21 21:06:39 +02:00
# }}}
# Screenshots: {{{
2019-12-09 19:25:42 +01:00
#
2019-10-16 02:28:41 +02:00
# Screens to file
2020-07-15 08:24:12 +02:00
bindsym Print exec screenshotsh def
2019-10-16 02:28:41 +02:00
# Screen area to file
2020-07-15 08:24:12 +02:00
bindsym Shift+Print exec screenshotsh area
2019-10-16 02:28:41 +02:00
# Screen area to clipboard
2020-07-15 08:24:12 +02:00
bindsym Control+Shift+Print exec screenshotsh area-clip
2019-10-16 02:28:41 +02:00
# Focused monitor to clipboard
2020-07-15 08:24:12 +02:00
bindsym Control+Print exec screenshotsh clip
2019-10-16 02:28:41 +02:00
2019-12-02 19:57:45 +01:00
# Screen recorder
2019-12-09 19:25:42 +01:00
bindsym Control+Alt+Shift+r exec wf-recorder -a
2019-10-16 02:28:41 +02:00
2020-08-20 07:10:31 +02:00
# Mirror selection as window
bindsym $mod+Alt+r exec sssway
2019-12-13 03:45:04 +01:00
# Color picker
bindsym $mod+c exec color-picker
2020-10-03 02:34:21 +02:00
# show keys being pressed
bindsym $mod+k exec showkeys
2019-10-21 21:06:39 +02:00
# }}}
2019-12-02 19:57:45 +01:00
# Audio: {{{
2019-10-21 21:06:39 +02:00
#
2020-10-02 03:55:32 +02:00
bindsym Control+$mod+p exec pulse-sink
2019-10-16 02:28:41 +02:00
for_window [app_id="pavucontrol"] floating enable
# Volume controll
2020-07-15 08:18:27 +02:00
# script in dotfiles
bindsym --locked XF86AudioRaiseVolume exec volumesh -i 10
bindsym --locked XF86AudioLowerVolume exec volumesh -d 10
bindsym --locked XF86AudioMute exec volumesh -t
2019-10-16 02:28:41 +02:00
2020-06-20 18:58:49 +02:00
# Media player controls
2020-06-24 05:34:06 +02:00
{%@@ if exists_in_path ( 'playerctl' ) @@%}
2019-12-13 03:25:15 +01:00
# playerctl for notifications
2020-06-24 05:34:06 +02:00
bindsym --locked XF86AudioPlay exec playerctl -p mpd play-pause
bindsym --locked XF86AudioNext exec playerctl -p mpd next
bindsym --locked XF86AudioPrev exec playerctl -p mpd previous
{%@@ else @@%}
bindsym --locked XF86AudioPlay exec mpc toggle
bindsym --locked XF86AudioNext exec mpc next
2020-06-25 08:00:04 +02:00
bindsym --locked XF86AudioPrev exec mpc prev
2020-06-24 05:34:06 +02:00
{%@@ endif @@%}
bindsym $mod+Shift+$mus exec musmenu delete
bindsym $mod+Control+$mus exec musmenu search
bindsym $mod+Control+Shift+$mus exec dzadd
2019-10-16 02:28:41 +02:00
2019-12-18 01:36:42 +01:00
# }}}
# Special Keys{{{
bindsym XF86Calculator exec $term ipython
bindsym XF86Mail exec $term neomutt
2020-04-19 21:17:46 +02:00
bindsym XF86Explorer exec thunar
2019-12-18 01:36:42 +01:00
bindsym XF86HomePage exec xdg-open http://start.duckduckgo.com
2020-06-20 18:58:49 +02:00
mode Passthrough {
2020-05-03 02:26:06 +02:00
bindsym $mod+escape mode default
}
2020-06-20 18:58:49 +02:00
bindsym $mod+escape mode Passthrough
2020-05-03 02:26:06 +02:00
2019-10-21 21:06:39 +02:00
# }}}
# }}}
# Visual: {{{
2019-10-16 02:28:41 +02:00
#
2020-06-20 18:58:49 +02:00
set $accent {{@@ color.accent @@}}
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 @@%}
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
2019-12-05 20:48:20 +01:00
for_window [app_id=weather] floating enable
# for_window [app_id=weather] resize set 635px 700px
2020-10-10 07:43:28 +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-09 17:02:19 +02:00
# Assigns to workspaces {{{
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-06-22 01:28:39 +02:00
exec 'dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus'
2019-10-16 02:28:41 +02:00
#Notification Daemon
exec mako
# 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-06 08:58:33 +02:00
exec pidof redshift || redshift
2020-04-19 21:17:46 +02:00
# exec_always sh -c 'pkill 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
2019-10-16 02:28:41 +02:00
# lock screen after a period of inactivity execp for fullscreen
for_window [class=.*] 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 \
--font 'Inter' \
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' \
timeout 1800 '$lock' \
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-07-20 08:09:42 +02:00
# vim:filetype=sh:foldmethod=marker