dotfiles

My personal dotfiles
git clone https://codeberg.org/emmett1/dotfiles
Log | Files | Refs

config (5474B)


      1 #   _____ _ _ _ _____ __ __ 
      2 #  |   __| | | |  _  |  |  |
      3 #  |__   | | | |     |_   _|
      4 #  |_____|_____|__|__| |_|  
      5 #                         
      6 #  sway config - by emmett1
      7 #
      8 
      9 set $mod   Mod1
     10 set $super Mod4
     11 set $left  h
     12 set $down  j
     13 set $up    k
     14 set $right l
     15 set $term  footclient
     16 set $web   librewolf
     17 
     18 # --- colours ---
     19 set $colour1 #141c21
     20 set $colour2 #93a1a1
     21 set $colour3 #808080
     22 set $alpha   ff
     23 
     24 # --- font ---
     25 set $font pango:Monospace 8
     26 
     27 # --- config ---
     28 default_border none
     29 client.focused $colour1 $colour1 $colour1 $colour1 $colour1
     30 gaps inner 10
     31 floating_modifier $mod normal
     32 
     33 # --- startup ---
     34 exec {
     35 	foot -s
     36 	dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus
     37 	swaybg -c 353535
     38 	
     39 	# turn off screen when idle
     40 	swayidle -w \
     41 		timeout 900 'swaymsg "output * power off"' \
     42 		resume 'swaymsg "output * power on"'
     43 }
     44 
     45 # --- touchpad ---
     46 input "type:touchpad" {
     47     dwt enabled
     48     dwtp enabled
     49     tap enabled
     50     tap_button_map lrm
     51 	natural_scroll enabled
     52 }
     53 
     54 # --- keybindings ---
     55 bindsym {
     56 	# tiling foot
     57 	$mod+Return exec $term
     58     
     59 	# floating foot
     60 	$mod+Shift+Return exec $term -a 'floatingfoot'
     61     
     62 	# other programs shortcut
     63 	$mod+w exec $web
     64 	$mod+e exec geany
     65 	
     66 	# floating terms programs
     67 	$mod+a   exec $term -a 'filemanager'  shfm
     68 	$super+v exec $term -a 'floatingfoot' alsamixer
     69 	$super+h exec $term -a 'floatingfoot' htop
     70 	
     71 	$mod+control+Right workspace next
     72 	$mod+control+Left  workspace prev
     73 	
     74 	# alsa
     75 	XF86AudioRaiseVolume exec amixer -Mq set Speaker 5%+
     76 	XF86AudioLowerVolume exec amixer -Mq set Speaker 5%-
     77 	
     78 	# screenshot
     79 	$mod+shift+s exec GRIM_DEFAULT_DIR=~/pictures grim -t jpeg -q 100
     80 	
     81 	# Kill focused window
     82 	$mod+Shift+c kill
     83 
     84 	# Start your launcher
     85 	$mod+p exec wmenu-run -f 'monospace 8' -N 141c21 -S 141c21 -s 819400
     86 
     87 	# Reload the configuration file
     88 	$mod+Shift+r reload
     89 
     90 	# Exit sway (logs you out of your Wayland session)
     91 	$mod+Shift+q 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'
     92 
     93 	# switch workspace back and forth
     94 	$mod+tab workspace back_and_forth
     95 
     96 	# Move your focus around
     97 	$mod+$left focus left
     98 	$mod+$down focus down
     99 	$mod+$up focus up
    100 	$mod+$right focus right
    101 	# Or use $mod+[up|down|left|right]
    102 	$mod+Left focus left
    103 	$mod+Down focus down
    104 	$mod+Up focus up
    105 	$mod+Right focus right
    106 
    107 	# Move the focused window with the same, but add Shift
    108 	$mod+Shift+$left move left
    109 	$mod+Shift+$down move down
    110 	$mod+Shift+$up move up
    111 	$mod+Shift+$right move right
    112 	# Ditto, with arrow keys
    113 	$mod+Shift+Left move left
    114 	$mod+Shift+Down move down
    115 	$mod+Shift+Up move up
    116 	$mod+Shift+Right move right
    117 
    118 	# Switch to workspace
    119 	$mod+1 workspace 1
    120 	$mod+2 workspace 2
    121 	$mod+3 workspace 3
    122 	$mod+4 workspace 4
    123 	$mod+5 workspace 5
    124 	$mod+6 workspace 6
    125 	$mod+7 workspace 7
    126 	$mod+8 workspace 8
    127 	$mod+9 workspace 9
    128 	# Move focused container to workspace
    129 	$mod+Shift+1 move container to workspace 1
    130 	$mod+Shift+2 move container to workspace 2
    131 	$mod+Shift+3 move container to workspace 3
    132 	$mod+Shift+4 move container to workspace 4
    133 	$mod+Shift+5 move container to workspace 5
    134 	$mod+Shift+6 move container to workspace 6
    135 	$mod+Shift+7 move container to workspace 7
    136 	$mod+Shift+8 move container to workspace 8
    137 	$mod+Shift+9 move container to workspace 9
    138 
    139 	# container split
    140 	$mod+b splith
    141 	$mod+v splitv
    142 
    143 	# Make the current focus fullscreen
    144 	$mod+f fullscreen
    145 
    146 	# Toggle the current focus between tiling and floating mode
    147 	$mod+Shift+space floating toggle
    148 
    149 	# Swap focus between the tiling area and the floating area
    150 	$mod+space focus mode_toggle
    151 }
    152 
    153 # --- floating windows ---
    154 # swaymsg -t get_tree | grep "app_id"
    155 for_window {
    156 	[app_id="floatingfoot"] floating enable
    157 	[app_id="alsamixer"]    floating enable
    158 	[app_id="mpv"]          floating enable
    159 	[app_id="imv"]          floating enable
    160 	[app_id="qemu"]         floating enable
    161 	[app_id="gcolor3"]      floating enable
    162 	[title = "About Mozilla Firefox"]    floating enable
    163 	[app_id="firefox" title="Library"]   floating enable, border pixel 1, sticky enable
    164 	[title = "About LibreWolf"]          floating enable
    165 	[app_id="librewolf" title="Library"] floating enable, border pixel 1, sticky enable
    166 }
    167 
    168 # --- assign workspace ---
    169 assign {
    170 	[app_id="firefox"]     2
    171 	[app_id="librewolf"]   2
    172 	[app_id="filemanager"] 3
    173 	[app_id="geany"]       4
    174 }
    175 
    176 # --- resizing container ---
    177 mode "resize" {
    178     # left will shrink the containers width
    179     # right will grow the containers width
    180     # up will shrink the containers height
    181     # down will grow the containers height
    182     bindsym $left resize shrink width 10px
    183     bindsym $down resize grow height 10px
    184     bindsym $up resize shrink height 10px
    185     bindsym $right resize grow width 10px
    186 
    187     # Ditto, with arrow keys
    188     bindsym Left resize shrink width 10px
    189     bindsym Down resize grow height 10px
    190     bindsym Up resize shrink height 10px
    191     bindsym Right resize grow width 10px
    192 
    193     # Return to default mode
    194     bindsym Return mode "default"
    195     bindsym Escape mode "default"
    196 }
    197 bindsym $mod+r mode "resize"
    198 
    199 # --- statusbar ---
    200 bar {
    201     position top
    202     font $font
    203 
    204     status_command while sh $HOME/.config/sway/statusbar.sh; do sleep 1; done
    205 
    206     colors {
    207         statusline $colour2
    208         background $colour1$alpha
    209         #                     border        background     text
    210         focused_workspace  $colour1$alpha $colour1$alpha $colour2
    211         inactive_workspace $colour1$alpha $colour1$alpha $colour3
    212     }
    213 }