Month: August 2024

  • Scratching an itch feels good

    Yesterday afternoon I had a real itch to scratch, the nichest of niches of itches.

    When I sit down to start recording a live coding video for my YouTube channel, after opening OBS Studio, I normally hit a button on my Elgato Stream Deck to fire off a script that does the following:

    • Checks that OBS is running.
    • Sends a desktop notification that recording is starting.
    • Switches scene in OBS to a plain background.
    • Sleeps for a second.
    • Starts the recording in OBS.
    • Switches scene in OBS to run the intro video.
    • Sleeps for 4 seconds while the video runs.
    • Pauses all notifications so that they do not pop up on screen.
    • Switches scene in OBS to show the desktop with my ugly mug in the bottom right.

    This is what my obs-start-rec.sh script looked like:

    #!/usr/bin/env bash
    
    pidof obs &>/dev/null
    if [ $? -gt 0 ]
    then
            echo "OBS isn't running."
            exit 1
    fi
    
    notify-send -u low "Starting recording..."
    obs-cmd scene switch "Background"
    sleep 1
    obs-cmd recording start
    obs-cmd scene switch "Intro"
    sleep 4
    dunstctl set-paused true; pkill -SIGRTMIN+10 i3blocks
    obs-cmd scene switch "Desktop+Me-Right"
    

    This has worked well for me for years, however, I recently switched all my machines one by one to Solus, including my desktop PC which I use for recording videos on.

    And then I switched to Solus

    My YouTube Channel

    I use the Budgie Desktop version of Solus, which is awesome by the way, but of course, that means the penultimate line in the above script that tells the dunst notifications daemon to pause notifications, and then refresh the i3blocks display (so I can see the notifications bell icon has changed status) no longer works. dunst and i3blocks are what I used previously when using the i3 window manager on NixOS, with Budgie Desktop neither of those applications are needed.

    Budgie Desktop has a nice notifications system, which you can control from the Raven sidebar area, including turning on "Do Not Disturb". There's also a notifications bell icon in the system tray, clicking it opens Raven so you can see the notifications.

    Unfortunately, I was unable to find a way to programmatically turn on Budgie Desktop's Do Not Disturb setting, or even set a keyboard shortcut. I asked in the Solus forums too, but there was no response.

    Do not disturb keyboard shortcut in Budgie? (Solus Forums)

    So yesterday afternoon, I had a little poke around in the DBus services using D-Spy to see if there was anything related to notifications in there, and sure enough, there I found an org.budgie_desktop.Notifications object, with a very interesting org.buddiesofbudgie.budgie.Dispatcher interface.

    That org.buddiesofbudgie.budgie.Dispatcher interface has a single NotificationsPaused property, a few signals, but most handy for me, two methods, GetDoNotDisturb and ToggleDoNotDisturb.

    Having already built a DBus service server and clients for Snippet Expander, it wasn't too daunting for me to consider whipping up a little CLI application in Go that would allow me to toggle the Do Not Disturb setting in Budgie Desktop. So I did.

    https://git.sr.ht/~ianmjones/budgie-do-not-disturb-status

    As I started to look into creating budgie-do-not-disturb-status, and my mind turned to what I should call the application while setting things up for development, I did check with the BuddiesOfBudgie developers via their Matrix channel to make sure the name was ok to use. I got the ok from Joshua Strobal, which was very kind.

    That was a pleasant afternoon of development, and now my obs-start-rec.sh script looks like the following:

    #!/usr/bin/env bash
    
    pidof obs &>/dev/null
    if [ $? -gt 0 ]
    then
            echo "OBS isn't running."
            exit 1
    fi
    
    notify-send -u low "Starting recording..."
    obs-cmd scene switch "Background"
    sleep 1
    obs-cmd recording start
    obs-cmd scene switch "Intro"
    sleep 4
    budgie-do-not-disturb-status on
    obs-cmd scene switch "Desktop+Me-Right"
    

    Naturally, I have an obs-stop-rec.sh script too:

    #!/usr/bin/env bash
    
    pidof obs &>/dev/null
    if [ $? -gt 0 ]
    then
            echo "OBS isn't running."
            exit 1
    fi
    
    obs-cmd scene switch "Outro"
    sleep 1
    budgie-do-not-disturb-status off
    notify-send -u low "Stopping recording..."
    sleep 9.5
    obs-cmd recording stop
    notify-send -u low "Stopped recording."
    

    I've also added a custom "Toggle Do Not Disturb" keyboard shortcut activated with Shift+Super+N that runs the following command:

    budgie-do-not-disturb-status toggle
    

    It's quite handy to have that shortcut.

    Solus Packaging

    I've submitted a Solus package request for budgie-do-not-disturb-status in the hope that I can then submit the package that I've already got created and am using on my machines.

    https://github.com/getsolus/packages/issues/3607

    https://github.com/ianmjones/packages/tree/budgie-do-not-disturb-status-1.0.1/packages/b/budgie-do-not-disturb-status

    I've already put in a few other Solus package requests for some utilities I use all the time. For each one I've indicated that I'm happy to be the maintainer too, and have already got a package spec ready. Packaging an application for Solus is very straight forward compared to some other distros and package formats, and the documentation is top notch.

    Creating a New Package (Solus Help Center)

    Someone had already submitted a package request for the Gleam language that was accepted, so I was able to get a package created for that, submit the PR, and after a couple of fixups (great learning experience), the PR was merged and now the Gleam language is available in Solus.

    https://discuss.getsol.us/d/10848-sync-updates-for-week-33-2024

    Once a couple of my package requests have hopefully been accepted, and I've been able to get the packages into the Solus packages repo, I should be in a position to do the same for Snippet Expander, which has a dependency on a couple of those packages, and plenty others already in Solus, so will be a bit more of a meaty package to create.

    I already have Snippet Expander built and installed manually on my Solus machines, it's working very well, I just need to create the package for it, which will be another itch scratched.

  • And then I switched to Solus

    A couple of weeks ago I wrote that after a mini distro hopping session I ended up just settling on on Ubuntu Desktop for use on my Framework Laptop 13.

    Switched from NixOS to Ubuntu Desktop on my Framework Laptop 13

    Well, a couple of weeks later, I've switched to Solus.

                -```````````
              `-+/------------.`
           .---:mNo---------------.
         .-----yMMMy:---------------.
       `------oMMMMMm/----------------`
      .------/MMMMMMMN+----------------.
     .------/NMMMMMMMMm-+/--------------.
    `------/NMMMMMMMMMN-:mh/-------------`
    .-----/NMMMMMMMMMMM:-+MMd//oso/:-----.
    -----/NMMMMMMMMMMMM+--mMMMh::smMmyo:--
    ----+NMMMMMMMMMMMMMo--yMMMMNo-:yMMMMd/.
    .--oMMMMMMMMMMMMMMMy--yMMMMMMh:-yMMMy-`
    `-sMMMMMMMMMMMMMMMMh--dMMMMMMMd:/Ny+y.
    `-/+osyhhdmmNNMMMMMm-/MMMMMMMmh+/ohm+
      .------------:://+-/++++++oshddys:
       -hhhhyyyyyyyyyyyhhhhddddhysssso-
        `:ossssssyysssssssssssssssso:`
          `:+ssssssssssssssssssss+-
             `-/+ssssssssssso+/-`
                  `.-----..`
    

    Solus Website

    It occurred to me that I hadn't given Solus a proper test while auditioning distros. I'd used an old version of Solus from last year, which isn't much of an issue in itself as Solus is effectively a rolling release distro, but I'd not played with the new installer, or used it with its Pipewire by default setup.

    Also, as my Entroware Apollo reached 7 years old, I felt a twinge of nostalgia for Solus, which is the distro I used for my 1st year with the laptop. The first couple of stickers I added to its lid were the Solus and Budgie logos, they're both still there.

    So I wiped FreeBSD from my Apollo laptop and installed Solus 4.5, just for the fun of it.

    Which was a bit of a mistake … as I really liked it! 😃

    I found myself updating my dotfiles and update scripts to install a bunch of stuff I regularly use, and found all but a handful of packages were available as a Solus native eopkg.

    To fill the package gaps, I decided to give Flatpak a go for the desktop apps, and Homebrew a go for the CLI apps.

    Flatpak

    Flathub

    Homebrew

    The handful of Flatpaks have worked very well, things like Synology Drive, Plexamp and PhpStorm have no problems at all. I would normally prefer Snaps to Flatpaks, but as Solus is deprecating the use of Snaps on the OS, it's a relief to find out that these apps I use every day are working well as Flatpaks.

    Homebrew on the other hand did not work well at all. It'd fail to install anything because it could not find /etc/ld.so.conf.

    I did a bunch of searching for potential solutions, nothing relevant turned up. Luckily, I'm getting kinda smart at testing this kind of thing where I have no idea whether something is going to work, or end up spitting files all over my system. I'd tested Homebrew in a Solus VM created with Quickemu, having first created a snapshot, so it was easy for me to roll back the VM and test a different method of getting the last remaining CLI apps I need.

    Nixpkgs to the rescue!

    I've used the Determinate Systems nix installer a few times before, it works great, and worked flawlessly for me again on Solus.

    The Determinate Nix Installer

    With it I was able to install some CLI style packages that are important to me, but not yet available in eopkg format, things like Atuin, Elm, Gleam and Kiln.

    I say not yet, because I'm keen to try and create eopkg versions of these apps that I needed to use Nixpkgs for. I've already submitted a couple of super simple packages to make sure I'm all set up for creating eopkgs, and if they turn out to be accepted, that'll no doubt give me the courage to attempt a couple more that I need, but are likely a bit more cumbersome to package up.

    Anyway, I found myself using my Apollo with Solus all the time, the Budgie desktop version of course, forgot to mention that before. I preferred it to using the GNOME based Ubuntu Desktop on my Framework, even though my Framework Laptop is way more powerful than my ancient Entroware Apollo.

    As such, it was pretty much a no-brainer that I should see whether Solus 4.5 worked ok on the Framework Laptop 13.

    As you've no doubt figured out by now, Solus works great on my 12th Gen Framework Laptop 13, even though Solus Budgie does not have fractional scaling for the desktop display.

    To get a better resolution than either the too high density natural 2256×1504 resolution at 100%, but way too blown up resolution at 200%, I just added an entry to ~/.xprofile to scale the display back down a bit when at 200%.

    xrandr --output eDP-1 --scale '1.5x1.5'
    

    Other than that minor "manual" tweak, everything else has been been super smooth when running Solus on my Framework laptop, all the hardware works as expected.

    I like the way Budgie works. Even though I've been using the i3 window manager almost exclusively for the last few years, Budgie's nice sensible "traditional" set up is familiar and easy to use. It has plenty keyboard shortcuts for things like throwing a window to one half or a quarter of the screen, or managing multiple workspaces, which I use extensively.

    I tend to work with one app at a time, maximized, sometimes full screen, and Budgie supports that style or workflow effortlessly. I've therefore not really had to change the way I work at all.

    Maybe one thing that helped my transition to Budgie on my laptop is that I installed Ulauncher, which I've been using for a good few months on my main desktop machine that currently runs i3 on NixOS.

    Ulauncher

    I started using Ulauncher on my main machine after having started to use Ulauncher with Sway on my Framework laptop as a means to simplify and unify my config of all those little things you want quick access to, such as an emoji picker, or clipboard history.

    Even though Solus Budgie has a perfectly fine quick app runner hooked up to Alt+F2 by default, Ulauncher is my one stop shop for launching apps and quickly accessing other utilities via the keyboard, regardless of the machine I'm using.

    Probably the only thing that I'm missing from my i3/Sway config while using Budgie, is being able to set a rule to make Firefox's picture-in-picture window sticky on all workspaces when I pop out the window while watching YouTube. The picture-in-picture window is set as "Always on top" by default, but I just have to right click it and pick "Always on Visible Workspace" to make the window visible on all workspaces. I wish I could automate that, but it's not a big deal either.

    So all in all, it's been a great experience returning to Solus, I'm thoroughly enjoying its simplicity and attention to detail.

    I'm also looking forward to seeing how Solus progresses over the next few years. There's a potential for a lot of great things coming to Solus with its partnership with Serpent OS to modernize some of its infrastructure and underpinnings, and other initiatives.

    I wonder how long I can resist nuking my desktop machine and installing Solus on it? 🤔😆