There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

What is the most duct-tape thing you've done to Linux?

tell me the most ass over backward shit you do to keep your system chugging?
here’s mine:
sway struggles with my dual monitors, when my screen powers off and back on it causes sway to crash.
system service ‘switch-to-tty1.service’


<span style="color:#323232;">[Unit]
</span><span style="color:#323232;">Description=Switch to tty1 on resume
</span><span style="color:#323232;">After=suspend.target
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Service]
</span><span style="color:#323232;">Type=simple
</span><span style="color:#323232;">ExecStart=/usr/local/bin/switch-to-tty1.sh
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Install]
</span><span style="color:#323232;">WantedBy=suspend.target
</span>

‘switch-to-tty1.service’ executes ‘/usr/local/bin/switch-to-tty1.sh’ and send user to tty1


<span style="color:#323232;">#!/bin/bash
</span><span style="color:#323232;"># Switch to tty1
</span><span style="color:#323232;">chvt 1
</span>

.bashrc login from tty1 then kicks user to tty2 and logs out tty1.


<span style="color:#323232;">if [[ "$(tty)" == "/dev/tty1" ]]; then
</span><span style="color:#323232;">    chvt 2
</span><span style="color:#323232;">    logout
</span><span style="color:#323232;">fi
</span>

also tty2 is blocked from keyboard inputs (Alt+Ctrl+F2) so its a somewhat secure lock-screen which on sway lock-screen aren’t great.

cm0002 ,

Well it was more like a temporary duct tape, but I “installed” a copy of Ubuntu in RAM from the running Ubuntu system so that I could “boot” (pivot_root) into it without restarting it

All because I didn’t want to wait on a ticket for my dedicated server provider to hook in a KVM LOL

(See my meme post I posted to c/linuxmemes a few weeks back for more info)

mycodesucks ,
@mycodesucks@lemmy.world avatar

My Nvidia card won’t properly resume the display after suspend with the default suspend script, but if I correct the script file, every time aptitude updates the nvidia drivers, it restores the bad version of the configuration file. If you set the file immutable with chattr, aptitude throws a fit and goes into a broken state when it can’t overwrite the file on a driver update.

So I keep a good copy of the script file in the directory, and in my pre-suspend script file I overwrite the main suspend script with the good version. Every single time.

rotopenguin ,
@rotopenguin@infosec.pub avatar

I made a systemd script that fires when going to / waking up from sleep - it checks how long the sleep was and if it was just a few seconds, it puts the computer back to sleep.

In hindsight, I think the thing that made it work was bluetooth was somehow responsible for the initial failed suspend. The second shot at sleep happened before bluetooth came back up, so it succeeded.

everett ,

Possibly my light/dark mode scripts. They change my Plasma theme, which is honestly most of the job, but also set the matching GTK theme, set the new theme in running Konsole sessions, do a bunch of manual sed edits on conf files for applications that don’t follow system theming, finally restarting plasmashell to clean up the occasional edge case where a tray icon is supposed to follow the theme but doesn’t.

iiGxC ,

Oh yeah I do this, I’ll raise you that mine also sshs into my server to update the editor theme

macattack ,

Prior to switching (upgrading?) to Wayland, Debian KDE crashed under X11 regularly when waking from hibernation and the taskbar would disappear. Restarting the plasma shell made it operable again, so I created an alias and regularly rebooted the DE shell 2-3x a day:

alias damnTaskbar=‘killall plasmashell ; kstart plasmashell &’

eager_eagle ,
@eager_eagle@lemmy.world avatar

I still occasionally need to use one of these two


<span style="font-style:italic;color:#969896;"># for plasma desktop
</span><span style="color:#62a35c;">alias </span><span style="font-weight:bold;color:#795da3;">kplasma</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">'plasmashell --replace & disown'
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;"># when kwin crashes or acts weird
</span><span style="color:#62a35c;">alias </span><span style="font-weight:bold;color:#795da3;">kbug</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">'if [ "${XDG_SESSION_TYPE}" = "x11" ]; then kwin_x11 --replace & disown; else kwin_wayland --replace & disown; fi'
</span>
cizra ,

Mounting a Samba share and moving my LVM pvolumes of / onto a losetup’ed file on it, while running the system. Bass ackwards.

chtk ,
@chtk@feddit.nl avatar

Good grief. Why?

cizra ,

I needed to redo partitions, but didn’t want to reboot.

chtk ,
@chtk@feddit.nl avatar

That’s not even a bad idea then.

One of my machines has a boot partition that’s a bit too small, on an otherwise LVM setup.

cizra ,

I’d recommend a Linux installer on a memory stick, instead. It’s bound to have less network lag.

chtk ,
@chtk@feddit.nl avatar

Nah, it’ll be fine.

I might have a large enough USB SSD laying around some where. I could probably use that instead.

  • extend VG with the USB PV
  • move LV’s to USB
  • shrink root LV
  • resize boot
  • move things back on a new internal PV
CrabAndBroom ,

I have a folder full of scripts tied to aliases that fix various things when they go wonky, and I’ve long since forgotten what any of them do. I just know if xxx app stops working, I type fix_xxx into the terminal and then it does a bunch of stuff and then it works again lol.

Also I have a bunch of aliases tied to common tasks, like e1 = reboot, e2 = shutdown etc. I have no idea where that habit came from.

Edit: ALSO, just the general mish-mash of apps. I won’t have anything to do with Snaps, but the rest of it is an unholy combination of native apps, things from the AUR, flatpaks, Appimages, Docker containers and wine setups, mostly (but not all) in Bottles.

MonkderVierte ,

I dare you to try grep -Irn alias in your home dir.

CrabAndBroom ,

I’m not even sure what that would do! Presumably list every time the word alias appears in every file across the whole home directory or something like that?

MicrowavedTea ,

Not exactly mine but I’ve used it. I have a fast but data-limited internet connection and a slower unlimited connection. When I need the faster connection to do something I connect to it through wifi while staying connected to the other through Ethernet. Then use this project to bind a specific app to wifi while everything else keeps using Ethernet. It uses LD_PRELOAD to link its own version of network connect that calls the real method. There’s definitely a better way to do this with iptables but it’s a good enough patch for when needed.

julianh ,

So I use a surface device with the Linux surface kernel, and there was (and probably still is) an issue where the type cover doesn’t properly rebind after being detached and re-attatched. To make matters worse, connecting other USB devices disconnected the type cover. My solution was to make a udev rule that detected if the keyboard is “removed” and then try to rebind it, effectively unplugging it and plugging it back in again in software.

communism ,
@communism@lemmy.ml avatar

Youtube doesn’t seem to inhibit idle for me for some reason, so my screen would always turn off with swayidle while watching youtube videos. So I made my lockscreen script (which is called by swayidle)


<span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#62a35c;">[ </span><span style="color:#183691;">"$(</span><span style="color:#323232;">playerctl</span><span style="color:#183691;"> status)" </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">"Playing" </span><span style="color:#62a35c;">]</span><span style="font-weight:bold;color:#a71d5d;">; then
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">exit</span><span style="color:#323232;"> 0
</span><span style="font-weight:bold;color:#a71d5d;">else
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">exec </span><span style="color:#183691;">"/path/to/lockscreen/script"
</span><span style="font-weight:bold;color:#a71d5d;">fi
</span>

(lockscreen script was just swaylock called with a bunch of arguments)

Not super crazy compared to some of the things people are saying in the comments, but also definitely not how you’re meant to handle idle inhibition when media is playing lol

iiGxC ,

Hey that’s pretty good, I’m gonna steal it. It might even be worth making a pullrequest to update swaylock to have a flag to do this, I use waybar and it has a lock inhibit button that I use before I start watching anything, but automating it like this is seems super nice

UNY0N ,

This certainly isn’t of the same caliber as some of these other comments, but I found it to be fitting to the topic.

Last year I was having problems getting the game stellaris working on arch. (I use bazzite now, btw) My solution was the following:

  1. download the game via steam.
  2. switch it to use proton
  3. switch it back to linux version
  4. use the terminal to make the entire game folder read-only, so that steam couldn’t touch the game anymore and screw it up.
  5. add the exicutable to PATH
  6. start the game via terminal

If any one of those step was left out, it didn’t work. I’m no linux expert, so I didn’t have the skills to actuality find the real problem.

prole ,

Even when Proton doesn’t work, it still somehow works.

Magic.

julianh ,

I… What? Why does that work? How did you figure this out?

Ephera ,

I like to use unclutter to hide my mouse pointer after a few seconds without being moved.

Now, the thing is, it doesn’t just visually hide the cursor, it actually removes it, so UI elements triggered by hovering disappear. Sometimes that’s great, other times it’s infurriating, like when reading a tooltip or menu.

I mostly use a touchpad, and so I developed a habit to wiggle my finger while I’m intentionally hovering something, so that there was enough mouse movement for unclutter to not remove my pointer.

Then I found a setting for the jitter threshold of the touchpad. Basically, with the threshold on, it ignores tiny movements, because the hardware reports finger wiggling, even if you hold your finger perfectly still. Which is perfect for me to turn off.

Now when I have my finger on the touchpad, it automatically wiggles and allows me to read hover elements. If I take my finger off, it stops wiggling and removes the cursor.
It’s almost like someone designed an OS with touchpads in mind, rather than them being an afterthought.

chameleon ,
@chameleon@fedia.io avatar

Did a physical-to-virtual-to-physical conversion to upgrade and unbreak a webserver that had been messed up by simultaneously installing packages from Debian and Ubuntu.

kate ,

something kept messing with my dns and i’m too lazy to find out why so i hardcodes etc/resolv.conf and chmod +i on it

ChicagoCommunist ,

God my current setup is patched together and hanging by a thread. Not super tech savvy so it usually takes a dedicated deep dive for me to set everything up (and all the focus and motivation that entails). So if something goes wrong while I’m trying to work, I’m more likely to find a quick workaround and make a note to fix things later.

Except five years later I haven’t truly fixed anything lmao. Gonna just do a clean install one of these days, if I can decide on a distro.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines