in ♥️ with linux

niri

As a former mac user, I always liked the dock. Since I am now back at niri, I wanted to have not only a statusbar (with waybar), but also a kind of dock again.

As I now had a lot of experience with customising the waybar, it made sense to convert it into a kind of dock.

One quickly reaches the limitations of waybar, but with 1-2 tricks I can be quite satisfied (at the moment).

DotFiles:

You can find the whole setup in my dotfiles on codeberg: https://codeberg.org/Nasendackel/dotfiles

Step 1: A “Start” Menu

You need to create a custom module that accesses an XML file. The commands are specified in the config of waybar and the XML provides the menu structure in GTK.

waybar conf:

"custom/startmenu": {
    "format" : " ",
    "tooltip": false,
    "menu": "on-click",
    "menu-file": "~/.config/waybar/startmenu.xml",
    "menu-actions": {
		"about": "~/.config/niri/bin/about.sh",
		"info": "resources",
        	"shutdown": "systemctl poweroff",
        	"reboot": "systemctl reboot",
		"suspend": "systemctl suspend",
		"lock": "swaylock -f",
    },
},

startmenu.xml:

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu" id="menu">
 	<child>
		<object class="GtkMenuItem" id="about">
			<property name="label"> About</property>
    		</object>
	</child>
	<child>
		<object class="GtkMenuItem" id="info">
			<property name="label"> Ressources</property>
    		</object>
	</child>
	<child>
      		<object class="GtkSeparatorMenuItem" id="delimiter1"/>
    	</child>
    	<child>
		<object class="GtkMenuItem" id="lock">
			<property name="label"> Lock Screen</property>
        	</object>
	</child>
	<child>
        	<object class="GtkMenuItem" id="suspend">
			<property name="label"> Suspend</property>
        	</object>
	</child>
   	<child>
        	<object class="GtkMenuItem" id="reboot">
			<property name="label">󰑓 Reboot</property>
        	</object>
    	</child>
  	<child>
        	<object class="GtkMenuItem" id="shutdown">
			<property name="label">  Shutdown</property>
        	</object>
	</child>
</object>
</interface>

Step 2: Taskbar Module

The taskbar module lists all open apps. Unfortunately, you can only create shortcuts or list open apps with the Waybar. A classic dock is not possible. However, since I have assigned all important apps to shortcuts, only the display of open apps is sufficient for me.

It is important to set ‘sort-by-app-id’ to true so that the apps are grouped and sorted accordingly (see Step 4).

waybar conf:

"wlr/taskbar": {
	"format": "{icon}",
	"icon-theme": "Papirus",
	"icon-size": 32,
	"on-click": "minimize-raise",
	"active-first": false,
	"sort-by-app-id": true,
	"app_ids-mapping": {
		"kitty": "10_kitty",
		"librewolf": "20_librewolf",
		"firefox": "21_firefox",
		"chromium-browser": "23_chromium",
		"thunderbird-esr": "30_thunderbird",
		"dev.geopjr.Tuba": "31_tuba",
		"org.gnome.Fractal": "32_fractal",
		"signal": "33_signal",
	},
},

Step 3: Style

CSS is great because I understand it. The waybar and its modules can be customised easily.

waybar style.css:

#custom-startmenu {
  font-size: 24px;
  background-position: 6px center;
  background-repeat: no-repeat;
  background-size: 38px;
  border-style: hidden;
  padding:6px 20px 4px 20px;
  border-radius:1rem;
  background-image: url('niri-icon2.svg');
  background-color: @accent;
  margin:0 0 0 4px;
  border-bottom: 2px solid transparent;
}

#custom-startmenu:hover {
  background-image: url('niri-icon0.svg');
}

#taskbar {
  margin:0;
}

#taskbar button {
  font-size: 24px;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 32px;
  border-style: hidden;
  padding:6px 8px 4px 8px;
  margin:0 0 0 12px;
  background-color: @theme_base_color;
  border-radius: 1rem;
  border-bottom: 2px solid transparent;
}

#taskbar button.active {
  border-bottom: 2px solid @accent;
}

#taskbar button:hover {
  border-bottom: 2px solid @accent;
}

Step 4: Sorting icons

Now it's getting dirty. Sorting / grouping by app-id has the disadvantage that waybar here goes bluntly by alphabet. But I would like to sort by the workspaces ... is not possible!

So a little trick ... Rename the app-id with a numbering. I follow the assignment in config.kdl in niri. Terminal is always on workspace 1, browser on 2 and everything with communication on workspace 3. (See step 2).

But now there is another problem. By renaming the app, the waybar can no longer find the icon.

This means that .local/share/applications according .desktop files with the same name must be created.

Example 10_kitty.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=kitty
Icon=utilities-x-terminal
NoDisplay=true

NoDisplay=true is important to not display it in dmenu (like rofi).

#opensuse #niri #wayland

We had a great pleasure to meet Ivan, the main developer of Niri. Niri is a tilling window manager for Wayland, where the user interface is not new, but Ivan is constantly expanding the concept with great interesting possibilities and functions. With the effect that the fan community is getting bigger and bigger.

In the interview together with our guest Christian, we were able to ask few questions to emphasize the aspect of what it means to be an independent open source software developer in addition to the technology discussions.

The first idea was that this interview should be part of our next regular episode. But Christoph also had the idea of separating it to reach English-speaking listeners as well, rather than just our German listeners. And this is the reason for this special.

We recorded our interview outside on the terrace in beautiful weather. However, a bad weather front kept us very busy until the end. The effect was that we were accompanied by twittering of birds and strong rain and wind noises. But that didn't affect the interview in any way. Gordon would say we had atmosphere 😀.

So be part of what we think is an interesting interview and have fun to listening.

It was an exciting interview for me as a Niri user. You can find the interview at Trommelspeicher or on the Triumvirat podcast in all podcast directories.

#niri #podcast

A what? What is a scrollable-tiling compositor?

The beauty of Linux is the choice. You are not restricted to just one distribution, but also not restricted to one user interface. KDE or Gnome are certainly well known and there is a dispute as to which is the best interface. Then there is sway or Hyprland for the keyboard enthusiasts.

After using sway for a while, I have now discovered Niri.

Niri is a scrollable-tiling Wayland compositor written in Rust. In my opinion, the relatively young system (the first release is from March 2024) is already very stable.

What does that mean? Well, let me quote Niri's github page:

Windows are arranged in columns on an infinite strip going to the right. Opening a new window never causes existing windows to resize. Every monitor has its own separate window strip. Windows can never “overflow” onto an adjacent monitor. Workspaces are dynamic and arranged vertically. Every monitor has an independent set of workspaces, and there's always one empty workspace present all the way down. The workspace arrangement is preserved across disconnecting and connecting monitors where it makes sense. When a monitor disconnects, its workspaces will move to another monitor, but upon reconnection they will move back to the original monitor.

My personal highlights in Niri from the perspective of a non-professional Linux user:

  • stability
  • fractual scaling with beautiful font rendering
  • simple configuration file
  • helpful community ( including via Matrix)

Basically, however, I particularly like the approach that apps on each workspace are located next to each other as a band and the width of the apps can be customised. This is extremely practical for working with two or three apps in parallel. The width can be quickly adjusted using a key combination. Very clearly structured.

A screenshot tool is also built in and I can also hide windows via a rule for screencasts. X programme (like Steam) run wonderfully via xsatellite, waybar already has modules for Niri ... so the future looks good.

#niri