diff options
| author | Tyler Murphy <tylerm@tylerm.dev> | 2023-09-04 23:21:01 -0400 |
|---|---|---|
| committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-09-04 23:21:01 -0400 |
| commit | db49f683129771d95828b01594c69431a717e8e8 (patch) | |
| tree | d2cb1c0b865e4d81ce81f9a3176b8ad93a864950 /home-config/sway | |
| download | dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.tar.gz dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.tar.bz2 dotfiles-guix-db49f683129771d95828b01594c69431a717e8e8.zip | |
guix
Diffstat (limited to 'home-config/sway')
23 files changed, 354 insertions, 0 deletions
diff --git a/home-config/sway/auto.sh b/home-config/sway/auto.sh new file mode 100755 index 0000000..68a28e2 --- /dev/null +++ b/home-config/sway/auto.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +/usr/lib/xdg-desktop-portal -r & +/usr/lib/xdg-desktop-portal-wlr -r & + +mako & + +nm-applet --indicator & + +GTK_THEME= waybar & + +autotiling & + +/usr/bin/gnome-keyring-daemon --foreground & + +discord --enable-features=UseOzonePlatform --ozone-platform=wayland & +element-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland & +#thunderbird & + diff --git a/home-config/sway/config b/home-config/sway/config new file mode 100755 index 0000000..1ef472f --- /dev/null +++ b/home-config/sway/config @@ -0,0 +1,34 @@ +# xdg desktop portal fix +exec dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + +# Set super key +set $mod Mod4 + +# Set terminal +set $term alacritty + +# Set app launcher +set $menu wofi --allow-images --show=drun --prompt "Search Program" + +# Set scale +set $scale 1.5 + +# Set background +set $bg ~/.config/sway/nya0.png + +# Set Efects +set $radius 0 +set $shadows on +set $shadow_blur 50 +set $blur enable +set $blur_radius 4 +set $blur_passes 2 + +# Set browser +set $browser firefox + +# Autostart apps +exec $HOME/.config/sway/auto.sh + +# Local configs +include $HOME/.config/sway/config.d/* diff --git a/home-config/sway/config.d/gestures b/home-config/sway/config.d/gestures new file mode 100644 index 0000000..4bdb136 --- /dev/null +++ b/home-config/sway/config.d/gestures @@ -0,0 +1,4 @@ +### Gestures + +bindgesture swipe:right workspace prev +bindgesture swipe:left workspace next diff --git a/home-config/sway/config.d/idle b/home-config/sway/config.d/idle new file mode 100644 index 0000000..fb13083 --- /dev/null +++ b/home-config/sway/config.d/idle @@ -0,0 +1,5 @@ +# Turn off display after tiemout +exec swayidle -w \ + timeout 300 'swaylock -f -c 14171d' \ + timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 14171d' diff --git a/home-config/sway/config.d/input b/home-config/sway/config.d/input new file mode 100644 index 0000000..a02f6d6 --- /dev/null +++ b/home-config/sway/config.d/input @@ -0,0 +1,20 @@ +### Input configuration + +# Enable numlock on startup +input * xkb_numlock enable + +# Keyboard layout, change as you wish +input * { + xkb_layout "us" +} + +# Touchpad input settings +input type:touchpad { + tap enabled + natural_scroll enabled + middle_emulation enabled +} + +# Screen settings +#exec swaymsg output $screen resolution $resolution scale $scale +output eDP-1 resolution 3072x1920 scale $scale diff --git a/home-config/sway/config.d/keybinds b/home-config/sway/config.d/keybinds new file mode 100644 index 0000000..b8ea81f --- /dev/null +++ b/home-config/sway/config.d/keybinds @@ -0,0 +1,51 @@ +### Key bindings + +# Start a terminal +bindsym $mod+Return exec $term + +# Kill focused window +bindsym $mod+Shift+q kill + +# Start your launcher +bindsym $mod+d exec $menu + +# Start your browesr +bindsym $mod+w exec $browser + +# Lock screen +bindsym $mod+Shift+l exec $lock + +# Exit sway +bindsym Ctrl+Alt+Delete exec killall sway + +# Power menu +bindsym $mod+L exec killall wlogout || wlogout --css ~/.config/sway/power/style.css -l ~/.config/sway/power/layout + +# 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+F5 reload + +# Audio keybinds +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + +# Brightness keybinds +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ + +# Player keybinds +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +# Screenshot +bindsym Print exec grim -g "$(slurp)" - | wl-copy +bindsym Shift+Print exec slurp -p | grim -g - - | convert - txt:- | tail -n 1 | awk '{print $3}' | wl-copy diff --git a/home-config/sway/config.d/scratch b/home-config/sway/config.d/scratch new file mode 100644 index 0000000..4de2190 --- /dev/null +++ b/home-config/sway/config.d/scratch @@ -0,0 +1,14 @@ +### Scratchpad: + +# Move the currently focused window to the scratchpad +bindsym $mod+Shift+minus 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 $mod+minus scratchpad show + +for_window [app_id="scratch_term"] move scratchpad, resize set 960 640 +for_window [app_id="scratch_htop"] move scratchpad, resize set 960 640 + +bindsym $mod+y exec ~/.config/sway/scratchpads.sh scratch_term zsh +bindsym $mod+h exec ~/.config/sway/scratchpads.sh scratch_htop htop diff --git a/home-config/sway/config.d/theme b/home-config/sway/config.d/theme new file mode 100644 index 0000000..4fb10b7 --- /dev/null +++ b/home-config/sway/config.d/theme @@ -0,0 +1,27 @@ +### Set borders +gaps inner 10 +for_window [class="^.*"] border pixel 2 + +### Colors + +# class border backgr. text indicator child_border +client.background #14171d +client.focused #4d4754 #14171d #ffffff #ada0a8 #4d4754 +client.focused_inactive #4d4754 #14171d #ffffff #4d4754 #14171d +client.focused_tab_title #4d4754 #14171d #ffffff +client.unfocused #14171d #14171d #ffffff #4d4754 #14171d +client.urgent #cc5c5c #a63a3a #ffffff #cc5c5c #a63a3a + +### SwayFX + +corner_radius $radius +smart_corner_radius $radius +shadows $shadows +shadows_on_csd $shadows +shadow_blur_radius $shadow_blur +blur $blur +blur_radius $blur_radius +blur_passes $blur_passes + +### Output configuration +output * bg $bg fill diff --git a/home-config/sway/config.d/workspaces b/home-config/sway/config.d/workspaces new file mode 100644 index 0000000..fe87bc1 --- /dev/null +++ b/home-config/sway/config.d/workspaces @@ -0,0 +1,70 @@ + +# Move your focus around +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 + +# 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 + +# Layout stuff: + +# Set the new window positioning mode +bindsym $mod+Shift+b layout splith +bindsym $mod+Shift+v layout splitv +bindsym $mod+Shift+c layout tabbed + +# 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 + +# Resize windows +mode "resize" { + # 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" diff --git a/home-config/sway/nya0.png b/home-config/sway/nya0.png Binary files differnew file mode 100644 index 0000000..e9da5d5 --- /dev/null +++ b/home-config/sway/nya0.png diff --git a/home-config/sway/power/img/lock-hover.png b/home-config/sway/power/img/lock-hover.png Binary files differnew file mode 100644 index 0000000..46c51b0 --- /dev/null +++ b/home-config/sway/power/img/lock-hover.png diff --git a/home-config/sway/power/img/lock.png b/home-config/sway/power/img/lock.png Binary files differnew file mode 100644 index 0000000..f1ec4a2 --- /dev/null +++ b/home-config/sway/power/img/lock.png diff --git a/home-config/sway/power/img/logout-hover.png b/home-config/sway/power/img/logout-hover.png Binary files differnew file mode 100644 index 0000000..b34a150 --- /dev/null +++ b/home-config/sway/power/img/logout-hover.png diff --git a/home-config/sway/power/img/logout.png b/home-config/sway/power/img/logout.png Binary files differnew file mode 100644 index 0000000..59a5aeb --- /dev/null +++ b/home-config/sway/power/img/logout.png diff --git a/home-config/sway/power/img/power-hover.png b/home-config/sway/power/img/power-hover.png Binary files differnew file mode 100644 index 0000000..a65e429 --- /dev/null +++ b/home-config/sway/power/img/power-hover.png diff --git a/home-config/sway/power/img/power.png b/home-config/sway/power/img/power.png Binary files differnew file mode 100644 index 0000000..6aac455 --- /dev/null +++ b/home-config/sway/power/img/power.png diff --git a/home-config/sway/power/img/restart-hover.png b/home-config/sway/power/img/restart-hover.png Binary files differnew file mode 100644 index 0000000..7921398 --- /dev/null +++ b/home-config/sway/power/img/restart-hover.png diff --git a/home-config/sway/power/img/restart.png b/home-config/sway/power/img/restart.png Binary files differnew file mode 100644 index 0000000..5851243 --- /dev/null +++ b/home-config/sway/power/img/restart.png diff --git a/home-config/sway/power/img/sleep-hover.png b/home-config/sway/power/img/sleep-hover.png Binary files differnew file mode 100644 index 0000000..7c9b6b3 --- /dev/null +++ b/home-config/sway/power/img/sleep-hover.png diff --git a/home-config/sway/power/img/sleep.png b/home-config/sway/power/img/sleep.png Binary files differnew file mode 100644 index 0000000..164f5fb --- /dev/null +++ b/home-config/sway/power/img/sleep.png diff --git a/home-config/sway/power/layout b/home-config/sway/power/layout new file mode 100644 index 0000000..c40a736 --- /dev/null +++ b/home-config/sway/power/layout @@ -0,0 +1,30 @@ +{ + "label" : "lock", + "action" : "swaylock -f -c 242434", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "logout", + "action" : "loginctl terminate-user $USER", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "shutdown", + "action" : "loginctl poweroff", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "suspend", + "action" : "loginctl suspend", + "text" : "Suspend", + "keybind" : "u" +} +{ + "label" : "reboot", + "action" : "loginctl reboot", + "text" : "Reboot", + "keybind" : "r" +} diff --git a/home-config/sway/power/style.css b/home-config/sway/power/style.css new file mode 100644 index 0000000..e80dd33 --- /dev/null +++ b/home-config/sway/power/style.css @@ -0,0 +1,76 @@ +nk* { + font-family: "Fira Mono", "Font Awesome 6 Pro", monospace; + font-size: 16px; + font-weight: bold; +} + +window { + background-color: rgba(0, 0, 0, 0); +} + +button { + background-color: #242434; + background-image: none; + color: #89ADF8; + border: 1px solid rgba(0, 0, 0, 0); + margin: 5px; + border-radius: 10px; + background-repeat: no-repeat; + background-position: center; + background-size: 35%; +} + +button:focus, button:active { + background-color: #89B4FA; + color: #242434; + font-weight: 500; + outline-style: none; +} + +#lock { + background-image: image(url("img/lock.png")); +} + +#logout { + background-image: image(url("img/logout.png")); +} + +#suspend { + background-image: image(url("img/sleep.png")); +} + +#hibernate { + background-image: image(url("img/hibernate.png")); +} + +#shutdown { + background-image: image(url("img/power.png")); +} + +#reboot { + background-image: image(url("img/restart.png")); +} + +#lock:focus { + background-image: image(url("img/lock-hover.png")); +} + +#logout:focus { + background-image: image(url("img/logout-hover.png")); +} + +#suspend:focus { + background-image: image(url("img/sleep-hover.png")); +} + +#hibernate:focus { + background-image: image(url("img/hibernate-hover.png")); +} + +#shutdown:focus { + background-image: image(url("img/power-hover.png")); +} + +#reboot:focus { + background-image: image(url("img/restart-hover.png")); +} diff --git a/home-config/sway/scratchpads.sh b/home-config/sway/scratchpads.sh new file mode 100755 index 0000000..bb8e361 --- /dev/null +++ b/home-config/sway/scratchpads.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +( swaymsg -t get_tree | /bin/grep '"app_id": "'$1'"' ) || ( ( $TERMINAL --class=$1 -e $2 & ) && sleep 0.2 ) +swaymsg "[app_id=\"$1\"]" scratchpad show |