dotfiles

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

config (9716B)


      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'
     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
     37output 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### Idle configuration
     42#
     43# Example configuration:
     44#
     45# exec swayidle -w \
     46#          timeout 300 'swaylock -f -c 000000' \
     47#          timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
     48#          before-sleep 'swaylock -f -c 000000'
     49#
     50# This will lock your screen after 300 seconds of inactivity, then turn off
     51# your displays after another 300 seconds, and turn your screens back on when
     52# resumed. It will also lock your screen before your computer goes to sleep.
     53exec swayidle -w \
     54    timeout 300 'swaylock -f -c 00000066' \
     55    timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
     56    before-sleep 'swaylock -f -c 00000066'
     57
     58### Input configuration
     59#
     60# Example configuration:
     61#
     62#   input "2:14:SynPS/2_Synaptics_TouchPad" {
     63#       dwt enabled
     64#       tap enabled
     65#       natural_scroll enabled
     66#       middle_emulation enabled
     67#   }
     68#
     69# You can get the names of your inputs by running: swaymsg -t get_inputs
     70# Read `man 5 sway-input` for more information about this section.
     71input * {
     72    xkb_layout "us"
     73    xkb_variant "dvp"
     74}
     75
     76### Key bindings
     77#
     78# Basics:
     79#
     80    # Start a terminal
     81    bindsym $mod+Return exec $term
     82
     83    # Kill focused window
     84    bindsym $mod+Shift+q kill
     85
     86    # Start your launcher
     87    bindsym $mod+d exec $menu
     88
     89    # Drag floating windows by holding down $mod and left mouse button.
     90    # Resize them with right mouse button + $mod.
     91    # Despite the name, also works for non-floating windows.
     92    # Change normal to inverse to use left mouse button for resizing and right
     93    # mouse button for dragging.
     94    floating_modifier $mod normal
     95
     96    # Reload the configuration file
     97    bindsym $mod+Shift+c reload
     98
     99    # Exit sway (logs you out of your Wayland session)
    100    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'
    101#
    102# Moving around:
    103#
    104    # Move your focus around
    105    bindsym $mod+$left focus left
    106    bindsym $mod+$down focus down
    107    bindsym $mod+$up focus up
    108    bindsym $mod+$right focus right
    109    # Or use $mod+[up|down|left|right]
    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
    115    # Move the focused window with the same, but add Shift
    116    bindsym $mod+Shift+$left move left
    117    bindsym $mod+Shift+$down move down
    118    bindsym $mod+Shift+$up move up
    119    bindsym $mod+Shift+$right move right
    120    # Ditto, with arrow keys
    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#
    126# Workspaces:
    127#
    128set $ws1 1:7
    129set $ws2 2:5
    130set $ws3 3:3
    131set $ws4 4:1
    132set $ws5 5:9
    133set $ws6 6:0
    134set $ws7 7:2
    135set $ws8 8:4
    136set $ws9 9:6
    137set $ws10 10:8
    138    # switch to workspace
    139    bindsym $mod+bracketleft workspace $ws1
    140    bindsym $mod+braceleft workspace $ws2
    141    bindsym $mod+braceright workspace $ws3
    142    bindsym $mod+parenleft workspace $ws4
    143    bindsym $mod+equal workspace $ws5
    144    bindsym $mod+asterisk workspace $ws6
    145    bindsym $mod+parenright workspace $ws7
    146    bindsym $mod+plus workspace $ws8
    147    bindsym $mod+bracketright workspace $ws9
    148    bindsym $mod+exclam workspace $ws10
    149
    150    # move focused container to workspace
    151    bindsym $mod+Shift+bracketleft move container to workspace $ws1
    152    bindsym $mod+Shift+braceleft move container to workspace $ws2
    153    bindsym $mod+Shift+braceright move container to workspace $ws3
    154    bindsym $mod+Shift+parenleft move container to workspace $ws4
    155    bindsym $mod+Shift+equal move container to workspace $ws5
    156    bindsym $mod+Shift+asterisk move container to workspace $ws6
    157    bindsym $mod+Shift+parenright move container to workspace $ws7
    158    bindsym $mod+Shift+plus move container to workspace $ws8
    159    bindsym $mod+Shift+bracketright move container to workspace $ws9
    160    bindsym $mod+Shift+exclam move container to workspace $ws10
    161
    162# Layout stuff:
    163#
    164    # You can "split" the current object of your focus with
    165    # $mod+b or $mod+v, for horizontal and vertical splits
    166    # respectively.
    167    bindsym $mod+b splith
    168    bindsym $mod+v splitv
    169
    170    # Switch the current container between different layout styles
    171    bindsym $mod+s layout stacking
    172    bindsym $mod+w layout tabbed
    173    bindsym $mod+e layout toggle split
    174
    175    # Make the current focus fullscreen
    176    bindsym $mod+f fullscreen
    177
    178    # Toggle the current focus between tiling and floating mode
    179    bindsym $mod+Shift+space floating toggle
    180
    181    # Swap focus between the tiling area and the floating area
    182    bindsym $mod+space focus mode_toggle
    183
    184    # Move focus to the parent container
    185    bindsym $mod+a focus parent
    186#
    187# Scratchpad:
    188#
    189    # Sway has a "scratchpad", which is a bag of holding for windows.
    190    # You can send windows there and get them back later.
    191
    192    # Move the currently focused window to the scratchpad
    193    bindsym $mod+Shift+minus move scratchpad
    194
    195    # Show the next scratchpad window or hide the focused scratchpad window.
    196    # If there are multiple scratchpad windows, this command cycles through them.
    197    bindsym $mod+minus scratchpad show
    198#
    199# Resizing containers:
    200#
    201mode "resize" {
    202    # left will shrink the containers width
    203    # right will grow the containers width
    204    # up will shrink the containers height
    205    # down will grow the containers height
    206    bindsym $left resize shrink width 10px
    207    bindsym $down resize grow height 10px
    208    bindsym $up resize shrink height 10px
    209    bindsym $right resize grow width 10px
    210
    211    # Ditto, with arrow keys
    212    bindsym Left resize shrink width 10px
    213    bindsym Down resize grow height 10px
    214    bindsym Up resize shrink height 10px
    215    bindsym Right resize grow width 10px
    216
    217    # Return to default mode
    218    bindsym Return mode "default"
    219    bindsym Escape mode "default"
    220}
    221bindsym $mod+r mode "resize"
    222
    223#
    224# Status Bar:
    225#
    226# Read `man 5 sway-bar` for more information about this section.
    227bar {
    228    position top
    229
    230    # When the status_command prints a new line to stdout, swaybar updates.
    231    # The default just shows the current date and time.
    232    # status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
    233    status_command ~/.config/sway/status-click-notify.sh
    234
    235    strip_workspace_numbers yes
    236
    237    tray_padding 4
    238
    239    colors {
    240        statusline #c8ccd4
    241        background #1e222a
    242	focused_workspace #1a73e8 #1a73e8 #eeeeee
    243	active_workspace #7986cb #626ca4 #eeeeee
    244        inactive_workspace #424242 #424242 #e0e0e0
    245    }
    246}
    247
    248include /etc/sway/config.d/*
    249
    250# Extra
    251xwayland disable
    252
    253# client.focused #0079d3 #0079d3 #ffffff #2e9ef4 #0079d3
    254client.focused #0079d3 #0079d3 #ffffff #2e9ef4 #0079d3
    255client.unfocused #545862 #2e3440 #c8ccd4 #292d2e #434c5e
    256client.focused_inactive #7986cb #7986cb #c8ccd4 #2e9ef4 #7986cb
    257default_border pixel 3
    258# hide_edge_borders smart
    259assign [app_id="firefox-wayland"] workspace $ws2
    260assign [app_id="telegramdesktop"] workspace $ws3
    261
    262bindsym $mod+Print exec grim -g "$(slurp)" - | wl-copy -t image/png
    263bindsym $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
    264bindsym $mod+Shift+Print exec grim -o "$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name')" - | wl-copy -t image/png
    265# Windows
    266# swaymsg -t get_tree
    267for_window [class="Gimp"] floating enable
    268for_window [class="TelegramDesktop"] floating enable
    269for_window [class="uTox"] floating enable
    270for_window [class="utoxvideo"] floating enable
    271for_window [class="scrcpy"] floating enable
    272for_window [class="DeltaChat"] floating enable
    273for_window [class="feh"] floating enable
    274for_window [app_id="imv"] floating enable
    275for_window [app_id="mpv"] floating enable
    276for_window [app_id="Thunar"] floating enable
    277
    278# multi-head
    279bindsym $mod+tab workspace back_and_forth
    280workspace $ws1 output HDMI-A-1
    281workspace $ws2 output HDMI-A-1
    282workspace $ws3 output HDMI-A-1
    283workspace $ws4 output HDMI-A-1
    284workspace $ws5 output VGA-1
    285workspace $ws6 output VGA-1
    286workspace $ws7 output VGA-1
    287workspace $ws8 output VGA-1
    288workspace $ws9 output VGA-1
    289workspace $ws10 output VGA-1
    290focus output HDMI-A-1
    291focus_follows_mouse no
    292#gaps outer 2
    293#gaps inner 6
    294bindsym $mod+Alt+l exec swaylock -f -c 00000066
    295
    296exec dbus-update-activation-environment WAYLAND_DISPLAY
    297exec --no-startup-id swaymsg workspace $ws7
    298exec --no-startup-id swaymsg workspace $ws2