1
0
Fork 0
mirror of https://github.com/eoli3n/dotfiles synced 2024-05-25 08:56:04 +02:00
eoli3n-dotfiles/roles/sway/templates/config.j2

260 lines
7.9 KiB
Plaintext
Raw Normal View History

# Sway config file
# configure keyboard
input * xkb_layout "fr"
input * xkb_variant "oss"
input * xkb_options "grp:win_space_toggle"
2021-05-22 19:22:29 +02:00
input * xkb_numlock "enabled"
input "MANUFACTURER1 Keyboard" xkb_model "pc101"
# configure touchpad
input type:touchpad dwt disabled
2021-05-29 19:48:41 +02:00
input type:touchpad click_method clickfinger
# mod key
set $mod Mod4
# fonts
2022-02-22 10:31:41 +01:00
font pango: "{{ font }}"{% for i in font_icon %}, "{{ i }}"{% endfor %} 10
2019-12-12 19:36:41 +01:00
# gaps
default_border none
hide_edge_borders --i3 both
smart_borders off
smart_gaps on
gaps inner 4
gaps outer -4
# start a terminal
bindsym $mod+Return exec wezterm
2020-05-07 22:59:58 +02:00
# start wofi
2020-05-08 10:07:44 +02:00
bindsym $mod+Shift+d exec --no-startup-id wofi --show run -p "shell:" -L10
bindsym $mod+d exec --no-startup-id wofi --show drun -p "app:" -L 10
bindsym $mod+s exec --no-startup-id gopass ls --flat | wofi --dmenu -p "password:" -L 10 | xargs --no-run-if-empty gopass show -c
2022-10-30 13:16:43 +01:00
bindsym $mod+Shift+s exec --no-startup-id gopass ls --flat web | wofi --dmenu -p "password:" -L 10 | xargs --no-run-if-empty gopass totp -c
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# kill focused window
bindsym $mod+Shift+a kill
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+m focus right
2022-10-30 13:16:43 +01:00
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+m move right
# alternatively, you can use the cursor 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
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
#bindsym $mod+s layout stacking
bindsym $mod+z layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
2019-12-12 22:54:20 +01:00
#bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+q focus parent
# focus the child container
#bindsym $mod+d focus child
#scratchpad
bindsym $mod+twosuperior scratchpad show
bindsym $mod+Shift+twosuperior move scratchpad
#Swith with same key to precedent workspace
workspace_auto_back_and_forth yes
# set workspace names
set $tag1 "1:"
set $tag2 "2:"
2021-12-29 01:21:45 +01:00
set $tag3 "3:"
set $tag4 "4:"
2021-12-29 01:21:45 +01:00
set $tag5 "5:"
set $tag6 "6:"
set $tag7 "7:"
2019-12-28 22:02:03 +01:00
set $tag8 "8:"
set $tag9 "9:"
set $tag10 "10:"
#colors
# class border backgr. text indicator child_border
client.focused #222222 #5A5A5A #E1E1E1 #000000 #000000
client.focused_inactive #222222 #5A5A5A #E1E1E1 #484e50 #000000
client.unfocused #222222 #323232 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
#rofi_power menu
2020-05-08 01:26:29 +02:00
bindsym $mod+Shift+q exec ~/.config/wofi/powermenu.sh
2020-05-08 00:15:44 +02:00
#grimshot
bindsym Shift+Print exec grimshot save area /home/user/img/screenshots/$(zenity --entry --text "Set filename:" --entry-text ".png") | wl-copy -p
bindsym Control+Print exec grimshot save window /home/user/img/screenshots/$(zenity --entry --text "Set filename:" --entry-text ".png") | wl-copy -p
bindsym Print exec grimshot save output /home/user/img/screenshots/$(zenity --entry --text "Set filename:" --entry-text ".png") | wl-copy -p
2020-05-08 00:15:44 +02:00
2020-05-10 11:28:50 +02:00
# variety
2020-05-11 20:49:40 +02:00
bindsym $mod+less exec variety --next
2020-05-10 11:28:50 +02:00
# apps
2021-05-13 09:19:37 +02:00
bindsym $mod+Control+z exec zim
2022-09-30 16:53:39 +02:00
bindsym $mod+Control+t exec nemo
bindsym $mod+Control+p exec pavucontrol
2022-12-10 17:22:24 +01:00
bindsym $mod+Control+b exec blueman-manager
2023-06-15 20:26:05 +02:00
bindsym $mod+Control+w exec iwgtk
2020-05-10 11:28:50 +02:00
# bindsym spotify
2021-04-11 13:46:44 +02:00
bindsym $mod+Control+left exec playerctl -p spotify previous
bindsym $mod+Control+down exec playerctl -p spotify play-pause
bindsym $mod+Control+right exec playerctl -p spotify next
2020-05-10 11:28:50 +02:00
# switch to workspace
bindsym $mod+ampersand workspace $tag1
bindsym $mod+eacute workspace $tag2
bindsym $mod+quotedbl workspace $tag3
bindsym $mod+apostrophe workspace $tag4
bindsym $mod+parenleft workspace $tag5
bindsym $mod+minus workspace $tag6
bindsym $mod+egrave workspace $tag7
bindsym $mod+underscore workspace $tag8
bindsym $mod+ccedilla workspace $tag9
bindsym $mod+agrave workspace $tag10
# move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace $tag1
bindsym $mod+Shift+eacute move container to workspace $tag2
bindsym $mod+Shift+quotedbl move container to workspace $tag3
bindsym $mod+Shift+apostrophe move container to workspace $tag4
2020-05-11 20:49:40 +02:00
bindsym $mod+Shift+parenleft move container to workspace $tag5
bindsym $mod+Shift+minus move container to workspace $tag6
bindsym $mod+Shift+egrave move container to workspace $tag7
bindsym $mod+Shift+underscore move container to workspace $tag8
bindsym $mod+Shift+ccedilla move container to workspace $tag9
bindsym $mod+Shift+agrave move container to workspace $tag10
# floatings
for_window [title="Images de Variety"] floating enable, border pixel 1, move left 647px
2021-02-10 11:44:42 +01:00
for_window [app_id="zenity"] floating enable
2020-05-10 17:07:30 +02:00
# assign and focus xwayland
2021-12-29 01:21:45 +01:00
assign [class="Spotify"] $tag6
2020-05-07 22:42:12 +02:00
for_window [class="Spotify"] focus
2021-12-29 01:21:45 +01:00
assign [class="code-oss"] $tag8
2020-05-07 22:39:07 +02:00
for_window [class="code-oss"] focus
2020-05-10 17:07:30 +02:00
assign [class="gimp"] $tag8
for_window [class="gimp"] focus
# assign and focus wayland
2021-12-29 01:21:45 +01:00
assign [app_id="evolution"] $tag3
2021-12-29 01:15:06 +01:00
for_window [app_id="evolution"] focus
2020-05-07 22:42:12 +02:00
assign [app_id="virt-manager"] $tag8
2020-05-07 22:39:07 +02:00
for_window [app_id="virt-manager"] focus
2021-05-13 09:21:36 +02:00
assign [app_id="zim"] $tag8
for_window [app_id="zim"] focus
2020-05-07 22:39:07 +02:00
assign [app_id="transmission-gtk"] $tag9
for_window [app_id="transmission-gtk"] focus
assign [app_id="pavucontrol"] $tag10
for_window [app_id="pavucontrol"] focus
2023-06-15 20:26:05 +02:00
assign [app_id="iwgtk"] $tag10
for_window [app_id="iwgtk"] focus
for_window [title="Firefox - Indicateur de partage"] floating enable
2019-12-12 22:54:20 +01:00
# move workspace between screens
bindsym $mod+Prior move workspace to output left
bindsym $mod+Next move workspace to output right
2023-06-10 13:49:04 +02:00
{% include 'hosts/sway/' + ansible_hostname + '/config.j2' ignore missing %}
2021-05-19 23:01:06 +02:00
# exec background apps
2022-09-15 16:19:31 +02:00
# irc client
{% if ansible_distribution == "Archlinux" %}
{% set senpai_bin = "senpai" %}
2022-09-15 16:19:31 +02:00
{% else %}
{% set senpai_bin = "senpai" %}
{% endif %}
2021-05-19 23:01:06 +02:00
# mako
2021-06-02 15:42:39 +02:00
exec_always bash -c "pgrep -x mako || mako"
# wlsunset
#exec_always bash -c "pgrep -x wlsunset || wlsunset -l 43.6 -L 3.9"
# xdg-desktop-portal-wlr
{% if ansible_service_mgr == "systemd" %}
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XAUTHORITY
2022-10-05 12:41:05 +02:00
exec source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
{% else %}
exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
{% endif %}
2021-05-19 23:01:06 +02:00
# exec foreground apps
# variery
exec variety &
2022-09-15 16:19:31 +02:00
# irc client
2022-09-20 09:30:26 +02:00
exec swaymsg 'workspace $tag4; exec kitty bash -c "senpai"'
2021-05-19 23:01:06 +02:00
# waybar exec
exec_always ~/.config/waybar/waybar.sh &
# wob exec
exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob
2022-02-07 10:11:40 +01:00
# mako away
2022-02-07 10:40:17 +01:00
#exec swayidle timeout 30 "makoctl set-mode away" resume "makoctl set-mode default"
2021-05-19 23:01:06 +02:00
# set gtk theme
exec_always ~/.config/sway/import-gsettings
# reload the configuration file
2019-12-12 22:54:20 +01:00
bindsym $mod+Shift+r reload
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym m resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
2021-05-10 15:44:31 +02:00