The Linux Thread - The Autist's OS of Choice

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
What's the best way to have a script run at startup? (or login, don't care which)

I'm fooling around with running Pipewire without SysTemD and it works fine except you need to run all the daemon processes manually, because it's only packaged with a SysTemD .service file and nothing else.

I've seen various suggestions like:
- Cron job
- .profile
- .bash-login (and all the million other "special" shell files)
- XDG autostart

Ideally it should be something independent of what DE, WM, and shell you happen to use. Any suggestions?
Using dex, and running dex -a to auto start most of my xdg applications is an option I use pretty often. It will work fine for pipewire. You just need to make sure dex -a command runs with every desktop environment you have. (If it doesn't automatically do xdg auto start).

Running it in your xinitrc directly would work fine also. But usually for me thats just where I get dex to start my stuff. So I can easily just add dex to my Wayland compositors also.

On another topic. For my second Gentoo install, I decided to not keep it minimal and install xfce, and then add my own window manager underneath (bspwm, but I'm working on getting dwm to work, it has some weird stuff I need to work out. Like only starting xfce on the first desktop and not having it on the others. And other stuff. I might need to re patch dwm, and also adjust how xfce acts)

I decided to do that on this one to just make some stuff easier for myself. In particular getting screen locking on suspend and when the lid closes to work properly, without experimenting a ton. If all else fails. I can just install i3 because I know that works perfectly with it. But I'd rather do dwm if possible.
 
doesn't btrfs make fsck unneccesary?
Not true, scrub isn't a full replacement for the check.

Technically, to replace fsck on btrfs you need to run "btrfs check" on an unmounted device, mount it read only, then run scrub on the full filesystem.

Incredibly slow, but that's the correct procedure that covers everything fsck would do if it had one. Speed is pretty much the number 1 reason why the fsck command is a no-op on btrfs. Otherwise your system would take hours to boot.
 
It's been roughly a month and a half since I jumped from W11 to Linux Mint. Minor conveniences from Windows notwithstanding (i.e. Night Light, Windows Key+V for the clipboard manager, Windows Key+any direction on the arrow keys to move a window in that direction, etc), I genuinely have no complaints. I've even managed to get PKHeX up and running once I realised that I need WineHQ's repository set up since LTS Wine releases are horrifically ancient.


As for what I've been up to: finally got around to fiddling with Emacs properly, and with Doom Emacs at that. Doom Emacs is a treat thus far, but I'm still not quite able to work out how to set up Org-Roam alongside Org Mode. Either way, I'm happy that I can finally fiddle with Emacs without relying on some quirky binaries running off MinGW or WSL.
 
It's been roughly a month and a half since I jumped from W11 to Linux Mint. Minor conveniences from Windows notwithstanding (i.e. Night Light, Windows Key+V for the clipboard manager, Windows Key+any direction on the arrow keys to move a window in that direction, etc), I genuinely have no complaints. I've even managed to get PKHeX up and running once I realised that I need WineHQ's repository set up since LTS Wine releases are horrifically ancient.


As for what I've been up to: finally got around to fiddling with Emacs properly, and with Doom Emacs at that. Doom Emacs is a treat thus far, but I'm still not quite able to work out how to set up Org-Roam alongside Org Mode. Either way, I'm happy that I can finally fiddle with Emacs without relying on some quirky binaries running off MinGW or WSL.
Night light, as in cosmetic adjustment of monitor gamma without physically filtering out the blue light, can be done with Redshift (more features) or sct (UNIX-y, ~400 LoC.) There are more, but those are the ones I'm familiar with. If your monitor comes with an option to turn blue light off entirely and is able to be controlled via a virtual control panel, you can try looking for that in the output of ddcutil, namely probe and capabilities. I don't trust the Chinkshit I currently have and I want it to last, so I'm getting by on sct myself.

I've tried both Doom Emacs and Spacemacs, but found the framework they turn Emacs into to be a little restrictive. Maybe it's a skill issue, I don't know. For the simple tasks I'm currently using Emacs for, Emacs Prelude is minimal enough and gives enough of an excuse to learn how things work under the hood.
 
I've tried both Doom Emacs and Spacemacs, but found the framework they turn Emacs into to be a little restrictive. Maybe it's a skill issue, I don't know. For the simple tasks I'm currently using Emacs for, Emacs Prelude is minimal enough and gives enough of an excuse to learn how things work under the hood.

I don't care enough to learn how Emacs runs under the hood; I just care about fiddling with Org Mode and Org-Roam. Doom Emacs and Spacemacs are roughly equivalent in my book, so I just chose at whim.
 
There are probably some ways around that. I'm definitely no openrc expert at this point so I couldn't say anything definitively on how to do it the best way.

I always use dbus-run-session dwm (or whatever window manager) in the xinitrc. Or dbus-exec exit-with-session then the window manager. Depending on what you want.

Then sometimes It makes sense to set variables in the xinitrc. Like I was having an issue on something not using the right gtk theme until I added that into the xinit. And finally it was setting it properly.

Tbh I feel like even if I wasn't constantly trying new things on Linux, there would still be so much to learn just sticking with a single os, and a single window manager, and just spending time getting to the point where I know exactly how to set everything needed for every part of my system.

I also totally get why some people don't want to bother learning about any of it and just want ubuntu or Linux mint with a full desktop environment so they never have to think about any of this stuff.
That was what I did previously, except I found a problem that if the dbus session daemon died, I would have problems getting things back to a consistent state since DBUS_SESSION_BUS_ADDRESS is often a random sock file that needs to be recreated or things start crashing. What I did was to just do the following in my S6 run:
#! /bin/sh if test -z "${XDG_SESSION_ID}"; then export XDG_SESSION_ID="$(cat /proc/$$/sessionid)" fi if test -z "${DBUS_SESSION_BUS_ADDRESS}"; then export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/dbus.sock" fi exec 2>&1 echo "[$(/bin/date ${DATE_FORMAT})] Starting User Dbus." exec /usr/bin/dbus-daemon --session --syslog --nofork --address "${DBUS_SESSION_BUS_ADDRESS}"
S6 then gets called from xinit.
What's the best way to have a script run at startup? (or login, don't care which)

I'm fooling around with running Pipewire without SysTemD and it works fine except you need to run all the daemon processes manually, because it's only packaged with a SysTemD .service file and nothing else.

I've seen various suggestions like:
- Cron job
- .profile
- .bash-login (and all the million other "special" shell files)
- XDG autostart

Ideally it should be something independent of what DE, WM, and shell you happen to use. Any suggestions?
I tried doing that with openrc-navi, but the biggest problem is that it needs a dbus session to function (probably looking for bluetooth devices), and dbus is only partially functional if you started it outside of X without DISPLAY set, ungoogled-chromium started later under X just crashes on starting if it tried to use that bus. Pipewire otherwise functions perfectly even without any X server running in console mode. There was also a problem with multiple logins causing pipewire to start multiple times, trying to race each other trying to access the /dev/snd nodes.

The most painless way seems to be XDG autostart if you don't want to go down the rabid hole I went through. Just make sure you start only a single X session at any given time.
 
photo_2024-10-20_15-51-59.jpg
 
It's been roughly a month and a half since I jumped from W11 to Linux Mint. Minor conveniences from Windows notwithstanding (i.e. Night Light, Windows Key+V for the clipboard manager, Windows Key+any direction on the arrow keys to move a window in that direction, etc), I genuinely have no complaints. I've even managed to get PKHeX up and running once I realised that I need WineHQ's repository set up since LTS Wine releases are horrifically ancient.


As for what I've been up to: finally got around to fiddling with Emacs properly, and with Doom Emacs at that. Doom Emacs is a treat thus far, but I'm still not quite able to work out how to set up Org-Roam alongside Org Mode. Either way, I'm happy that I can finally fiddle with Emacs without relying on some quirky binaries running off MinGW or WSL.
Depending on what distro/desktop you should be able to add those features pretty easily.

If you went to something like mint or any gnome based distro. You likely can just adjust nightlight out of the box and not need to install or change anything.

For the keybinds you can for sure add those yourself in the settings for any desktop on Linux and change them to your needs. Same for any window manager but you will be using config files instead of GUI settings apps.
 
Feel free to ignore this but if you just want to use emacs as a text editor and don't care how it works, you're probably gonna have a bad time.

You’re talking to a guy who fiddles with software for shits and giggles. If I wanted a plain old text editor, I’d be using Vim like a normal person.
 
The only important feature Emacs has is M-x psychoanalyze-pinhead

Other than that you can just use it like a regular text editor without dealing with any of the LISPness.
 
  • Informative
Reactions: Vecr
You’re talking to a guy who fiddles with software for shits and giggles. If I wanted a plain old text editor, I’d be using Vim like a normal person.
Use neovim. You can use lua, which I feel like people generally find more agreeable to mess with. And its genuinely faster. While you can still add a lot of the functionality of something like doom emacs if you wanted. It's probably just as extendable as emacs. If not just a little tiny bit less.
 
Back