Skip to content
The Chat Archive
gpt-4o-mini-2024-07-18· OpenAI WildChat-4.8M (AI2)

how to setup wob in archlinux sway

  1. User

    how to setup wob in archlinux sway

  2. Assistant

    Setting up WOB (a lightweight window overlay for displaying information on your desktop) in Arch Linux with the Sway window manager involves several steps. Below is a general guide to get you started.

    Prerequisites

    1. Arch Linux Installed: Ensure you have Arch Linux installed and configured with Sway.

    2. Sway Installed: Ensure you have Sway installed. You can install it using:

      sudo pacman -S sway
      
    3. Dependencies for WOB: You may need some libraries. Install the following:

      sudo pacman -S git gcc make pkg-config
      sudo pacman -S libx11 libxrender xorg-xrdb
      

    Step 1: Install WOB

    You can install WOB from the AUR (Arch User Repository) using an AUR helper like yay. If you don't have an AUR helper, you can install it manually.

    Using yay

    1. First, install yay if you haven't done so yet:

      sudo pacman -S yay
      
    2. Now install WOB:

      yay -S wob
      

    Manual Installation

    If you prefer a manual installation, clone the WOB repository and build it:

    git clone https://github.com/sirjofri/wob.git
    cd wob
    make
    sudo make install
    

    Step 2: Configure WOB

    WOB can be configured using flags. You can create a script to manage the display of WOB using various options. Below is a basic example script that you can customize:

    Create a file named wob.sh in your home directory:

    nano ~/wob.sh
    

    Paste the following example script into the file:

    #!/bin/bash
    
    # Example script to run WOB
    # Customize the value displayed below, such as CPU or memory usage
    
    value=$(free -h | grep Mem | awk '{print $3}')
    max=$(free -h | grep Mem | awk '{print $2}')
    
    echo -e "$value / $max" | wob -x 100 -y 100 -s 50
    

    Make the script executable:

    chmod +x ~/wob.sh
    

    Step 3: Running WOB with Sway

    You can integrate WOB into your Sway session by modifying your Sway config file.

    1. Open your Sway configuration file located at ~/.config/sway/config.

    2. Add the following line to run your wob.sh script:

    exec --no-startup-id ~/wob.sh
    
    1. Save the file and restart Sway (usually by pressing $mod+Shift+e and confirming).

    Step 4: Customizing WOB

    You can customize how WOB looks and behaves through its command-line options. Some useful options include:

    • -x X and -y Y: to position WOB on the screen.
    • -s SIZE: to set the size of the WOB window.
    • --bg-color and --fg-color: to set background and foreground colors.

    For more detailed usage, you can run:

    man wob
    

    Conclusion

    With these steps, you should have WOB running under Sway on your Arch Linux installation. You can customize the output to show whatever information you need. Adjust your script accordingly for other metrics (like CPU usage, battery status, etc.) depending on your requirements.