structure
This commit is contained in:
62
home_dotfiles/.config/sway/bluetooth-sway.sh
Executable file
62
home_dotfiles/.config/sway/bluetooth-sway.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -Eeu -o pipefail
|
||||
|
||||
# Bluetooth script for i3status-rust
|
||||
# Shows connected Bluetooth devices
|
||||
|
||||
BT_ICON=""
|
||||
|
||||
# Check if bluetoothctl is available
|
||||
if ! command -v bluetoothctl >/dev/null 2>&1; then
|
||||
echo "$BT_ICON Not available"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if Bluetooth is powered on
|
||||
BLUETOOTH_POWERED=$(bluetoothctl show | grep "Powered:" | awk '{print $2}')
|
||||
if [ "$BLUETOOTH_POWERED" != "yes" ]; then
|
||||
echo "$BT_ICON Off"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get connected devices
|
||||
CONNECTED_DEVICES=$(bluetoothctl devices Connected | grep "^Device" | awk '{for(i=3;i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
|
||||
|
||||
if [ -z "$CONNECTED_DEVICES" ]; then
|
||||
echo "$BT_ICON No devices"
|
||||
else
|
||||
# Limit the display to first 2 devices to avoid cluttering the bar
|
||||
DEVICE_COUNT=$(echo "$CONNECTED_DEVICES" | wc -w)
|
||||
if [ "$DEVICE_COUNT" -le 2 ]; then
|
||||
echo "$BT_ICON $CONNECTED_DEVICES"
|
||||
else
|
||||
FIRST_TWO=$(echo "$CONNECTED_DEVICES" | cut -d' ' -f1-2)
|
||||
echo "$BT_ICON $FIRST_TWO (+$((DEVICE_COUNT - 2)))"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Handle click events (for i3status-rust custom block)
|
||||
if [ "${BLOCK_BUTTON:-}" = "1" ]; then
|
||||
# Left click - show all connected devices with details
|
||||
DETAILED_DEVICES=$(bluetoothctl devices Connected | while read -r line; do
|
||||
MAC=$(echo "$line" | awk '{print $2}')
|
||||
NAME=$(echo "$line" | awk '{for(i=3;i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
|
||||
echo "• $NAME ($MAC)"
|
||||
done)
|
||||
|
||||
if [ -n "$DETAILED_DEVICES" ]; then
|
||||
notify-send "Bluetooth Devices" "$DETAILED_DEVICES" -t 5000
|
||||
else
|
||||
notify-send "Bluetooth" "No devices connected" -t 3000
|
||||
fi
|
||||
elif [ "${BLOCK_BUTTON:-}" = "3" ]; then
|
||||
# Right click - open bluetooth manager
|
||||
if command -v blueman-manager >/dev/null 2>&1; then
|
||||
blueman-manager >/dev/null 2>&1 &
|
||||
elif command -v gnome-bluetooth-panel >/dev/null 2>&1; then
|
||||
gnome-bluetooth-panel >/dev/null 2>&1 &
|
||||
else
|
||||
notify-send "Bluetooth" "No Bluetooth manager found" -t 3000
|
||||
fi
|
||||
fi
|
||||
506
home_dotfiles/.config/sway/config
Normal file
506
home_dotfiles/.config/sway/config
Normal file
@@ -0,0 +1,506 @@
|
||||
# Sway config based on Regolith i3 setup - Arch Linux version
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
###############################################################################
|
||||
# Variables and Basic Setup
|
||||
###############################################################################
|
||||
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
set $alt Mod1
|
||||
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
# Workspace keys
|
||||
set $ws1_key 1
|
||||
set $ws2_key 2
|
||||
set $ws3_key 3
|
||||
set $ws4_key 4
|
||||
set $ws5_key 5
|
||||
set $ws6_key 6
|
||||
set $ws7_key 7
|
||||
set $ws8_key 8
|
||||
set $ws9_key 9
|
||||
set $ws10_key 0
|
||||
set $ws_high_key Ctrl
|
||||
|
||||
# Workspace numbers
|
||||
set $ws1 1
|
||||
set $ws2 2
|
||||
set $ws3 3
|
||||
set $ws4 4
|
||||
set $ws5 5
|
||||
set $ws6 6
|
||||
set $ws7 7
|
||||
set $ws8 8
|
||||
set $ws9 9
|
||||
set $ws10 10
|
||||
set $ws11 11
|
||||
set $ws12 12
|
||||
set $ws13 13
|
||||
set $ws14 14
|
||||
set $ws15 15
|
||||
set $ws16 16
|
||||
set $ws17 17
|
||||
set $ws18 18
|
||||
set $ws19 19
|
||||
|
||||
# Movement key bindings
|
||||
set $move_left Shift+h
|
||||
set $move_down Shift+j
|
||||
set $move_up Shift+k
|
||||
set $move_right Shift+l
|
||||
|
||||
# Your preferred terminal emulator (Arch Linux alternatives)
|
||||
set $term kitty
|
||||
# Your preferred application launcher
|
||||
set $menu fuzzel
|
||||
# File manager (Arch alternatives)
|
||||
set $filemanager thunar
|
||||
|
||||
###############################################################################
|
||||
# Output configuration
|
||||
###############################################################################
|
||||
|
||||
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||
# output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
output * bg /home/raga/.config/sway/wallpaper.jpg fill
|
||||
|
||||
# 144Hz monitor configuration
|
||||
# Add custom 144Hz mode for your monitor
|
||||
# Using the same timing as your xrandr command: 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync
|
||||
output HDMI-A-1 {
|
||||
modeline 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync
|
||||
}
|
||||
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
|
||||
###############################################################################
|
||||
# Idle configuration
|
||||
###############################################################################
|
||||
|
||||
# Lock screen after 900 seconds of inactivity, then turn off displays
|
||||
#exec swayidle -w \
|
||||
# timeout 900 'swaylock -f -c 000000' \
|
||||
# timeout 1800 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
# before-sleep 'swaylock -f -c 000000'
|
||||
|
||||
# Lock screen after 900 seconds of inactivity
|
||||
exec swayidle -w \
|
||||
timeout 900 'swaylock -f -c 000000' \
|
||||
before-sleep 'swaylock -f -c 000000'
|
||||
|
||||
###############################################################################
|
||||
# Input configuration
|
||||
###############################################################################
|
||||
|
||||
# Estonian keyboard layout configuration
|
||||
input type:keyboard {
|
||||
xkb_layout "ee"
|
||||
xkb_variant "nodeadkeys"
|
||||
}
|
||||
|
||||
# Enable touchpad tap, natural scroll
|
||||
input type:touchpad {
|
||||
dwt enabled
|
||||
tap enabled
|
||||
natural_scroll enabled
|
||||
middle_emulation enabled
|
||||
}
|
||||
|
||||
# Disable mouse acceleration for all pointer devices
|
||||
input type:pointer {
|
||||
accel_profile flat
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Window and Application Styling
|
||||
###############################################################################
|
||||
|
||||
# Floating window rules
|
||||
floating_maximum_size -1 x -1
|
||||
for_window [app_id="floating_window"] floating enable
|
||||
|
||||
# Border configuration
|
||||
default_floating_border pixel 1
|
||||
default_border pixel 1
|
||||
|
||||
# Hiding borders adjacent to the screen edges.
|
||||
hide_edge_borders smart
|
||||
|
||||
# Enable popup during fullscreen
|
||||
popup_during_fullscreen smart
|
||||
|
||||
# Window focus follows mouse
|
||||
focus_follows_mouse no
|
||||
|
||||
# Auto back and forth workspace switching
|
||||
workspace_auto_back_and_forth no
|
||||
|
||||
# Use Mouse+$mod to drag floating windows
|
||||
floating_modifier $mod normal
|
||||
|
||||
###############################################################################
|
||||
# Key bindings
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Launcher dialogs
|
||||
###############################################################################
|
||||
|
||||
## Launch // Terminal // <> Enter ##
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
## Launch // Browser // <><Shift> Enter ##
|
||||
bindsym $mod+Shift+Return exec xdg-open http://
|
||||
|
||||
## Launch // Application // <> Space ##
|
||||
bindsym $mod+space exec $menu
|
||||
|
||||
## Navigate // Window by Name // <><Ctrl> Space ##
|
||||
bindsym $mod+Ctrl+space exec swaymsg -t get_tree | jq -r '..|select(.pid? and .visible?)|.name+" ["+.app_id+"]"' | fuzzel --dmenu | xargs -I {} swaymsg '[title="{}"] focus'
|
||||
|
||||
## Launch // File Search // <><Alt> Space ##
|
||||
bindsym $mod+$alt+space exec $filemanager
|
||||
|
||||
###############################################################################
|
||||
# Session Management
|
||||
###############################################################################
|
||||
|
||||
## Session // Exit App // <><Shift> q ##
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
## Session // Terminate App // <><Alt> q ##
|
||||
bindsym $mod+$alt+q exec --no-startup-id kill -9 $(swaymsg -t get_tree | jq '.. | select(.focused?).pid // empty')
|
||||
|
||||
## Session // Reload WM Config // <><Shift> c ##
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
## Session // Restart WM // <><Ctrl> r ##
|
||||
bindsym $mod+Ctrl+r reload
|
||||
|
||||
## Session // Logout // <><Shift> e ##
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||
|
||||
## Session // Reboot // <><Shift> b ##
|
||||
bindsym $mod+Shift+b exec systemctl reboot
|
||||
|
||||
## Session // Power Down // <><Shift> p ##
|
||||
bindsym $mod+Shift+p exec systemctl poweroff
|
||||
|
||||
## Session // Lock Screen // <> Escape ##
|
||||
bindsym $mod+Escape exec swaylock -f -c 000000
|
||||
|
||||
## Session // Sleep // <><Shift> s ##
|
||||
bindsym $mod+Shift+s exec systemctl suspend
|
||||
|
||||
###############################################################################
|
||||
# System Management (Arch Linux alternatives)
|
||||
###############################################################################
|
||||
|
||||
## Modify // Settings // <> c ##
|
||||
bindsym $mod+c exec env XDG_CURRENT_DESKTOP=GNOME gnome-control-center
|
||||
|
||||
## Modify // Display Settings // <> d ##
|
||||
bindsym $mod+d exec wdisplays
|
||||
|
||||
## Modify // Wifi Settings // <> w ##
|
||||
bindsym $mod+w exec nm-connection-editor
|
||||
|
||||
## Modify // Bluetooth Settings // <> b ##
|
||||
bindsym $mod+b exec blueman-manager
|
||||
|
||||
## Launch // File Browser // <><Shift> n ##
|
||||
bindsym $mod+Shift+n exec $filemanager
|
||||
|
||||
###############################################################################
|
||||
# Window and Workspace Navigation
|
||||
###############################################################################
|
||||
|
||||
## Navigate // Relative Parent // <> a ##
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
## Navigate // Relative Child // <> z ##
|
||||
bindsym $mod+z focus child
|
||||
|
||||
## Navigate // Relative Window // <> ↑ ↓ ← → ##
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
## Navigate // Relative Window // <> k j h l ##
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
|
||||
## Navigate // Workspaces 1-10 // <> 0..9 ##
|
||||
bindsym $mod+$ws1_key workspace number $ws1
|
||||
bindsym $mod+$ws2_key workspace number $ws2
|
||||
bindsym $mod+$ws3_key workspace number $ws3
|
||||
bindsym $mod+$ws4_key workspace number $ws4
|
||||
bindsym $mod+$ws5_key workspace number $ws5
|
||||
bindsym $mod+$ws6_key workspace number $ws6
|
||||
bindsym $mod+$ws7_key workspace number $ws7
|
||||
bindsym $mod+$ws8_key workspace number $ws8
|
||||
bindsym $mod+$ws9_key workspace number $ws9
|
||||
bindsym $mod+$ws10_key workspace number $ws10
|
||||
|
||||
## Navigate // Workspace 11 - 19 // <><Ctrl> 1..9 ##
|
||||
bindsym $mod+$ws_high_key+$ws1_key workspace number $ws11
|
||||
bindsym $mod+$ws_high_key+$ws2_key workspace number $ws12
|
||||
bindsym $mod+$ws_high_key+$ws3_key workspace number $ws13
|
||||
bindsym $mod+$ws_high_key+$ws4_key workspace number $ws14
|
||||
bindsym $mod+$ws_high_key+$ws5_key workspace number $ws15
|
||||
bindsym $mod+$ws_high_key+$ws6_key workspace number $ws16
|
||||
bindsym $mod+$ws_high_key+$ws7_key workspace number $ws17
|
||||
bindsym $mod+$ws_high_key+$ws8_key workspace number $ws18
|
||||
bindsym $mod+$ws_high_key+$ws9_key workspace number $ws19
|
||||
|
||||
## Navigate // Next Workspace // <> Tab ##
|
||||
bindsym $mod+Tab workspace next
|
||||
|
||||
## Navigate // Next Workspace // <><Alt> → ##
|
||||
bindsym $mod+$alt+Right workspace next
|
||||
|
||||
## Navigate // Next Workspace on Output // <><Ctrl> Tab ##
|
||||
bindsym $mod+Ctrl+Tab workspace next_on_output
|
||||
|
||||
## Navigate // Next Workspace on Output // <><Ctrl> l ##
|
||||
bindsym $mod+Ctrl+l workspace next_on_output
|
||||
|
||||
## Navigate // Previous Workspace // <><Shift> Tab ##
|
||||
bindsym $mod+Shift+Tab workspace prev
|
||||
|
||||
## Navigate // Previous Workspace // <><Alt> ← ##
|
||||
bindsym $mod+$alt+Left workspace prev
|
||||
|
||||
## Navigate // Previous Workspace on Output // <><Ctrl><Shift> Tab ##
|
||||
bindsym $mod+Ctrl+Shift+Tab workspace prev_on_output
|
||||
|
||||
## Navigate // Previous Workspace on Output // <><Ctrl> h ##
|
||||
bindsym $mod+Ctrl+h workspace prev_on_output
|
||||
|
||||
## Navigate // Scratchpad // <><Ctrl> a ##
|
||||
bindsym $mod+Ctrl+a scratchpad show
|
||||
|
||||
###############################################################################
|
||||
# Window and Workspace Configuration
|
||||
###############################################################################
|
||||
|
||||
## Modify // Window Position // <><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
|
||||
|
||||
## Modify // Window Position // <><Shift> k j h l ##
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
## Modify // Containing Workspace // <><Ctrl><Shift> ↑ ↓ ← → ##
|
||||
bindsym $mod+Ctrl+Shift+Left move workspace to output left
|
||||
bindsym $mod+Ctrl+Shift+Right move workspace to output right
|
||||
bindsym $mod+Ctrl+Shift+Up move workspace to output up
|
||||
bindsym $mod+Ctrl+Shift+Down move workspace to output down
|
||||
|
||||
## Modify // Containing Workspace // <><Ctrl><Shift> k j h l ##
|
||||
bindsym $mod+Ctrl+Shift+h move workspace to output left
|
||||
bindsym $mod+Ctrl+Shift+j move workspace to output down
|
||||
bindsym $mod+Ctrl+Shift+k move workspace to output up
|
||||
bindsym $mod+Ctrl+Shift+l move workspace to output right
|
||||
|
||||
## Modify // Vertical Window Orientation // <> v ##
|
||||
bindsym $mod+v splitv
|
||||
|
||||
## Modify // Horizontal Window Orientation // <> g ##
|
||||
bindsym $mod+g splith
|
||||
|
||||
## Modify // Toggle Window Orientation // <> BackSpace ##
|
||||
bindsym $mod+BackSpace split toggle
|
||||
|
||||
## Modify // Window Fullscreen Toggle // <> f ##
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
## Modify // Window Floating Toggle // <><Shift> f ##
|
||||
bindsym $mod+Shift+f floating toggle
|
||||
|
||||
## Modify // Move to Scratchpad // <><Ctrl> m ##
|
||||
bindsym $mod+Ctrl+m move to scratchpad
|
||||
|
||||
## Modify // Tile/Float Focus Toggle // <><Shift> t ##
|
||||
bindsym $mod+Shift+t focus mode_toggle
|
||||
|
||||
## Modify // Window Layout Mode // <> t ##
|
||||
bindsym $mod+t layout toggle tabbed splith splitv
|
||||
|
||||
# Move focused container to workspace
|
||||
## Modify // Move Window to Workspace 1 - 10 // <><Shift> 0..9 ##
|
||||
bindsym $mod+Shift+$ws1_key move container to workspace number $ws1
|
||||
bindsym $mod+Shift+$ws2_key move container to workspace number $ws2
|
||||
bindsym $mod+Shift+$ws3_key move container to workspace number $ws3
|
||||
bindsym $mod+Shift+$ws4_key move container to workspace number $ws4
|
||||
bindsym $mod+Shift+$ws5_key move container to workspace number $ws5
|
||||
bindsym $mod+Shift+$ws6_key move container to workspace number $ws6
|
||||
bindsym $mod+Shift+$ws7_key move container to workspace number $ws7
|
||||
bindsym $mod+Shift+$ws8_key move container to workspace number $ws8
|
||||
bindsym $mod+Shift+$ws9_key move container to workspace number $ws9
|
||||
bindsym $mod+Shift+$ws10_key move container to workspace number $ws10
|
||||
|
||||
## Modify // Move Window to Workspace 11 - 19// <><Ctrl><Shift> 1..9 ##
|
||||
bindsym $mod+Shift+$ws_high_key+$ws1_key move container to workspace number $ws11
|
||||
bindsym $mod+Shift+$ws_high_key+$ws2_key move container to workspace number $ws12
|
||||
bindsym $mod+Shift+$ws_high_key+$ws3_key move container to workspace number $ws13
|
||||
bindsym $mod+Shift+$ws_high_key+$ws4_key move container to workspace number $ws14
|
||||
bindsym $mod+Shift+$ws_high_key+$ws5_key move container to workspace number $ws15
|
||||
bindsym $mod+Shift+$ws_high_key+$ws6_key move container to workspace number $ws16
|
||||
bindsym $mod+Shift+$ws_high_key+$ws7_key move container to workspace number $ws17
|
||||
bindsym $mod+Shift+$ws_high_key+$ws8_key move container to workspace number $ws18
|
||||
bindsym $mod+Shift+$ws_high_key+$ws9_key move container to workspace number $ws19
|
||||
|
||||
# Move focused container to workspace and follow
|
||||
## Modify // Carry Window to Workspace 1 - 10// <><Alt> 0..9 ##
|
||||
bindsym $mod+$alt+$ws1_key move container to workspace number $ws1; workspace number $ws1
|
||||
bindsym $mod+$alt+$ws2_key move container to workspace number $ws2; workspace number $ws2
|
||||
bindsym $mod+$alt+$ws3_key move container to workspace number $ws3; workspace number $ws3
|
||||
bindsym $mod+$alt+$ws4_key move container to workspace number $ws4; workspace number $ws4
|
||||
bindsym $mod+$alt+$ws5_key move container to workspace number $ws5; workspace number $ws5
|
||||
bindsym $mod+$alt+$ws6_key move container to workspace number $ws6; workspace number $ws6
|
||||
bindsym $mod+$alt+$ws7_key move container to workspace number $ws7; workspace number $ws7
|
||||
bindsym $mod+$alt+$ws8_key move container to workspace number $ws8; workspace number $ws8
|
||||
bindsym $mod+$alt+$ws9_key move container to workspace number $ws9; workspace number $ws9
|
||||
bindsym $mod+$alt+$ws10_key move container to workspace number $ws10; workspace number $ws10
|
||||
|
||||
## Modify // Carry Window to Workspace 11 - 19 // <><Alt><Ctrl> 1..9 ##
|
||||
bindsym $mod+$alt+$ws_high_key+$ws1_key move container to workspace number $ws11; workspace number $ws11
|
||||
bindsym $mod+$alt+$ws_high_key+$ws2_key move container to workspace number $ws12; workspace number $ws12
|
||||
bindsym $mod+$alt+$ws_high_key+$ws3_key move container to workspace number $ws13; workspace number $ws13
|
||||
bindsym $mod+$alt+$ws_high_key+$ws4_key move container to workspace number $ws14; workspace number $ws14
|
||||
bindsym $mod+$alt+$ws_high_key+$ws5_key move container to workspace number $ws15; workspace number $ws15
|
||||
bindsym $mod+$alt+$ws_high_key+$ws6_key move container to workspace number $ws16; workspace number $ws16
|
||||
bindsym $mod+$alt+$ws_high_key+$ws7_key move container to workspace number $ws17; workspace number $ws17
|
||||
bindsym $mod+$alt+$ws_high_key+$ws8_key move container to workspace number $ws18; workspace number $ws18
|
||||
bindsym $mod+$alt+$ws_high_key+$ws9_key move container to workspace number $ws19; workspace number $ws19
|
||||
|
||||
# Layout bindings (matching i3 defaults)
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# 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.
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
###############################################################################
|
||||
# Resize Mode
|
||||
###############################################################################
|
||||
|
||||
## Resize // Enter Resize Mode // <> r ##
|
||||
mode "Resize Mode" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
|
||||
## Resize // Resize Window // ↑ ↓ ← → ##
|
||||
bindsym Left resize shrink width 6 px or 6 ppt
|
||||
bindsym Down resize grow height 6 px or 6 ppt
|
||||
bindsym Up resize shrink height 6 px or 6 ppt
|
||||
bindsym Right resize grow width 6 px or 6 ppt
|
||||
|
||||
bindsym Shift+Left resize shrink width 24 px or 24 ppt
|
||||
bindsym Shift+Down resize grow height 24 px or 24 ppt
|
||||
bindsym Shift+Up resize shrink height 24 px or 24 ppt
|
||||
bindsym Shift+Right resize grow width 24 px or 24 ppt
|
||||
|
||||
## Resize // Resize Window // k j h l ##
|
||||
bindsym $left resize shrink width 6 px or 6 ppt
|
||||
bindsym $down resize grow height 6 px or 6 ppt
|
||||
bindsym $up resize shrink height 6 px or 6 ppt
|
||||
bindsym $right resize grow width 6 px or 6 ppt
|
||||
|
||||
bindsym Shift+$left resize shrink width 24 px or 24 ppt
|
||||
bindsym Shift+$down resize grow height 24 px or 24 ppt
|
||||
bindsym Shift+$up resize shrink height 24 px or 24 ppt
|
||||
bindsym Shift+$right resize grow width 24 px or 24 ppt
|
||||
|
||||
## Resize // Exit Resize Mode // Escape or Enter ##
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+r mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "Resize Mode"
|
||||
|
||||
###############################################################################
|
||||
# Media keys and utilities
|
||||
###############################################################################
|
||||
|
||||
# Volume control (works with both PulseAudio and PipeWire)
|
||||
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/volume-notify-sway.sh
|
||||
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && ~/.config/sway/volume-notify-sway.sh
|
||||
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && ~/.config/sway/volume-notify-sway.sh
|
||||
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
|
||||
# Brightness control
|
||||
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
|
||||
|
||||
# Screenshots
|
||||
bindsym Print exec grim - | swappy -f -
|
||||
bindsym $mod+Print exec grim -g "$(slurp)" - | swappy -f -
|
||||
|
||||
## Modify // Toggle Bar // <> i ##
|
||||
bindsym $mod+i bar mode toggle
|
||||
|
||||
###############################################################################
|
||||
# Bar Configuration
|
||||
###############################################################################
|
||||
|
||||
bar {
|
||||
position bottom
|
||||
mode dock
|
||||
font pango:monospace 10
|
||||
separator_symbol " "
|
||||
strip_workspace_numbers yes
|
||||
workspace_min_width 36
|
||||
|
||||
# Try to use i3status-rust for better functionality, fallback to basic status
|
||||
status_command i3status-rs ~/.config/sway/i3status-rust.toml || while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
|
||||
|
||||
colors {
|
||||
background #000000
|
||||
statusline #ffffff
|
||||
separator #666666
|
||||
|
||||
# border backgr. text
|
||||
focused_workspace #000000 #ffffff #000000
|
||||
active_workspace #000000 #000000 #ffffff
|
||||
inactive_workspace #000000 #000000 #ffffff
|
||||
urgent_workspace #000000 #ff0000 #000000
|
||||
}
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Autostart Applications
|
||||
###############################################################################
|
||||
|
||||
# Start background applications
|
||||
exec --no-startup-id systemctl --user import-environment XDG_CURRENT_DESKTOP DISPLAY WAYLAND_DISPLAY
|
||||
exec --no-startup-id hash dbus-update-activation-environment 2>/dev/null && \
|
||||
dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP DISPLAY WAYLAND_DISPLAY
|
||||
|
||||
# Start essential services (Arch Linux)
|
||||
exec mako # Notification daemon
|
||||
exec lxqt-policykit-agent # Authentication agent (comment out if not needed)
|
||||
|
||||
exec --no-startup-id blueman-applet
|
||||
exec --no-startup-id nm-applet
|
||||
|
||||
# Include additional config files if they exist
|
||||
include /etc/sway/config.d/*
|
||||
86
home_dotfiles/.config/sway/i3status-rust.toml
Normal file
86
home_dotfiles/.config/sway/i3status-rust.toml
Normal file
@@ -0,0 +1,86 @@
|
||||
# Advanced i3status-rust configuration
|
||||
# Based on the i3xrocks blocks from your i3 setup
|
||||
|
||||
[[block]]
|
||||
block = "net"
|
||||
format = " $icon {$signal_strength $ssid $frequency|Wired connection} via $device "
|
||||
interval = 1
|
||||
|
||||
[[block]]
|
||||
block = "cpu"
|
||||
interval = 5
|
||||
format = " $icon $utilization "
|
||||
format_alt = " $icon $frequency{ $boost} "
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
format = " $icon $mem_used_percents.eng(w:2) "
|
||||
interval = 10
|
||||
|
||||
[[block]]
|
||||
block = "battery"
|
||||
device = "BAT0"
|
||||
format = " $icon $percentage $time "
|
||||
interval = 10
|
||||
missing_format = ""
|
||||
|
||||
[[block]]
|
||||
block = "sound"
|
||||
format = " $icon $volume "
|
||||
click = [
|
||||
{button = "left", cmd = "pavucontrol"},
|
||||
{button = "right", cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"},
|
||||
]
|
||||
|
||||
[[block]]
|
||||
block = "bluetooth"
|
||||
mac = ""
|
||||
format = " $icon $label "
|
||||
disconnected_format = ""
|
||||
|
||||
# Custom Bluetooth connected devices block
|
||||
[[block]]
|
||||
block = "custom"
|
||||
command = "~/.config/sway/bluetooth-sway.sh"
|
||||
format = " $text "
|
||||
interval = 10
|
||||
click = [
|
||||
{button = "left", update = true},
|
||||
{button = "right", update = true},
|
||||
]
|
||||
|
||||
# Custom weather block using your wttr.in script
|
||||
# [[block]]
|
||||
# block = "custom"
|
||||
# command = "~/.config/sway/weather-sway.sh"
|
||||
# format = " 🌤 $text "
|
||||
# interval = 1800
|
||||
# click = [
|
||||
# {button = "left", update = true},
|
||||
# {button = "right", update = true},
|
||||
# ]
|
||||
|
||||
# Alternative: Weather with custom location
|
||||
# Uncomment and modify this block if you want weather for a different city
|
||||
[[block]]
|
||||
block = "custom"
|
||||
command = "~/.config/sway/weather-sway.sh"
|
||||
format = "$text"
|
||||
interval = 1800
|
||||
|
||||
# Alternative: Weather with different format
|
||||
# Format options: https://github.com/chubin/wttr.in
|
||||
# 1 = current conditions, 2 = current + today, 3 = current + today + tomorrow, 4 = current + 3 days
|
||||
# [[block]]
|
||||
# block = "custom"
|
||||
# command = "weather_format='2' ~/.config/sway/weather-sway.sh"
|
||||
# format = " 📅 $text "
|
||||
# interval = 1800
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
format = " $icon $timestamp.datetime(f:'%Y-%m-%d %H:%M:%S') "
|
||||
interval = 1
|
||||
|
||||
[icons]
|
||||
icons = "awesome4"
|
||||
14
home_dotfiles/.config/sway/volume-notify-sway.sh
Executable file
14
home_dotfiles/.config/sway/volume-notify-sway.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Kill any existing volume notification
|
||||
pkill -f "notify-send.*Volume"
|
||||
|
||||
# Get current volume and mute status
|
||||
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | awk '{print $5}')
|
||||
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
|
||||
|
||||
if [ "$muted" = "yes" ]; then
|
||||
notify-send -t 1000 "Volume" "Muted"
|
||||
else
|
||||
notify-send -t 1000 "Volume" "$volume"
|
||||
fi
|
||||
55
home_dotfiles/.config/sway/weather-sway.sh
Executable file
55
home_dotfiles/.config/sway/weather-sway.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -Eeu -o pipefail
|
||||
|
||||
# Simplified weather script for i3status-rust
|
||||
# Based on the original weather script but adapted for Sway/i3status-rust
|
||||
|
||||
# Information on the various formats: https://github.com/chubin/wttr.in
|
||||
VALUE_WEATHER_FORMAT=${weather_format:-"%c%f"}
|
||||
VALUE_WEATHER_FORMAT="?format=${VALUE_WEATHER_FORMAT}"
|
||||
|
||||
# Determine units to use for temperature
|
||||
# We don't supply a default here because wttr.in is "smart" enough to choose for us
|
||||
WEATHER_UNIT=${weather_unit:-""}
|
||||
if [ -n "${WEATHER_UNIT}" ]; then
|
||||
WEATHER_UNIT="&${WEATHER_UNIT}"
|
||||
fi
|
||||
|
||||
# Location (defaults to Pärnu as in your original script)
|
||||
VALUE_WEATHER_LOCATION=${weather_location:-"Pärnu"}
|
||||
VALUE_WEATHER_ERROR_MESSAGE=${error_message:-"⛔"}
|
||||
VALUE_FETCH_WEATHER_URL="https://wttr.in/${VALUE_WEATHER_LOCATION}${VALUE_WEATHER_FORMAT}${WEATHER_UNIT}"
|
||||
|
||||
# Get weather data
|
||||
WEATHER=$(curl -sS "$VALUE_FETCH_WEATHER_URL" 2>/dev/null || echo "${VALUE_WEATHER_ERROR_MESSAGE}")
|
||||
|
||||
# Get sunrise/sunset data
|
||||
VALUE_SUNSET_SUNRISE_FORMAT="?format=%S-%s%20%m+"
|
||||
SUNRISE_SUNSET=$(curl -sS "https://wttr.in/${VALUE_WEATHER_LOCATION}${VALUE_SUNSET_SUNRISE_FORMAT}${WEATHER_UNIT}" 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$SUNRISE_SUNSET" ]; then
|
||||
SUNRISE_VALUE=$(echo ${SUNRISE_SUNSET} | cut -c 1-5)
|
||||
SUNSET_VALUE=$(echo ${SUNRISE_SUNSET} | cut -c 10-14)
|
||||
SUNRISE_SUNSET_TEXT=" (${SUNRISE_VALUE}-${SUNSET_VALUE})"
|
||||
else
|
||||
SUNRISE_SUNSET_TEXT=""
|
||||
fi
|
||||
|
||||
# Check for errors
|
||||
if echo "${WEATHER}" | grep -q -P "Unknown\slocation"; then
|
||||
WEATHER=${VALUE_WEATHER_ERROR_MESSAGE}
|
||||
fi
|
||||
|
||||
# Output for i3status-rust (plain text)
|
||||
echo "${WEATHER}${SUNRISE_SUNSET_TEXT}"
|
||||
|
||||
# Handle click events (for i3status-rust custom block)
|
||||
if [ "${BLOCK_BUTTON:-}" = "1" ]; then
|
||||
# Left click - show detailed weather
|
||||
FULL_WEATHER=$(curl -sS "https://wttr.in/${VALUE_WEATHER_LOCATION}?format=%l:+%c+%f+%h+%p+%P+%m+%w+%S+%s" 2>/dev/null || echo "${VALUE_WEATHER_ERROR_MESSAGE}")
|
||||
notify-send "Weather Details" "$FULL_WEATHER" -t 10000
|
||||
elif [ "${BLOCK_BUTTON:-}" = "3" ]; then
|
||||
# Right click - open weather website
|
||||
xdg-open "https://wttr.in/${VALUE_WEATHER_LOCATION}" >/dev/null 2>&1 &
|
||||
fi
|
||||
Reference in New Issue
Block a user