setup for sway archlinux using nvim, foot and swaybg to make fastfetch as background image
- User
setup for sway archlinux using nvim, foot and swaybg to make fastfetch as background image
- Assistant
To set up Sway on Arch Linux using Neovim, the Foot terminal, and Swaybg with FastFetch for a background image, follow these steps.
Requirements
- Arch Linux installed.
- Sway (Wayland compositor).
- Neovim (Text Editor).
- Foot (Terminal emulator).
- FastFetch (for gathering and displaying system information).
Step 1: Install Required Packages
Make sure you have
sway,neovim,foot, andfastfetchinstalled. You can install them usingpacmanor an AUR helper likeyay.sudo pacman -S sway neovim foot fastfetch swaybgIf you're using an AUR helper like
yay, you can add:yay -S fastfetchStep 2: Configure Sway
Create a configuration file for Sway. This usually goes in
~/.config/sway/config.mkdir -p ~/.config/sway nano ~/.config/sway/configHere’s a minimal configuration file to get started:
# Specify the Wayland display server set $mod Mod4 # This is usually the super (Windows) key # Background using swaybg and FastFetch exec swaybg -i /path/to/your/background/image.png -m fill # Replace with your image path and method # Start FastFetch exec_always --no-startup-id fastfetch # Define key bindings bindsym $mod+Return exec foot # Open Foot terminal bindsym $mod+d exec dmenu_run # Use dmenu for application launcher bindsym $mod+Shift+e kill # Exit Sway # Other Sway configurations...Step 3: Generate the Background Image with FastFetch
You can use FastFetch to generate a background image. It typically outputs to the terminal, but you can redirect it to an image file. Here is a method to create a background image using FastFetch in a script:
- Create a script called
generate_bg.sh.
touch ~/generate_bg.sh chmod +x ~/generate_bg.sh- Add the following script to generate an image:
#!/bin/bash # Create output directory if it doesn't exist output_dir="$HOME/.config/sway/backgrounds" mkdir -p "$output_dir" # Generate background using FastFetch fastfetch --image <your-image-path> -o "$output_dir/fastfetch.png" # Specify the desired image path # Set this file as the background swaybg -i "$output_dir/fastfetch.png" -m fill &Step 4: Run the Script on Sway Startup
Modify your Sway config to run this script:
exec_always --no-startup-id ~/generate_bg.shStep 5: Launch Sway
Log out from your current session and switch to a Wayland session with Sway. You can generally choose Sway from your login manager.
Step 6: Test Functionality
- Open Foot terminal by pressing
Mod + Enter. - Run commands in Neovim by executing
nvimin your terminal. - You should see FastFetch running as a background image.
Summary
This guide provided a way to set up Sway with Neovim and Foot, using FastFetch for a dynamic background image. You can customize the FastFetch parameters and the Sway configuration as needed for your preferences. Make sure to adapt the image paths and options based on your own setups. Enjoy your new environment!