dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

config (8932B)


      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 
      8 ############################################################
      9 # Startup
     10 
     11 # Configure Xresources settings.
     12 exec xrdb ~/.config/Xresources
     13 
     14 # Launch IME.
     15 exec fcitx5 -d -r
     16 
     17 # Start up Mako notification system
     18 exec mako
     19 
     20 # Set the window title font.
     21 font pango:IPAGothic 10, DejaVu Sans Mono 9 
     22 
     23 
     24 ############################################################
     25 # Variables
     26 
     27 # Logo key. Use Mod1 for Alt.
     28 set $mod Mod4
     29 
     30 # Home row direction keys, like vim.
     31 set $left h
     32 set $down j
     33 set $up k
     34 set $right l
     35 
     36 # Your preferred terminal emulator.
     37 set $term alacritty
     38 
     39 # Your preferred application launcher.
     40 # Note: it's recommended that you pass the final command to sway.
     41 set $menu wofi --show run
     42 
     43 # Set lock screen handler.
     44 set $lock_screen swaylock -f -c 000000
     45 
     46 # Set the suspend command.
     47 set $suspend_display swaymsg "output * dpms off"
     48 set $resume_display swaymsg "output * dpms on"
     49 
     50 
     51 ############################################################
     52 # Idle configuration
     53 
     54 # Lock screen after 600 seconds of inactivity, then turn off displays after
     55 # another 60 seconds, then put the computer to sleep 60 seconds after that.
     56 # Turn screens back on when resumed. Also ensure the screen is locked before
     57 # the computer goes to sleep.
     58 exec swayidle -w \
     59          timeout 600 '$lock_screen' \
     60          timeout 660 '$suspend_display' \
     61          resume '$resume_display' \
     62          before-sleep '$lock_screen'
     63 
     64 ############################################################
     65 # Seat configuration
     66 
     67 # Scale cursor size for high resolution.
     68 seat seat0 xcursor_theme Adwaita 20
     69 
     70 ############################################################
     71 # Output configuration
     72 #
     73 # Example configuration:
     74 #
     75 #   output HDMI-A-1 resolution 1920x1080 position 1920,0
     76 #
     77 # You can get the names of your outputs by running: swaymsg -t get_outputs
     78 
     79 # Default wallpaper (more resolutions in /usr/share/backgrounds/sway/).
     80 output * bg ~/Pictures/Desktops/current.png fill
     81 output DP-2 scale 2
     82 
     83 
     84 ############################################################
     85 # Input configuration
     86 #
     87 # Example configuration:
     88 #
     89 #   input "2:14:SynPS/2_Synaptics_TouchPad" {
     90 #       dwt enabled
     91 #       tap enabled
     92 #       natural_scroll enabled
     93 #       middle_emulation enabled
     94 #   }
     95 #
     96 # You can get the names of your inputs by running: swaymsg -t get_inputs.
     97 # Read `man 5 sway-input` for more information about this section.
     98 
     99 input * {
    100     # Use JP keyboard layout (jp for Japanese layout) use caps as control,
    101     # right alt as AltGr/Compose for accents.
    102     xkb_layout jp
    103     xkb_options ctrl:nocaps,compose:ralt
    104     repeat_delay 500
    105     repeat_rate 25
    106 
    107     # Use natural mouse-wheel scrolling.
    108     natural_scroll enabled
    109 }
    110 
    111 
    112 ############################################################
    113 # Key bindings: Basics
    114 
    115 # Start a terminal.
    116 bindsym $mod+Return exec $term
    117 
    118 # Kill focused window.
    119 bindsym $mod+Shift+q kill
    120 
    121 # Start the launcher.
    122 bindsym $mod+d exec $menu
    123 
    124 # Drag floating windows by holding down $mod and left mouse button.
    125 # Resize them with right mouse button + $mod.
    126 # Despite the name, also works for non-floating windows.
    127 # Change normal to inverse to use left mouse button for resizing and right
    128 # mouse button for dragging.
    129 floating_modifier $mod normal
    130 
    131 # Capture a screenshot.
    132 set $grimshot ~/.local/bin/grimshot
    133 set $screenshots ~/Pictures/Screenshots
    134 bindsym $mod+Shift+s exec $grimshot --notify save screen \
    135     $screenshots/Screenshot_$(date +"%Y-%m-%d_%H.%M.%S.png")
    136 bindsym $mod+Control+Shift+s exec $grimshot --notify save area \
    137     $screenshots/Screenshot_$(date +"%Y-%m-%d_%H.%M.%S.png")
    138 
    139 # Reload the configuration file.
    140 bindsym $mod+Shift+c reload
    141 
    142 # Lock the screen.
    143 bindsym Control+$mod+l exec $lock_screen
    144 
    145 # Exit sway (logs you out of your Wayland session).
    146 bindsym $mod+Shift+e exec ~/.config/sway/exit_check.sh
    147 
    148 
    149 ############################################################
    150 # Key bindings: Volume/Brightness
    151 
    152 # OS-specific behaviour in ~/.local/bin/volumectl script.
    153 set $volume_up volumectl up 5
    154 set $volume_down volumectl down 5
    155 set $volume_toggle_mute volumectl mute
    156 set $volume_toggle_mic_mute volumectl muteinput
    157 
    158 # Increase and decrease volume.
    159 bindsym Control+$mod+F12 exec $volume_up
    160 bindsym Control+$mod+F11 exec $volume_down
    161 
    162 
    163 ############################################################
    164 # Key bindings: Moving around
    165 
    166 # Move your focus around.
    167 bindsym $mod+$left focus left
    168 bindsym $mod+$down focus down
    169 bindsym $mod+$up focus up
    170 bindsym $mod+$right focus right
    171 # Or use $mod+[up|down|left|right].
    172 bindsym $mod+Left focus left
    173 bindsym $mod+Down focus down
    174 bindsym $mod+Up focus up
    175 bindsym $mod+Right focus right
    176 
    177 # Move the focused window with the same, but add Shift
    178 bindsym $mod+Shift+$left move left
    179 bindsym $mod+Shift+$down move down
    180 bindsym $mod+Shift+$up move up
    181 bindsym $mod+Shift+$right move right
    182 # Ditto, with arrow keys
    183 bindsym $mod+Shift+Left move left
    184 bindsym $mod+Shift+Down move down
    185 bindsym $mod+Shift+Up move up
    186 bindsym $mod+Shift+Right move right
    187 
    188 
    189 ############################################################
    190 # Key bindings: Workspaces
    191 
    192 # Switch to workspace.
    193 bindsym $mod+1 workspace 1
    194 bindsym $mod+2 workspace 2
    195 bindsym $mod+3 workspace 3
    196 bindsym $mod+4 workspace 4
    197 bindsym $mod+5 workspace 5
    198 bindsym $mod+6 workspace 6
    199 bindsym $mod+7 workspace 7
    200 bindsym $mod+8 workspace 8
    201 bindsym $mod+9 workspace 9
    202 bindsym $mod+0 workspace 10
    203 
    204 # Move focused container to workspace.
    205 bindsym $mod+Shift+1 move container to workspace 1
    206 bindsym $mod+Shift+2 move container to workspace 2
    207 bindsym $mod+Shift+3 move container to workspace 3
    208 bindsym $mod+Shift+4 move container to workspace 4
    209 bindsym $mod+Shift+5 move container to workspace 5
    210 bindsym $mod+Shift+6 move container to workspace 6
    211 bindsym $mod+Shift+7 move container to workspace 7
    212 bindsym $mod+Shift+8 move container to workspace 8
    213 bindsym $mod+Shift+9 move container to workspace 9
    214 bindsym $mod+Shift+0 move container to workspace 10
    215 
    216 
    217 ############################################################
    218 # Key bindings: Layout
    219 
    220 # You can "split" the current object of your focus with $mod+b or $mod+v, for
    221 # horizontal and vertical splits respectively. This moves focus to the window
    222 # to split; to return focus to the parent container, use $mod+a.
    223 bindsym $mod+b splith
    224 bindsym $mod+v splitv
    225 # Ditto, but with $mod-; and $mod-Shift-;.
    226 bindsym $mod+Shift+semicolon splith
    227 bindsym $mod+semicolon splitv
    228 
    229 # Switch the current container between different layout styles.
    230 bindsym $mod+s layout stacking
    231 bindsym $mod+w layout tabbed
    232 bindsym $mod+e layout toggle split
    233 
    234 # Make the current focus fullscreen.
    235 bindsym $mod+f fullscreen
    236 
    237 # Toggle the current focus between tiling and floating mode.
    238 bindsym $mod+Shift+space floating toggle
    239 
    240 # Swap focus between the tiling area and the floating area.
    241 bindsym $mod+space focus mode_toggle
    242 
    243 # Move focus to the parent container.
    244 bindsym $mod+a focus parent
    245 
    246 
    247 ############################################################
    248 # Key bindings: Scratchpad
    249 #
    250 # Sway has a "scratchpad", which is a bag of holding for windows.
    251 # You can send windows there and get them back later.
    252 # Scratchpad windows are floating, so you can restore them to normal by
    253 # toggling the floating mode.
    254 
    255 # Move the currently focused window to the scratchpad.
    256 bindsym $mod+Shift+minus move scratchpad
    257 
    258 # Show the next scratchpad window or hide the focused scratchpad window.
    259 # If there are multiple scratchpad windows, this command cycles through them.
    260 bindsym $mod+minus scratchpad show
    261 
    262 
    263 ############################################################
    264 # Key bindings: Resizing containers
    265 
    266 mode "resize" {
    267     # Shrink or grow the container's width, height.
    268     bindsym $left resize shrink width 10px
    269     bindsym $down resize shrink height 10px
    270     bindsym $up resize grow height 10px
    271     bindsym $right resize grow width 10px
    272 
    273     # Ditto, with arrow keys.
    274     bindsym Left resize shrink width 10px
    275     bindsym Down resize shrink height 10px
    276     bindsym Up resize grow height 10px
    277     bindsym Right resize grow width 10px
    278 
    279     # Return to default mode on Return or Esc.
    280     bindsym Return mode "default"
    281     bindsym Escape mode "default"
    282 }
    283 bindsym $mod+r mode "resize"
    284 
    285 
    286 ############################################################
    287 # Status Bar
    288 #
    289 # Read `man 5 sway-bar` for more information about this section.
    290 
    291 bar {
    292     position top
    293     pango_markup disabled
    294     font pango:IPAGothic 10, DejaVu Sans Mono 9
    295 
    296     # When the status_command prints a new line to stdout, swaybar updates.
    297     # The default just shows the current date and time.
    298     status_command while ~/.config/sway/custom_statusbar; do sleep 1; done
    299 
    300     colors {
    301         statusline #ffffff
    302         background #323232
    303         inactive_workspace #32323200 #32323200 #5c5c5c
    304     }
    305 }
    306 
    307 include /etc/sway/config.d/*
    308 include ~/.config/sway/config.d/*
    309 include ~/.config/sway/`hostname`