diff options
author | Freya Murphy <freya@freyacat.org> | 2024-06-21 22:52:21 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-06-21 22:52:21 -0400 |
commit | cf5d8d92f1904511006a89970349dbf723ae1732 (patch) | |
tree | 2deb7af8e9031a502b6b7f1c263198e4d6b93f9f /home/config/sway | |
parent | update guixstrap (diff) | |
download | dotfiles-guix-cf5d8d92f1904511006a89970349dbf723ae1732.tar.gz dotfiles-guix-cf5d8d92f1904511006a89970349dbf723ae1732.tar.bz2 dotfiles-guix-cf5d8d92f1904511006a89970349dbf723ae1732.zip |
update things
Diffstat (limited to 'home/config/sway')
-rw-r--r-- | home/config/sway/config | 41 | ||||
-rw-r--r-- | home/config/sway/config.d/gestures | 4 | ||||
-rw-r--r-- | home/config/sway/config.d/input | 20 | ||||
-rw-r--r-- | home/config/sway/config.d/keybinds | 57 | ||||
-rw-r--r-- | home/config/sway/config.d/project | 6 | ||||
-rw-r--r-- | home/config/sway/config.d/scratch | 18 | ||||
-rw-r--r-- | home/config/sway/config.d/theme | 35 | ||||
-rw-r--r-- | home/config/sway/config.d/workspaces | 69 | ||||
-rw-r--r-- | home/config/sway/outputs | 20 | ||||
-rwxr-xr-x | home/config/sway/scripts.d/auto.sh | 14 | ||||
-rwxr-xr-x | home/config/sway/scripts.d/project.sh | 122 | ||||
-rwxr-xr-x | home/config/sway/scripts.d/scratchpads.sh | 4 | ||||
-rw-r--r-- | home/config/sway/workspaces | 0 |
13 files changed, 410 insertions, 0 deletions
diff --git a/home/config/sway/config b/home/config/sway/config new file mode 100644 index 0000000..d8526ad --- /dev/null +++ b/home/config/sway/config @@ -0,0 +1,41 @@ +# Set super key +set $mod Mod4 + +# Set terminal +set $term kitty + +# Set app launcher +set $menu wofi --allow-images --show=drun --prompt "Search Program" + +# Set scale +set $scale 1.25 + +# Set background +set $bg ~/.config/desktop-common/wallpapers/davekat.png + +# Set lockscreen +set $lock hyprlock + +# Set Efects +set $gaps 10 +set $radius 0 +set $shadows on +set $shadow_blur 15 +set $blur enable +set $blur_radius 10 +set $blur_passes 3 + +# Set browser +set $browser librewolf + +# System configs +include /etc/sway/config.d/* + +# Local configs +include $HOME/.config/sway/config.d/* + +# Nwg +include $HOME/.config/sway/outputs + +# Autostart apps +exec $HOME/.config/sway/scripts.d/auto.sh 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/input b/home/config/sway/config.d/input new file mode 100644 index 0000000..9cb7156 --- /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" + xkb_options compose:ralt +} + +# Touchpad input settings +input type:touchpad { + tap enabled + natural_scroll enabled + middle_emulation enabled +} + +# Screen settings +# 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..214be98 --- /dev/null +++ b/home/config/sway/config.d/keybinds @@ -0,0 +1,57 @@ +### 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+l exec $lock + +# Exit sway +bindsym $mod+Shift+l exit + +# 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 Shift+XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ 10000% +bindsym Shift+XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ 0% +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 $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy -t image/png && notify-send -t 3000 "Sway" "Screenshot copied to clipboard" +bindsym Print exec grim - | wl-copy -t iamge/png && notify-send -t 3000 "Sway" "Full screen copied to clipboard" +bindsym Shift+Print exec slurp -p | grim -g - - | convert - txt:- | tail -n 1 | awk '{print $3}' | wl-copy + +# Michelsoft Binbows +bindsym Ctrl+$mod+Shift+L exec $browser "https://linkedin.com" +bindsym Ctrl+$mod+Shift+S exec $term -e sl +bindsym Ctrl+$mod+Shift+T exec electron28 "https://twitter.com" +bindsym Ctrl+$mod+Shift+M exec electron28 "https://www.tumblr.com" diff --git a/home/config/sway/config.d/project b/home/config/sway/config.d/project new file mode 100644 index 0000000..5f74a43 --- /dev/null +++ b/home/config/sway/config.d/project @@ -0,0 +1,6 @@ +### Project + +bindsym $mod+Alt+Left exec ~/.config/sway/scripts.d/project.sh LEFT $scale +bindsym $mod+Alt+Right exec ~/.config/sway/scripts.d/project.sh RIGHT $scale +bindsym $mod+Alt+Up exec ~/.config/sway/scripts.d/project.sh EXTERNAL_ONLY $scale +bindsym $mod+Alt+Down exec ~/.config/sway/scripts.d/project.sh PRIMARY_ONLY $scale diff --git a/home/config/sway/config.d/scratch b/home/config/sway/config.d/scratch new file mode 100644 index 0000000..bdafcf6 --- /dev/null +++ b/home/config/sway/config.d/scratch @@ -0,0 +1,18 @@ +### 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 + +exec ~/.config/sway/scripts.d/scratchpads.sh + +for_window [app_id="scratch_term"] move scratchpad, resize set 960 640 +for_window [app_id="scratch_htop"] move scratchpad, resize set 960 640 +for_window [app_id="scratch_calc"] move scratchpad, resize set 960 640 + +bindsym $mod+y exec ~/.config/sway/scripts.d/scratchpads.sh scratch_term zsh +bindsym $mod+h exec ~/.config/sway/scripts.d/scratchpads.sh scratch_htop htop +bindsym $mod+c exec ~/.config/sway/scripts.d/scratchpads.sh scratch_calc matrix diff --git a/home/config/sway/config.d/theme b/home/config/sway/config.d/theme new file mode 100644 index 0000000..3d93752 --- /dev/null +++ b/home/config/sway/config.d/theme @@ -0,0 +1,35 @@ +### Set borders +gaps inner $gaps +for_window [class="^.*"] border pixel 0 +default_border pixel 0 +default_floating_border pixel 0 + +### Colors + +# class border backgr. text indicator child_border +client.background #14171d +client.focused #4d4754 #14171d #ffffff #4d4754 #4d4754 +client.focused_inactive #4d4754 #14171d #ffffff #14171d #14171d +client.focused_tab_title #4d4754 #14171d #ffffff +client.unfocused #14171d #14171d #ffffff #14171d #14171d +client.urgent #cc5c5c #a63a3a #ffffff #a63a3a #a63a3a + +### SwayFX + +corner_radius $radius +smart_corner_radius $radius +shadows $shadows +shadows_on_csd $shadows +shadow_blur_radius $shadow_blur +shadow_color #14171dff +blur $blur +blur_radius $blur_radius +blur_passes $blur_passes +layer_effects "waybar" blur disable; shadows disable +layer_effects "wofi" blur enable; shadows enable + +### Output configuration +output * bg $bg fill + +### Bar +bar swaybar_command waybar diff --git a/home/config/sway/config.d/workspaces b/home/config/sway/config.d/workspaces new file mode 100644 index 0000000..5fac86b --- /dev/null +++ b/home/config/sway/config.d/workspaces @@ -0,0 +1,69 @@ + +# 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 + +# 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 + +# Layout stuff: + +# Set the new window positioning mode +bindsym $mod+Shift+d layout default +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/outputs b/home/config/sway/outputs new file mode 100644 index 0000000..08b8c77 --- /dev/null +++ b/home/config/sway/outputs @@ -0,0 +1,20 @@ +# Generated by nwg-displays on 2024-06-15 at 16:21:56. Do not edit manually. + +output "eDP-1" { + mode 2560x1600@90.003Hz + pos 2560 160 + transform normal + scale 1.25 + scale_filter linear + adaptive_sync off + dpms on +} +output "DP-2" { + mode 2560x1440@59.951Hz + pos 0 0 + transform normal + scale 1.0 + scale_filter linear + adaptive_sync off + dpms on +} diff --git a/home/config/sway/scripts.d/auto.sh b/home/config/sway/scripts.d/auto.sh new file mode 100755 index 0000000..07a61fd --- /dev/null +++ b/home/config/sway/scripts.d/auto.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +nm-applet --indicator & +autotiling-rs & + +/usr/bin/gnome-keyring-daemon --foreground & +wl-clip-persist --clipboard both & + +#gtk-launch discord & +#gtk-launch io.element.Element & +#gtk-launch org.gajim.Gajim & +#gtk-launch org.mozilla.Thunderbird & + +hypridle & diff --git a/home/config/sway/scripts.d/project.sh b/home/config/sway/scripts.d/project.sh new file mode 100755 index 0000000..84e1a8d --- /dev/null +++ b/home/config/sway/scripts.d/project.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +PID=$$ + +get_mode() { + swaymsg -t get_outputs -r | jq ".[$1].modes[0]" +} + +get_name() { + swaymsg -t get_outputs -r | jq -r ".[$1].name" +} + +get_width() { + get_mode "$1" | jq ".width" +} + +get_height() { + get_mode "$1" | jq ".width" +} + +get_refresh() { + get_mode "$1" | jq ".refresh" | rev | cut -c 4- | rev +} + +get_placement() { + # $1 - monitor placement + # $2 - monitor index compared + # $3 - monitor compared scale + WIDTH="$(jq -n "$(get_width $2)/$3" | awk -F. '{print $1}')" + case $1 in + "NONE") + echo "0 0" + ;; + "RIGHT") + echo "$WIDTH 0" + ;; + *) + echo "0 0" + ;; + esac +} + +update() { + # $1 - monitor index + # $2 - monitor scale + # $3 - monitor placement + # $4 - monitor index compared + # $5 - monitor compared scale + swaymsg output "$(get_name $1)" "enable" + swaymsg output "$(get_name $1)" resolution "$(get_width $1)x$(get_height $1)@$(get_refresh $1)hz" scale $2 position "$(get_placement $3 $4 $5)" +} + +off() { + swaymsg output "$(get_name $1)" "disable" +} + +get_id() { + i=0 + while true; do + NAME="$(get_name $i)" + if [ $(echo "$NAME" | grep "^$1") ]; then + echo "$i" + return 0 + elif [ "$NAME" == "null" ]; then + return 1 + fi + ((i=i+1)) + done +} + +die() { + notify-send -u critical -t 3000 "Sway" "$1" + kill $PID +} + +PRIMARY=$(get_id "eDP-1" || die "Failed to get primary display") +EXTERNAL=$(get_id "DP" || get_id "HDMI" || die "Failed to get external display") + +PRIMARY_SCALE=$2 +EXTERNAL_SCALE=1 + +set_monitors() { + update $EXTERNAL $EXTERNAL_SCALE $1 $PRIMARY $PRIMARY_SCALE + update $PRIMARY $PRIMARY_SCALE $2 $EXTERNAL $EXTERNAL_SCALE +} + +set_left() { + set_monitors "NONE" "RIGHT" +} + +set_right() { + set_monitors "RIGHT" "NONE" +} + +set_primary_only() { + set_monitors "NONE" "NONE" + off $EXTERNAL +} + +set_external_only() { + set_monitors "NONE" "NONE" + off $PRIMARY +} + +case $1 in + "LEFT") + set_left + notify-send -t 3000 "Sway" "External display set to left aligned" + ;; + "RIGHT") + set_right + notify-send -t 3000 "Sway" "External display set to right aligned" + ;; + "PRIMARY_ONLY") + set_primary_only + notify-send -t 3000 "Sway" "Set to primary display only" + ;; + "EXTERNAL_ONLY") + set_external_only + notify-send -t 3000 "Sway" "Set to external display only" + ;; +esac diff --git a/home/config/sway/scripts.d/scratchpads.sh b/home/config/sway/scripts.d/scratchpads.sh new file mode 100755 index 0000000..bb8e361 --- /dev/null +++ b/home/config/sway/scripts.d/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 diff --git a/home/config/sway/workspaces b/home/config/sway/workspaces new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/config/sway/workspaces |