From 55ee7f23f084cf9b893dec63b35b6d0941cd895c Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Tue, 8 Jun 2021 19:40:52 +0200 Subject: [PATCH] File hierarcy management Signed-off-by: Jacob Hrbek --- LICENSE.md | 3 ++ README.md | 1 + bar/status.sway | 14 +++++++++ config | 52 ++++++++++++++++++++++++++++++++ distro/README.md | 1 + distro/nixos.sway | 1 + keybinds/admin.sway | 8 +++++ keybinds/defaults.sway | 9 ++++++ keybinds/navigation.sway | 64 ++++++++++++++++++++++++++++++++++++++++ keybinds/scratchpad.sway | 9 ++++++ keybinds/screnshots.sway | 5 ++++ modes/resize.sway | 15 ++++++++++ 12 files changed, 182 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 bar/status.sway create mode 100644 config create mode 100644 distro/README.md create mode 120000 distro/nixos.sway create mode 100644 keybinds/admin.sway create mode 100644 keybinds/defaults.sway create mode 100644 keybinds/navigation.sway create mode 100644 keybinds/scratchpad.sway create mode 100644 keybinds/screnshots.sway create mode 100644 modes/resize.sway diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cd8111b --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,3 @@ +All rights reserved by Jacob Hrbek identified using a GPG identifier from OpenPGP.org keyserver in 08/06/2021-EU 7:31:05 CEST + +This license currently mimics GPLv3 with option to be changed at any time \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6693f2d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Krey's configuration of sway, the tiling WM made for wayland \ No newline at end of file diff --git a/bar/status.sway b/bar/status.sway new file mode 100644 index 0000000..f70bb2d --- /dev/null +++ b/bar/status.sway @@ -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 + } +} \ No newline at end of file diff --git a/config b/config new file mode 100644 index 0000000..b513b67 --- /dev/null +++ b/config @@ -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/* \ No newline at end of file diff --git a/distro/README.md b/distro/README.md new file mode 100644 index 0000000..dc0c7d0 --- /dev/null +++ b/distro/README.md @@ -0,0 +1 @@ +for distribution specific configuration \ No newline at end of file diff --git a/distro/nixos.sway b/distro/nixos.sway new file mode 120000 index 0000000..a514159 --- /dev/null +++ b/distro/nixos.sway @@ -0,0 +1 @@ +/etc/static/sway/config.d/nixos.conf \ No newline at end of file diff --git a/keybinds/admin.sway b/keybinds/admin.sway new file mode 100644 index 0000000..eb9c13f --- /dev/null +++ b/keybinds/admin.sway @@ -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' \ No newline at end of file diff --git a/keybinds/defaults.sway b/keybinds/defaults.sway new file mode 100644 index 0000000..a93ed95 --- /dev/null +++ b/keybinds/defaults.sway @@ -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 \ No newline at end of file diff --git a/keybinds/navigation.sway b/keybinds/navigation.sway new file mode 100644 index 0000000..c60c5ba --- /dev/null +++ b/keybinds/navigation.sway @@ -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 +} \ No newline at end of file diff --git a/keybinds/scratchpad.sway b/keybinds/scratchpad.sway new file mode 100644 index 0000000..aec8464 --- /dev/null +++ b/keybinds/scratchpad.sway @@ -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 \ No newline at end of file diff --git a/keybinds/screnshots.sway b/keybinds/screnshots.sway new file mode 100644 index 0000000..89b769c --- /dev/null +++ b/keybinds/screnshots.sway @@ -0,0 +1,5 @@ +# Screenshot +## Full screen +bindsym print exec grim | wl-copy +## Area +bindsym $mod+print exec grim -g "$(slurp)" - | wl-copy \ No newline at end of file diff --git a/modes/resize.sway b/modes/resize.sway new file mode 100644 index 0000000..a987bff --- /dev/null +++ b/modes/resize.sway @@ -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" \ No newline at end of file