~/.config/scripts/ and handle autostarting applications, layout management, and wallpaper configuration.
Available Scripts
autostart.sh
Automatically launches applications in specific workspaces when Sway starts. Location:~/.config/scripts/autostart.sh
Features
- Launches Firefox in workspace 1
- Opens VSCode in workspace 2
- Starts Kitty terminal in workspace 3
- Includes error handling and notifications
Usage
Add to your Sway config to run on startup:How It Works
1
Delay Startup
Waits 2 seconds for Sway to fully initialize
2
Check Dependencies
Verifies
swaymsg is available3
Launch Applications
Opens each application in its designated workspace with 1-second delays between launches
mode-hacker.sh
Creates a “hacker” layout with a terminal, clock, and audio visualizer. Location:~/.config/scripts/mode-hacker.sh
Features
- Creates a three-pane layout
- Left pane: Full-height Kitty terminal
- Right top: TTY-clock display
- Right bottom: Cava audio visualizer
Usage
Bind to a keyboard shortcut in your Sway config:Layout Description
Customization
You can modify the clock appearance by changing thetty-clock parameters:
-c: Center the clock-C 4: Set color (0-7 for different colors)-t: Display time only (no date)-D: Display date only (no time)
setwallpaper.sh
Sets or restores the wallpaper usingswaybg.
Location: ~/.config/scripts/setwallpaper.sh
Features
- Reads wallpaper path from config file
- Falls back to default wallpaper if not found
- Uses solid color as last resort
- Automatically kills existing
swaybgprocess
Usage
Run manually or add to Sway config:How It Works
1
Read Config
Reads wallpaper path from
~/.config/sway/wallpaper2
Check File
Verifies the wallpaper file exists
3
Apply Wallpaper
Kills existing swaybg and launches with new wallpaper
4
Fallback
Uses default wallpaper or solid color if configured wallpaper not found
Wallpaper Modes
swaybg supports several scaling modes:
fill: Scale to fill the screen (default)fit: Scale to fit within screenstretch: Stretch to fill screencenter: Center image without scalingtile: Tile image across screen
Integration with Sway Config
Add all scripts to your~/.config/sway/config:
Troubleshooting
Script Not Executing
Ensure scripts have execute permissions:Applications Not Launching
Check if the applications are installed:Wallpaper Not Loading
Verifyswaybg is installed:
Creating Custom Scripts
You can create your own scripts following the same patterns:Always use error handling and notifications to help debug issues.