272
submitted 4 weeks ago* (last edited 4 weeks ago) by squid_slime@lemm.ee to c/linux@lemmy.ml

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'

[Unit]
Description=Switch to tty1 on resume
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/local/bin/switch-to-tty1.sh

[Install]
WantedBy=suspend.target

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

#!/bin/bash
# Switch to tty1
chvt 1

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

if [[ "$(tty)" == "/dev/tty1" ]]; then
    chvt 2
    logout
fi

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.

(page 3) 50 comments
sorted by: hot top controversial new old
[-] avidamoeba@lemmy.ca 4 points 4 weeks ago* (last edited 4 weeks ago)

On the client side of a relayd-based wireless bridge using OpenWrt, I discovered there was a bug in that relayd version which made the process hang after it moved so many gigs of data. I made a cron job that pings the network relayd makes accessible. If the ping fails, it nukes relayd. Of course this relies on a live machine to ping. If this machine dies for some reason, the cron job would just keep killing relayd over and over again. 🥹

[-] Samueru@lemmy.ml 4 points 4 weeks ago

It makes me mad to see the current state sway is in, I even bought an AMD GPU for nothing.

[-] downhomechunk@midwest.social 4 points 4 weeks ago

I too was a bit underwhelmed by sway. I also bought an amd gpu, but I don't regret it. I couldn't get Wayland to work at all on my 3060 ti.

[-] popekingjoe@lemmy.world 4 points 4 weeks ago

In the earlier days of Plasma 6, it would crash on me when waking from sleep, so I had a small script that would basically restart plasmashell when waking so I didn't have to wait the several seconds for the system to realize that it was frozen before I had a functional desktop.

[-] StarlightDust@lemmy.blahaj.zone 4 points 4 weeks ago

gtk3-classic still doesn't work properly on Wayland and I doubt it will ever be fixed so I include WAYLAND_DISPLAY=0 in each shortcut file to force them into xwayland.

[-] MonkderVierte@lemmy.ml 3 points 4 weeks ago* (last edited 4 weeks ago)

Bootstraping.

[-] OmegaLemmy@discuss.online 3 points 3 weeks ago

I made a script to add a middle click scroll function with a toggle. I can share the script, it's a really bash script

load more comments (1 replies)
[-] ChicagoCommunist@hexbear.net 3 points 4 weeks ago

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.

[-] DeltaWingDragon@sh.itjust.works 3 points 3 weeks ago

Here's a few of the micro-hacks that I've hacked up in the past.

A 2-line script to chroot into Debian when logging in as a certain user on FreeBSD.

#!/bin/sh  

clear  
doas chroot /linux /bin/login

I didn't have an IDE, so I just made a script called ide which runs Vim, and then compiles the code and makes it executable.

#!/bin/sh
#Works only for C
vim $1.c && cc -O3 -Wall -Werror -Wno-unused-result $1.c -o $1
#MODE=`stat -f "%OLp" $1`
if ("stat -f "%OLp" $1 | grep -e 6 -e 4 -e 2") then
	chmod +x $1
fi

This thing, called demoronize, which does what it says in the comments

#!/bin/sh

#dos2unix -O -e -s $1 | sed 's/    /	/g' | sed 's/“/"/g' | sed 's/”/"/g'
cat $1 | sed 's/    /	/g' | sed 's/“/"/g' | sed 's/”/"/g'
#Convert DOS line endings to Unix ones and add a final newline if there isn't one,
#replace sequence of 4 spaces with tab,
#and replace "smart" quotes with normal ones

I just keep those ones for historical value, but there's one hack I use every day. My keyboard doesn't have a function key (Fn), so I use the Super/Windows key instead.
I have xdotool keyup Super_L keyup Super_R keyup F4 key XF86Sleep bound to a custom keyboard shortcut. It unpresses the keys used for the shortcut (Super + F4), then presses the sleep key.

[-] BrianTheeBiscuiteer@lemmy.world 3 points 4 weeks ago

Don't remember the specifics but I had a key combo setup to force a soft reset in my DE. Occasionally a kernel or driver update would fuck up my video and make the system unusable but still live. I try to avoid hard resets.

[-] callyral@pawb.social 3 points 3 weeks ago
wayland.windowManager.sway.config.keybindings = let
    # ...
    screenshot = with pkgs; writeShellScriptBin "screenshot.sh" ''
          DATE=$(date +"%Y%m%d%H%M%S")
          if [ "$1" = "full" ]; then
            ${grim}/bin/grim ~/Pictures/shot_$DATE.png
            ${libnotify}/bin/notify-send "saved full screenshot to shot_$DATE.png"
          elif [ "$1" = "full-copy" ]; then
            ${grim}/bin/grim - | ${wl-clipboard}/bin/wl-copy -t image/png
            ${libnotify}/bin/notify-send "copied full screenshot"
          elif [ "$1" = "sel" ]; then
            ${grim}/bin/grim -g "$(${slurp}/bin/slurp)" ~/Pictures/sel_$(date +"%Y%m%d%H%M%S").png
            ${libnotify}/bin/notify-send "saved selection to sel_$DATE.png"
          elif [ "$1" = "sel-copy" ]; then
            ${grim}/bin/grim -g "$(${slurp}/bin/slurp)" - | ${wl-clipboard}/bin/wl-copy -t image/png
            ${libnotify}/bin/notify-send "copied screenshot"
          else
            printf "Invalid argument: '$1'\n"
          fi
          '';
  in lib.mkOptionDefault { # ...

This is in my Home Manager configuration. I don't think this is that bad, it's just kinda messy. If you can't tell, it's a script for taking screenshots, embedded in my configuration.

[-] ninekeysdown@lemmy.world 2 points 3 weeks ago

I’ll leave this one here for someone:

You can tunnel L2 over OpenVPN. Just bridge your interfaces in both sides and it works.

That way if you need to provision a VOIP phone or just have something NetBoot remotely. Not that I recommend doing that…

[-] usa_suxxx@hexbear.net 2 points 4 weeks ago

My Fedora distro can't restart and stalls when it tries to shutdown with the auto update checked. So it never shuts down. I set up a cronjon to run dnf update to make sure that I don't need to uncheck the auto update option. Just a really silly thing that bothers me.

load more comments
view more: ‹ prev next ›
this post was submitted on 21 Aug 2024
272 points (98.2% liked)

Linux

47344 readers
1179 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS