From efcc733dfe2e151f68e93181457a02df89448eef Mon Sep 17 00:00:00 2001 From: pancakes Date: Sun, 1 Oct 2023 00:56:19 +1000 Subject: [PATCH] Replace River with Sway --- greetd.toml | 2 +- install.sh | 2 +- kanshi/.config/kanshi/config | 7 + river/.config/river/init | 175 -------------------- sway/.config/sway/config | 183 +++++++++++++++++++++ way-displays/.config/way-displays/cfg.yaml | 66 -------- waybar/.config/waybar/config | 5 +- waybar/.config/waybar/style.css | 25 --- 8 files changed, 193 insertions(+), 272 deletions(-) create mode 100644 kanshi/.config/kanshi/config delete mode 100755 river/.config/river/init create mode 100644 sway/.config/sway/config delete mode 100644 way-displays/.config/way-displays/cfg.yaml diff --git a/greetd.toml b/greetd.toml index 104878b..fbb9bf3 100644 --- a/greetd.toml +++ b/greetd.toml @@ -2,5 +2,5 @@ vt = 1 [default_session] -command = "tuigreet --cmd river --asterisks --issue --time --user-menu" +command = "tuigreet --cmd sway --asterisks --issue --time --user-menu" user = "greeter" diff --git a/install.sh b/install.sh index 3ee5636..08c12a1 100755 --- a/install.sh +++ b/install.sh @@ -36,7 +36,7 @@ sudo cp ./greetd.toml /etc/greetd/config.toml sudo systemctl enable greetd # Window Manager -paru -S --needed --noconfirm brightnessctl gammastep geoclue2 grim fuzzel mako network-manager-applet river slurp swaybg swayidle swaylock way-displays waybar xdg-desktop-portal-gtk xdg-desktop-portal-wlr +sudo pacman -S --needed --noconfirm brightnessctl fuzzel gammastep grim kanshi mako network-manager-applet slurp sway swayidle swaylock waybar xdg-desktop-portal-gtk xdg-desktop-portal-wlr mkdir -p ~/Pictures/Screenshots # Fonts diff --git a/kanshi/.config/kanshi/config b/kanshi/.config/kanshi/config new file mode 100644 index 0000000..36b9fe4 --- /dev/null +++ b/kanshi/.config/kanshi/config @@ -0,0 +1,7 @@ +profile { + output eDP-1 scale 1.25 +} + +profile { + output "AOC 27G2G4 GYGL9HA232568" mode 1920x1080@144Hz adaptive_sync on +} diff --git a/river/.config/river/init b/river/.config/river/init deleted file mode 100755 index c13604d..0000000 --- a/river/.config/river/init +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/sh - -# Pick a random wallpaper for the session -WALLPAPER=~/Pictures/Wallpapers/$(ls ~/Pictures/Wallpapers -b | shuf -n 1) - -# Super+Shift+Escape to lock the screen -riverctl map normal Super+Shift Escape spawn "swaylock -fF -i $WALLPAPER -s fill" - -# Super+Return to start an instance of kitty -riverctl map normal Super Return spawn kitty - -# Control+Shift+Escape to start an instance of btop -riverctl map normal Control+Shift Escape spawn "kitty btop" - -# Super+D to start an instance of fuzzel -riverctl map normal Super D spawn fuzzel - -# Super+F to start an instance of ranger -riverctl map normal Super F spawn "kitty ranger" - -# Super+Shift+Q to close the focused view -riverctl map normal Super+Shift Q close - -# Super+Shift+E to exit river -riverctl map normal Super+Shift E exit - -# Super+J and Super+K to focus the next/previous view in the layout stack -riverctl map normal Super J focus-view next -riverctl map normal Super K focus-view previous - -# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous -# view in the layout stack -riverctl map normal Super+Shift J swap next -riverctl map normal Super+Shift K swap previous - -# Super+Return to bump the focused view to the top of the layout stack -riverctl map normal Super I zoom - -# Super+H and Super+L to decrease/increase the main ratio of rivertile -riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" -riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" - -# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile -riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" -riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" - -# Super + Left Mouse Button to move views -riverctl map-pointer normal Super BTN_LEFT move-view - -# Super + Right Mouse Button to resize views -riverctl map-pointer normal Super BTN_RIGHT resize-view - -# Super + Middle Mouse Button to toggle float -riverctl map-pointer normal Super BTN_MIDDLE toggle-float - -for i in $(seq 1 9) -do - tags=$((1 << ($i - 1))) - - # Super+[1-9] to focus tag [0-8] - riverctl map normal Super $i set-focused-tags $tags - - # Super+Shift+[1-9] to tag focused view with tag [0-8] - riverctl map normal Super+Shift $i set-view-tags $tags - - # Super+Control+[1-9] to toggle focus of tag [0-8] - riverctl map normal Super+Control $i toggle-focused-tags $tags - - # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view - riverctl map normal Super+Shift+Control $i toggle-view-tags $tags -done - -# Super+0 to focus all tags -# Super+Shift+0 to tag focused view with all tags -all_tags=$(((1 << 32) - 1)) -riverctl map normal Super 0 set-focused-tags $all_tags -riverctl map normal Super+Shift 0 set-view-tags $all_tags - -# Super+Space to toggle float -riverctl map normal Super Space toggle-float - -# Super+Shift+F to toggle fullscreen -riverctl map normal Super+Shift F toggle-fullscreen - -# Super+{Up,Right,Down,Left} to change layout orientation -riverctl map normal Super Up send-layout-cmd rivertile "main-location top" -riverctl map normal Super Right send-layout-cmd rivertile "main-location right" -riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" -riverctl map normal Super Left send-layout-cmd rivertile "main-location left" - -# Toggle monocle -#riverctl map normal Super M send-layout-cmd rivercarro "main-location monocle" - -# Declare a passthrough mode. This mode has only a single mapping to return to -# normal mode. This makes it useful for testing a nested wayland compositor -riverctl declare-mode passthrough - -# Super+F11 to enter passthrough mode -riverctl map normal Super F11 enter-mode passthrough - -# Super+F11 to return to normal mode -riverctl map passthrough Super F11 enter-mode normal - -# Various media key mapping examples for both normal and locked mode which do -# not have a modifier -for mode in normal locked -do - # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) - riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5' - riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5' - riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute' - - # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) - riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' - riverctl map $mode None XF86AudioNext spawn 'playerctl next' - - # Control screen backlight brightness with light (https://github.com/haikarainen/light) - riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl s +5% -q' - riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl s 5%- -q' -done - -# Print to take full screenshot and Alt+Print to take rectangle screenshot -riverctl map normal None Print spawn "GRIM_DEFAULT_DIR=~/Pictures/Screenshots grim" -riverctl map normal Alt Print spawn 'GRIM_DEFAULT_DIR=~/Pictures/Screenshots grim -g "$(slurp)"' - -# Set background and border color -riverctl background-color 0x907aa9 -riverctl border-color-focused 0xe0def4 -riverctl border-color-unfocused 0x6e6a86 -riverctl border-color-urgent 0xf6c177 - -# Window floating rules -riverctl float-filter-add app-id nm-connection-editor - -# Configure trackpad -# Replace device name with your own -# $ riverctl list-inputs -TRACKPAD=pointer-1739-0-Synaptics_TM3276-022 -riverctl input $TRACKPAD disable-while-typing disabled -riverctl input $TRACKPAD natural-scroll enabled -riverctl input $TRACKPAD tap enabled -riverctl input $TRACKPAD tap-button-map left-right-middle - -# Configure mouse -MOUSE=pointer-1133-16518-Logitech_G703_LS -riverctl input $MOUSE accel-profile flat - -# Configure displays -way-displays > /tmp/way-displays.${XDG_VTNR}.${USER}.log 2>&1 & - -# Launch notification daemon -mako & - -# Launch bar -waybar & - -# Enable network manager applet -nm-applet & - -# Set random wallpaper from ~/Pictures/Wallpapers -swaybg -i $WALLPAPER -m fill & - -# Enable gammastep -/usr/lib/geoclue-2.0/demos/agent & -gammastep -l geoclue2 -t 6500K:3500K & - -# Lock before sleep -swayidle -w before-sleep "swaylock -fF -i $WALLPAPER -s fill" & - -# Set the default layout generator to be rivertile and start it. -# River will send the process group of the init executable SIGTERM on exit. -riverctl default-layout rivertile -exec rivertile -outer-padding 4 -view-padding 4 diff --git a/sway/.config/sway/config b/sway/.config/sway/config new file mode 100644 index 0000000..d439ee2 --- /dev/null +++ b/sway/.config/sway/config @@ -0,0 +1,183 @@ +# Logo key. Use Mod1 for Alt. +set $mod Mod4 + +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +# Your preferred terminal emulator +set $term kitty + +# Your preferred application launcher +set $menu fuzzel | xargs swaymsg exec -- + +# Wallpaper +exec cp -f ~/Pictures/Wallpapers/$(ls ~/Pictures/Wallpapers -b | shuf -n 1) ~/.wallpaper +output * bg ~/.wallpaper fill + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaymsg exit +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +include /etc/sway/config.d/* + +# Notification daemon +exec mako + +# Configure displays +exec_always kanshi +exec gammastep -l $(cat ~/.latlon) -t 6500K:3500K + +# Status bar +exec waybar diff --git a/way-displays/.config/way-displays/cfg.yaml b/way-displays/.config/way-displays/cfg.yaml deleted file mode 100644 index 7dde077..0000000 --- a/way-displays/.config/way-displays/cfg.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Arrange displays in a ROW (default, left to right) or a COLUMN (top to bottom) -ARRANGE: ROW - -# Align ROWs at the TOP (default), MIDDLE or BOTTOM -# Align COLUMNs at the LEFT (default), MIDDLE or RIGHT -ALIGN: MIDDLE - -# The default ORDER is simply the order in which the displays are discovered. -# Define your own. -ORDER: - #- 'DP-2' - #- 'monitor description' - #- 'HDMI-1' - -# Enable scaling, overrides AUTO_SCALE and SCALE -SCALING: TRUE - -# The default is to scale each display by DPI. -# This may be disabled and scale 1 will be used, unless a SCALE has been specified. -AUTO_SCALE: FALSE - -# Auto scale may be overridden for each display. -SCALE: - - NAME_DESC: 'eDP-1' - SCALE: 1.25 - -# Override the preferred mode. -# WARNING: this may result in an unusable display. See https://github.com/alex-courtis/way-displays#known-issues-with-workarounds -# for a possible workaround. -MODE: - # Resolution and refresh - #- NAME_DESC: HDMI-A-1 - # WIDTH: 1920 - # HEIGHT: 1080 - # HZ: 60 - - # Resolution with highest refresh - #- NAME_DESC: 'monitor description' - # WIDTH: 2560 - # HEIGHT: 1440 - - - NAME_DESC: "AOC 27G2G4" - MAX: TRUE - -# Rotate or translate the display. -# 90, 180, 270, FLIPPED, FLIPPED-90, FLIPPED-180, FLIPPED-270 -TRANSFORM: - # - NAME_DESC: 'monitor description' - # TRANSFORM: 270 - -# VRR / adaptive sync is enabled by default. Disable it per display. -VRR_OFF: - # - DP-2 - # - '!.*my monitor.*' - -# Laptop displays usually start with eDP e.g. eDP-1. This may be overridden if -# your laptop is different. -#LAPTOP_DISPLAY_PREFIX: 'eDP' - -# One of: ERROR, WARNING, INFO (default), DEBUG -LOG_THRESHOLD: INFO - -# Disable the specified displays. -DISABLED: - #- "eDP-1" - diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index ceea687..50f91a6 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -1,6 +1,6 @@ { "layer": "top", - "modules-left": ["river/tags"], + "modules-left": ["sway/workspaces"], "modules-right": ["tray", "gamemode", "bluetooth", "network", "wireplumber", "backlight", "battery", "clock"], "backlight": { "format": "󰃠 {percent}%" @@ -35,9 +35,6 @@ "tooltip-format-ethernet": "{ifname}\t{ipaddr}/{cidr}", "tooltip-format-wifi": "{ifname} ({signalStrength}%)\t{ipaddr}/{cidr}" }, - "river/window": { - "max-length": 40 - }, "wireplumber": { "format": "󰕾 {volume}%", "format-muted": "󰝟 Muted" diff --git a/waybar/.config/waybar/style.css b/waybar/.config/waybar/style.css index 0dc13d7..3af3414 100644 --- a/waybar/.config/waybar/style.css +++ b/waybar/.config/waybar/style.css @@ -46,28 +46,3 @@ button, #battery.charging { background-color: #31748f; } - -#tags button { - color: #6e6a86; - padding: 0 5px; -} - -#tags button.occupied { - color: #e0def4; -} - -#tags button.focused { - background-color: #c4a7e7; - color: #191724; -} - -#tags button.urgent { - background-color: #f6c177; - color: #191724; -} - -#tags button:hover { - transition-duration: 0; - background: #9ccfd8; - color: #191724; -}