File hierarcy management

Signed-off-by: Jacob Hrbek <kreyren@fsfe.org>
This commit is contained in:
Jacob Hrbek 2021-06-08 19:40:52 +02:00
commit 55ee7f23f0
12 changed files with 182 additions and 0 deletions

3
LICENSE.md Normal file
View File

@ -0,0 +1,3 @@
All rights reserved by Jacob Hrbek <kreyren@fsfe.org> identified using a GPG identifier from OpenPGP.org keyserver <https://keys.openpgp.org> in 08/06/2021-EU 7:31:05 CEST
This license currently mimics GPLv3 <https://www.gnu.org/licenses/gpl-3.0.en.html> with option to be changed at any time

1
README.md Normal file
View File

@ -0,0 +1 @@
Krey's configuration of sway, the tiling WM made for wayland

14
bar/status.sway Normal file
View File

@ -0,0 +1,14 @@
# NOTE(Krey): See `man 5 sway-bar` for more info
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%d/%m/%Y %H:%M:%S %Z'; do sleep 1; done
colors {
statusline #ffffff
background #000000
inactive_workspace #32323200 #32323200 #5c5c5c
}
}

52
config Normal file
View File

@ -0,0 +1,52 @@
# Variables
set {
# Super_L (Meta-Key)
$meta Mod4
# Alt_L (Mesa-Key)
$mesa Mod1
# Modifier (Slightly changes the keybind)
$mod Shift
# Defaults
$term alacritty
$menu dmenu_path | dmenu | xargs swaymsg exec --
$browser firefox
$filemanager thunar
# Moving
$up Up
$down Down
$right Right
$left Left
}
# Enable floating by default
for_window [title=".*"] floating enable
# Remove annoying borders
default_border none
# Scaling
output LVDS-1 resolution 1600x900 scale 0.8
# Allow dragging of windows
floating_modifier $mesa normal
# Bar
include /home/kreyren/.config/sway/bar/status.sway
# Distro - For distribution-specific configs
include /home/kreyren/.config/sway/distro/nixos.sway
# Keybinds
include /home/kreyren/.config/sway/keybinds/admin.sway
include /home/kreyren/.config/sway/keybinds/defaults.sway
include /home/kreyren/.config/sway/keybinds/navigation.sway
include /home/kreyren/.config/sway/keybinds/scratchpad.sway
include /home/kreyren/.config/sway/keybinds/screenshots.sway
# Modes
include /home/kreyren/.config/sway/modes/resize.sway
# DNR(Krey): Figure out how to use $HOME here
include /home/kreyren/.config/sway/config.d/*

1
distro/README.md Normal file
View File

@ -0,0 +1 @@
for distribution specific configuration

1
distro/nixos.sway Symbolic link
View File

@ -0,0 +1 @@
/etc/static/sway/config.d/nixos.conf

8
keybinds/admin.sway Normal file
View File

@ -0,0 +1,8 @@
# Live Reload of config
bindsym $mesa+$mod+r reload
# SIGTERM focused window
bindsym $mesa+F4 Kill
# Exit sway
bindsym $mesa+Escape 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'

9
keybinds/defaults.sway Normal file
View File

@ -0,0 +1,9 @@
# Terminal
bindsym $meta+Return exec $term
# Launcher
bindsym $meta+d exec $menu
# Web Browser
bindsym $meta+t exec $browser
bindsym $meta+$mod+t exec tor-browser

64
keybinds/navigation.sway Normal file
View File

@ -0,0 +1,64 @@
bindsym {
# Navigation across windows
$meta+$up focus up
$meta+$down focus down
$meta+$left focus left
$meta+$right focus right
# Move the focused window
$meta+$mod+$up move up
$meta+$mod+$down move down
$meta+$mod+$left move left
$meta+$mod+$right move right
### WORKSPACES ###
# Change workspace
$meta+1 workspace number 1
$meta+2 workspace number 2
$meta+3 workspace number 3
$meta+4 workspace number 4
$meta+5 workspace number 5
$meta+6 workspace number 6
$meta+7 workspace number 7
$meta+8 workspace number 8
$meta+9 workspace number 9
$meta+0 workspace number 10
# Move focused container to workspace
$meta+$mod+1 move container to workspace number 1
$meta+$mod+2 move container to workspace number 2
$meta+$mod+3 move container to workspace number 3
$meta+$mod+4 move container to workspace number 4
$meta+$mod+5 move container to workspace number 5
$meta+$mod+6 move container to workspace number 6
$meta+$mod+7 move container to workspace number 7
$meta+$mod+8 move container to workspace number 8
$meta+$mod+9 move container to workspace number 9
$meta+$mod+0 move container to workspace number 10
### LAYOUT ###
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
$meta+b splith
$meta+v splitv
# Switch the current container between different layout styles
$meta+s layout stacking
$meta+w layout tabbed
$meta+e layout toggle split
# Make the current focus fullscreen
$meta+f fullscreen
# Toggle the current focus between tiling and floating mode
$meta+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
$meta+space focus mode_toggle
# Move focus to the parent container
$meta+a focus parent
}

9
keybinds/scratchpad.sway Normal file
View File

@ -0,0 +1,9 @@
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $meta+h move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mesa+Tab scratchpad show

5
keybinds/screnshots.sway Normal file
View File

@ -0,0 +1,5 @@
# Screenshot
## Full screen
bindsym print exec grim | wl-copy
## Area
bindsym $mod+print exec grim -g "$(slurp)" - | wl-copy

15
modes/resize.sway Normal file
View File

@ -0,0 +1,15 @@
# Resizing "containers"
mode "resize" {
bindsym {
$up resize shrink height 10px
$down resize grow height 10px
$left resize shrink width 10px
$right resize grow width 10px
# Return to default mode
Return mode "default"
Escape mode "default"
}
}
bindsym $meta+r mode "resize"