Hyprland Quick-Start Guide Part 2: Enhancing Your Setup with Advanced Features

Hyprland is not just a tiling window manager; it’s a gateway to a highly customized and efficient Linux environment. In this second part of our guide, let’s explore some advanced features to enhance your Hyprland setup.

In the previous part, we’ve covered the basics of setting up and configuring Hyprland. We’ve done a lot of work, and it would be a shame to lose it. So, first, let’s start by saving our configurations using GNU Stow in a GitHub repository.


Managing Dotfiles with GNU Stow and GitHub

Note: Dotfiles are the configuration files that we have created in the ~/.config directory.

Keeping your configuration files (dotfiles) organized and synced across machines can be a challenge. Enter GNU Stow, a symlink farm manager that makes managing dotfiles nice and easy.

Step 1: Install GNU Stow

First, install GNU Stow using your package manager:

sudo pacman -S stow

Step 2: Organize Your Dotfiles

Create a directory to store your dotfiles. We’ll use ~/.dotfiles:

mkdir ~/.dotfiles

Let’s move our configuration files to ~/.dotfiles:

mv ~/.config/hypr ~/.config/waybar ~/.config/kitty ~/.dotfiles

Your dotfiles directory should now look like this:

~/.dotfiles/
├── .config
│   ├── hypr
│   │   └── hyprland.conf
│   ├── waybar
│   │   ├── config.jsonc
│   │   └── style.css
│   └── kitty
│       └── kitty.conf
└── Pictures
    └── Wallpapers
        ├── 4k-abstract-25562.jpg
        └── lock_wallpaper.png

Navigate to your dotfiles directory and use Stow to create symlinks:

cd ~/.dotfiles
stow .

This will create symlinks in your home directory pointing to the files in ~/.dotfiles.

Step 4: Initialize a Git Repository

Initialize a Git repository in your dotfiles directory and push it to GitHub:

cd ~/.dotfiles
git init
git remote add origin https://github.com/${USER}/dotfiles.git
git add .
git commit -m "Initial commit of dotfiles"
git push -u origin master

Note: Replace ${USER} with your GitHub username.

Now, your dotfiles are version-controlled and stored on GitHub for easy access and synchronization.


Customizing Hyprland with the Catppuccin Theme

Let’s enhance the visual appeal of your desktop with theming and styling. My personal favorite is the Catppuccin Mocha theme. It’s available for most of the components used in our Hyprland setup and allows you to create a cohesive experience for your applications, making your setup not just functional but also aesthetically pleasing.

Step 1: Get the Catppuccin Theme for Hyprland

Go to Catppuccin Hyprland Releases and grab the zip file. Unzip it and copy the theme files to ~/.dotfiles/.config/hypr/themes/catppuccin/ directory:

mkdir -p ~/.dotfiles/.config/hypr/themes/catppuccin
cp -r ~/hyprland-catppuccin/themes/* ~/.dotfiles/.config/hypr/themes/catppuccin/

Note: Replace hyprland-catppuccin with your unzipped folder name.

Now we’ll need to run the stow command again to create symlinks for the theme files:

cd ~/.dotfiles
stow .

Step 2: Apply the Theme to Hyprland

Edit your Hyprland configuration file ~/.config/hypr/hyprland.conf to include the theme. I like to use the Mocha variant:

# Include the Catppuccin theme
source = ~/.config/hypr/themes/catppuccin/mocha.conf

Now let’s use the theme in our Hyprland setup and change some colors. The color variables are defined in the Catppuccin theme file and are used like this: $maroon for non-alpha channel color values and rgba($COLORAlpha<transparency>), e.g., rgba($maroonAlphaee) for alpha channel color values.

# Under the general section in hyprland.conf
general {
    ...
    col.active_border = rgba($maroonAlphaee) rgba($mauveAlphaee) 45deg
    col.inactive_border = rgba($baseAlphaaa)
    ...
}

# Under the decoration section in hyprland.conf
decoration {
    ...
    shadow {
        enabled = true
        range = 4
        render_power = 3
        color = rgba($mantleAlphaee)
    }
}

Step 3: Install Meslo Nerd Font

Let’s start by installing the Meslo Nerd Font:

sudo pacman -S ttf-meslo-nerd-font-powerlevel10k

Step 4: Install the Theme for Waybar

Clone the Catppuccin theme for Waybar:

mkdir -p ~/waybar/catppuccin
git clone https://github.com/catppuccin/waybar.git ~/waybar/catppuccin

Copy the Catppuccin themes to your Waybar configuration:

mkdir -p ~/.dotfiles/.config/waybar/catppuccin
cp ~/waybar/catppuccin/styles/* ~/.dotfiles/.config/waybar/catppuccin/

# Run stow to create symlinks again
cd ~/.dotfiles
stow .

Edit your Waybar style file ~/.config/waybar/style.css to include the theme:

@import url("catppuccin/mocha.css");

Ensure this line is at the top of your style.css file.

Now let’s also set our newly installed font as the default font in our style.css file:

* {
    font-family: "MesloLGS NF";
}

Now you can play with the Catppuccin theme colors in your Waybar setup, for example:

#custom-music,
#tray,
#backlight,
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#network,
#pulseaudio,
#language,
#power-profiles-daemon,
#custom-lock,
#custom-power {
    background-color: @surface0;
    padding: 0.5rem 1rem;
    margin: 0;
}

#clock {
    color: @blue;
}

Step 5: Theming Wofi

The situation with Wofi is a bit different since it doesn’t have an official Catppuccin theme and the documentation is lacking. We need to get creative here. After a bit of searching, I found this Wofi Theme Repo that uses the Catppuccin color scheme for Wofi and took it as inspiration with some adjustments.

The files that we need from the repo are the config/config and src/mocha/style.css files.

Create a folder ~/.dotfiles/.config/wofi and save these files there. (You will need to run the stow command again to create the symlinks.)

You can find my version in my dotfiles repo.

Step 6: Install the Theme for Kitty

Let’s create a config file for Kitty in our dotfiles folder:

mkdir -p ~/.dotfiles/.config/kitty/
touch ~/.dotfiles/.config/kitty/kitty.conf
cd ~/.dotfiles
stow .

This will create a config file in ~/.config/kitty/kitty.conf.

Now let’s add some customizations to the config file:

font_family MesloLGS NF
background_opacity 0.7

tab_bar_min_tabs            1
tab_bar_edge                bottom
tab_bar_style               powerline
tab_powerline_style         slanted

For Kitty theming, we use a kitten, which is a Kitty-specific “plugin” system. You can read more about it here. To install the theme, run the following command:

kitty +kitten themes --reload-in=all Catppuccin-Mocha

This will install the theme and reload Kitty. It will create the theme section in your Kitty config file like this:

# BEGIN_KITTY_THEME
# Catppuccin-Mocha
include current-theme.conf
# END_KITTY_THEME

Do not touch this section and add your customizations above it.


Step 7: Enjoy Your Themed Desktop

Your desktop environment should now have a consistent and visually appealing look, thanks to the Catppuccin theme. The cohesive color palette and design elements create a pleasant user experience.


Making Notifications Beautiful with Sway Notification Center (swaync)

While Mako is a lightweight notification daemon, swaync offers a more feature-rich notification center similar to those found in desktop environments like GNOME or KDE, providing a better user experience and better integration with Hyprland.

Step 0: Remove Mako

sudo pacman -R mako

Step 1: Install swaync

Install swaync from the AUR (since it’s not in the official repositories):

yay -S swaync

Step 2: Autostart swaync

Edit your Hyprland configuration file ~/.config/hypr/hyprland.conf and replace the Mako autostart line:

# Remove the Mako line if you have it
# exec-once = mako

# Add swaync to autostart
exec-once = swaync

Step 3: Catppuccin Theme for swaync

Download your favorite Catppuccin flavor for swaync from GitHub and save it to ~/.dotfiles/.config/swaync/ directory as style.css.

Update the font-family inside the style.css file to MesloLGS NF.

Run the stow command again to create symlinks for the theme file:

cd ~/.dotfiles
stow .

Setting Up Screen Sharing with PipeWire

Screen sharing on Wayland can be tricky, but with PipeWire, WirePlumber, and xdg-desktop-portal-hyprland, it’s smooth sailing.

Step 1: Install Necessary Packages

sudo pacman -S pipewire wireplumber xdg-desktop-portal-hyprland

Step 2: Test Screen Sharing

Use an application like OBS Studio or Firefox to test screen sharing. It should now work seamlessly.


Setting Up Authentication Agent with hyprpolkitagent

For authentication dialogs (like when installing packages), you’ll need an authentication agent.

Step 1: Install hyprpolkitagent

yay -S hyprpolkitagent

Step 2: Enable hyprpolkitagent

Enable and start the service:

systemctl --user enable --now hyprpolkitagent

Now, authentication dialogs should appear when required.


Setting Up Bluetooth with BlueZ and Blueman

Bluetooth support allows you to connect peripherals like headphones, keyboards, and mice.

Step 1: Install BlueZ and Blueman

sudo pacman -S bluez blueman

Step 2: Enable and Start Bluetooth Service

sudo systemctl enable --now bluetooth

Step 3: Autostart Blueman Applet

In your Hyprland configuration file ~/.config/hypr/hyprland.conf, add:

exec-once = blueman-applet

You should now see the Bluetooth icon in your system tray, allowing you to manage Bluetooth devices.


Keeping Your System Updated with arch-update

Staying on top of system updates is crucial for security and performance. The arch-update utility provides a convenient tray icon that notifies you of available updates, integrating seamlessly with your Hyprland setup.

Step 1: Install arch-update

First, install arch-update from the AUR using your preferred AUR helper. We’ll use yay in this example:

yay -S arch-update

Step 2: Autostart arch-update Tray

In your hyprland.conf, add the exec-once line for arch-update:

exec-once = arch-update --tray

Then, to monitor updates, run the following command:

systemctl --user enable --now arch-update.timer

Step 3: Verify the Tray Icon

After enabling the service, you should see an update notification icon appear in your system tray. It will alert you whenever new updates are available.

Step 4: Configure arch-update

You can customize arch-update settings by editing its configuration file located at ~/.config/arch-update/arch-update.conf. Adjust options like check intervals and notification preferences to suit your needs.

mkdir -p ~/.config/arch-update/
cp /usr/share/arch-update/config/arch-update.conf.example ~/.config/arch-update/arch-update.conf

Example configuration:

#NoColor
#NoVersion
AlwaysShowNews
#NewsNum=5
AURHelper=yay
#PrivilegeElevationCommand=sudo
#KeepOldPackages=3
#KeepUninstalledPackages=0
#DiffProg=$DIFFPROG
#TrayIconStyle=light

Wrapping Up

By integrating these advanced features, your Hyprland setup becomes more powerful and visually appealing. Managing dotfiles with GNU Stow keeps your configurations organized and portable. Replacing Mako with swaync enhances your notification experience, and setting up screen sharing, authentication agents, and Bluetooth support adds to the functionality of your system. Updating your fonts and applying a cohesive theme ties everything together.


Components Used:

  • GNU Stow: Manages dotfiles efficiently.
  • swaync: A feature-rich notification center.
  • PipeWire, WirePlumber, xdg-desktop-portal-hyprland: Enables screen sharing.
  • hyprpolkitagent: Provides authentication dialogs.
  • BlueZ and Blueman: Adds Bluetooth support.
  • Meslo Nerd Font: Enhances terminal and status bar fonts.
  • Catppuccin Mocha Theme: Styles Hyprland, Waybar, Wofi, and Kitty for a cohesive look.
  • arch-update: Keeps your system updated with a tray icon.

Happy Customizing!


Disclaimer: This guide is provided for educational purposes. Please ensure you have backups and understand each step before proceeding.


comments powered by Disqus