dotfiles

Dash Eclipse's dotfiles
git clone git://ezup.dev/dotfiles.git
Log | Files | Refs | README | LICENSE

config (11244B)


      1# Default config for sway
      2#
      3# Copy this to ~/.config/sway/config and edit it to your liking.
      4#
      5# Read `man 5 sway` for a complete reference.
      6
      7### Variables
      8#
      9# Logo key. Use Mod1 for Alt.
     10set $mod Mod4
     11# Home row direction keys, like vim
     12set $left h
     13set $down j
     14set $up k
     15set $right l
     16# Your preferred terminal emulator
     17set $term foot
     18# Your preferred application launcher
     19# Note: pass the final command to swaymsg so that the resulting window can be opened
     20# on the original workspace that the command was run on.
     21#set $menu dmenu_path | dmenu | xargs swaymsg exec --
     22# https://git.suckless.org/dmenu/file/config.def.h.html
     23set $menu bemenu-run -p '' -P '' --hf '#eeeeee' --hb '#005577' -H23
     24
     25### Output configuration
     26#
     27# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
     28set $wallpaper_path $HOME/Pictures/Wallpapers/Landscape
     29output * bg `find $wallpaper_path -type f | shuf -n1` fill
     30# output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
     31#
     32# Example configuration:
     33#
     34#   output HDMI-A-1 resolution 1920x1080 position 1920,0
     35#
     36# You can get the names of your outputs by running: swaymsg -t get_outputs
     37#output HDMI-A-1 position 0,0
     38#output HDMI-A-1 resolution 1440x900 position 0,0
     39#output VGA-1 resolution 1440x900 position 1440,0
     40#
     41#output VGA-1 resolution 1440x900 position 0,0
     42#output HDMI-A-1 resolution 1440x900 position 1440,0
     43output VGA-1 resolution 1440x900 position 0,180
     44output HDMI-A-1 resolution 1920x1080 position 1440,0
     45
     46### Idle configuration
     47#
     48# Example configuration:
     49#
     50# exec swayidle -w \
     51#          timeout 300 'swaylock -f -c 000000' \
     52#          timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
     53#          before-sleep 'swaylock -f -c 000000'
     54#
     55# This will lock your screen after 300 seconds of inactivity, then turn off
     56# your displays after another 300 seconds, and turn your screens back on when
     57# resumed. It will also lock your screen before your computer goes to sleep.
     58exec swayidle -w \
     59    timeout 300 'swaylock -f -c 00000066' \
     60    timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
     61    before-sleep 'swaylock -f -c 00000066'
     62
     63### Input configuration
     64#
     65# Example configuration:
     66#
     67#   input "2:14:SynPS/2_Synaptics_TouchPad" {
     68#       dwt enabled
     69#       tap enabled
     70#       natural_scroll enabled
     71#       middle_emulation enabled
     72#   }
     73#
     74# You can get the names of your inputs by running: swaymsg -t get_inputs
     75# Read `man 5 sway-input` for more information about this section.
     76input * {
     77    xkb_layout "us"
     78    xkb_variant "dvp"
     79}
     80
     81### Key bindings
     82#
     83# Basics:
     84#
     85    # Start a terminal
     86    bindsym $mod+Return exec $term
     87
     88    # Kill focused window
     89    bindsym $mod+Shift+q kill
     90
     91    # Start your launcher
     92    bindsym $mod+d exec $menu
     93
     94    # Drag floating windows by holding down $mod and left mouse button.
     95    # Resize them with right mouse button + $mod.
     96    # Despite the name, also works for non-floating windows.
     97    # Change normal to inverse to use left mouse button for resizing and right
     98    # mouse button for dragging.
     99    floating_modifier $mod normal
    100
    101    # Reload the configuration file
    102    bindsym $mod+Shift+c reload
    103
    104    # Exit sway (logs you out of your Wayland session)
    105    bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
    106#
    107# Moving around:
    108#
    109    # Move your focus around
    110    bindsym $mod+$left focus left
    111    bindsym $mod+$down focus down
    112    bindsym $mod+$up focus up
    113    bindsym $mod+$right focus right
    114    # Or use $mod+[up|down|left|right]
    115    bindsym $mod+Left focus left
    116    bindsym $mod+Down focus down
    117    bindsym $mod+Up focus up
    118    bindsym $mod+Right focus right
    119
    120    # Move the focused window with the same, but add Shift
    121    bindsym $mod+Shift+$left move left
    122    bindsym $mod+Shift+$down move down
    123    bindsym $mod+Shift+$up move up
    124    bindsym $mod+Shift+$right move right
    125    # Ditto, with arrow keys
    126    bindsym $mod+Shift+Left move left
    127    bindsym $mod+Shift+Down move down
    128    bindsym $mod+Shift+Up move up
    129    bindsym $mod+Shift+Right move right
    130#
    131# Workspaces:
    132#
    133set $ws1 1:7
    134set $ws2 2:5
    135set $ws3 3:3
    136set $ws4 4:1
    137set $ws5 5:9
    138set $ws6 6:0
    139set $ws7 7:2
    140set $ws8 8:4
    141set $ws9 9:6
    142set $ws10 10:8
    143    # switch to workspace
    144    bindsym $mod+bracketleft workspace $ws1
    145    bindsym $mod+braceleft workspace $ws2
    146    bindsym $mod+braceright workspace $ws3
    147    bindsym $mod+parenleft workspace $ws4
    148    bindsym $mod+equal workspace $ws5
    149    bindsym $mod+asterisk workspace $ws6
    150    bindsym $mod+parenright workspace $ws7
    151    bindsym $mod+plus workspace $ws8
    152    bindsym $mod+bracketright workspace $ws9
    153    bindsym $mod+exclam workspace $ws10
    154
    155    # move focused container to workspace
    156    bindsym $mod+Shift+bracketleft move container to workspace $ws1
    157    bindsym $mod+Shift+braceleft move container to workspace $ws2
    158    bindsym $mod+Shift+braceright move container to workspace $ws3
    159    bindsym $mod+Shift+parenleft move container to workspace $ws4
    160    bindsym $mod+Shift+equal move container to workspace $ws5
    161    bindsym $mod+Shift+asterisk move container to workspace $ws6
    162    bindsym $mod+Shift+parenright move container to workspace $ws7
    163    bindsym $mod+Shift+plus move container to workspace $ws8
    164    bindsym $mod+Shift+bracketright move container to workspace $ws9
    165    bindsym $mod+Shift+exclam move container to workspace $ws10
    166
    167# Layout stuff:
    168#
    169    # You can "split" the current object of your focus with
    170    # $mod+b or $mod+v, for horizontal and vertical splits
    171    # respectively.
    172    bindsym $mod+b splith
    173    bindsym $mod+v splitv
    174
    175    # Switch the current container between different layout styles
    176    bindsym $mod+s layout stacking
    177    bindsym $mod+w layout tabbed
    178    bindsym $mod+e layout toggle split
    179
    180    # Make the current focus fullscreen
    181    bindsym $mod+f fullscreen
    182
    183    # Toggle the current focus between tiling and floating mode
    184    bindsym $mod+Shift+space floating toggle
    185
    186    # Swap focus between the tiling area and the floating area
    187    bindsym $mod+space focus mode_toggle
    188
    189    # Move focus to the parent container
    190    bindsym $mod+a focus parent
    191#
    192# Scratchpad:
    193#
    194    # Sway has a "scratchpad", which is a bag of holding for windows.
    195    # You can send windows there and get them back later.
    196
    197    # Move the currently focused window to the scratchpad
    198    bindsym $mod+Shift+minus move scratchpad
    199
    200    # Show the next scratchpad window or hide the focused scratchpad window.
    201    # If there are multiple scratchpad windows, this command cycles through them.
    202    bindsym $mod+minus scratchpad show
    203#
    204# Resizing containers:
    205#
    206mode "resize" {
    207    # left will shrink the containers width
    208    # right will grow the containers width
    209    # up will shrink the containers height
    210    # down will grow the containers height
    211    bindsym $left resize shrink width 10px
    212    bindsym $down resize grow height 10px
    213    bindsym $up resize shrink height 10px
    214    bindsym $right resize grow width 10px
    215
    216    # Ditto, with arrow keys
    217    bindsym Left resize shrink width 10px
    218    bindsym Down resize grow height 10px
    219    bindsym Up resize shrink height 10px
    220    bindsym Right resize grow width 10px
    221
    222    # Return to default mode
    223    bindsym Return mode "default"
    224    bindsym Escape mode "default"
    225}
    226bindsym $mod+r mode "resize"
    227
    228#
    229# Status Bar:
    230#
    231# Read `man 5 sway-bar` for more information about this section.
    232bar {
    233    position top
    234
    235    # When the status_command prints a new line to stdout, swaybar updates.
    236    # The default just shows the current date and time.
    237    # status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
    238    status_command ~/.config/sway/status-simple.sh
    239
    240    strip_workspace_numbers yes
    241
    242    tray_padding 4
    243
    244    colors {
    245        statusline #c8ccd4
    246        background #1e222a
    247	focused_workspace #1a73e8 #1a73e8 #eeeeee
    248	active_workspace #7986cb #626ca4 #eeeeee
    249        inactive_workspace #424242 #424242 #e0e0e0
    250    }
    251}
    252
    253include /etc/sway/config.d/*
    254
    255# Extra
    256# xwayland disable
    257
    258# client.focused #0079d3 #0079d3 #ffffff #2e9ef4 #0079d3
    259client.focused #0079d3 #0079d3 #ffffff #2e9ef4 #0079d3
    260client.unfocused #545862 #2e3440 #c8ccd4 #292d2e #434c5e
    261client.focused_inactive #7986cb #7986cb #c8ccd4 #2e9ef4 #7986cb
    262default_border pixel 3
    263# hide_edge_borders smart
    264assign [app_id="firefox-wayland"] workspace $ws8
    265assign [app_id="^appimagekit_.+-Telegram_Desktop$"] workspace $ws3
    266
    267bindsym $mod+Print exec grim -g "$(slurp)" - | wl-copy -t image/png
    268bindsym $mod+Ctrl+Print exec swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp - | grim -g - - | wl-copy -t image/png
    269bindsym $mod+Shift+Print exec grim -o "$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name')" - | wl-copy -t image/png
    270
    271# Windows
    272# swaymsg -t get_tree
    273for_window [class="scrcpy"] floating enable
    274for_window [class="Tk"] floating enable
    275for_window [class="Toplevel"] floating enable
    276for_window [app_id="Thunar"] floating enable
    277for_window [app_id="electrum"] floating enable
    278# Instant Messaging
    279#for_window [class="TelegramDesktop"] floating enable
    280for_window [title="TelegramDesktop" app_id="^appimagekit_.+-Telegram_Desktop"] floating enable
    281for_window [class="uTox"] floating enable
    282for_window [class="utoxvideo"] floating enable
    283for_window [class="DeltaChat"] floating enable
    284# Multimedia
    285for_window [class="Gimp"] floating enable
    286for_window [class="feh"] floating enable
    287for_window [app_id="imv"] floating enable
    288for_window [app_id="mpv"] floating enable
    289for_window [class="Spotify"] floating enable, resize grow width 750 px, resize grow height 300 px
    290# Ebook Readers
    291#for_window [app_id="com.github.johnfactotum.Foliate"] floating enable, resize set width 1430 px height 960 px, move left 200 px
    292#for_window [class="EDRLab.ThoriumReader"] floating enable
    293for_window [app_id="org.pwmt.zathura"] floating enable, resize set width 1440 px height 960 px
    294for_window [class="MuPDF"] floating enable
    295# Browser
    296for_window [app_id="firefox" title="^Picture-in-Picture$"] floating enable, sticky enable, move window to output VGA-1
    297for_window [app_id="firefox" title="^Firefox - Choose User Profile$"] floating enable
    298for_window [app_id="firefox" title="^About Mozilla Firefox$"] floating enable
    299
    300# multi-head
    301bindsym $mod+tab workspace back_and_forth
    302#workspace $ws1 output HDMI-A-1
    303#workspace $ws2 output HDMI-A-1
    304#workspace $ws3 output HDMI-A-1
    305#workspace $ws4 output HDMI-A-1
    306#workspace $ws5 output VGA-1
    307#workspace $ws6 output VGA-1
    308#workspace $ws7 output VGA-1
    309#workspace $ws8 output VGA-1
    310#workspace $ws9 output VGA-1
    311#workspace $ws10 output VGA-1
    312workspace $ws1 output VGA-1
    313workspace $ws2 output VGA-1
    314workspace $ws3 output VGA-1
    315workspace $ws4 output VGA-1
    316workspace $ws5 output HDMI-A-1
    317workspace $ws6 output HDMI-A-1
    318workspace $ws7 output HDMI-A-1
    319workspace $ws8 output HDMI-A-1
    320workspace $ws9 output HDMI-A-1
    321workspace $ws10 output HDMI-A-1
    322focus output HDMI-A-1
    323focus_follows_mouse no
    324#gaps outer 2
    325#gaps inner 6
    326bindsym $mod+Alt+l exec swaylock -f -c 00000066
    327
    328exec dbus-update-activation-environment WAYLAND_DISPLAY
    329exec --no-startup-id swaymsg workspace $ws7
    330exec --no-startup-id swaymsg workspace $ws2