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.

  • eldavi@lemmy.ml
    link
    fedilink
    arrow-up
    86
    ·
    4 months ago

    intel won’t allow its linux drivers to work above wifi 4 speeds in ap mode, so i created a kvm virtual windows machine with pci pass through on the wifi nic plus ip masquerade and now i’m getting wifi 6 speeds in ap mode.

  • Ephera@lemmy.ml
    link
    fedilink
    arrow-up
    35
    ·
    4 months ago

    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.

  • UNY0N@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    4 months ago

    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.

      • UNY0N@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        4 months ago

        Blind trial and error, mostly. Making the game folder read-only was the real “duct-tape” part, it occued to me to do that after steam kept “updating” the game and breaking my solution.

    • deltapi@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      I duct taped a RPi4 to the back of a Motorola Lapdock and used custom cables to make the combo into the worst laptop ever. If yours counts, mine does too. This is what the Lapdock looks like:

  • cryoistalline@lemmy.ml
    link
    fedilink
    arrow-up
    20
    ·
    4 months ago

    I had to use unity game engine for one of my assignments for school, but unity wouldn’t generate files needed for the language server unless I set the code editor to vscode. I fixed this by creating a bash script with the path /usr/bin/code that opens neovim in konsole.

    #!/usr/bin/env bash
    konsole -e "nvim $@"
    
  • Random Dent@lemmy.ml
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    4 months ago

    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.

      • Random Dent@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        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?

          • Random Dent@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            4 months ago

            Alright, I’m gonna try it and see how long this takes!

            edit: about 8 minutes. Not as spectacular as I’d hoped lol

            • MonkderVierte@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              4 months ago

              If you have games there, yeah. Ripgrep is way faster. But grep is good enough in most cases.

              Btw, did you find your aliases?

              • Random Dent@lemmy.ml
                link
                fedilink
                English
                arrow-up
                2
                ·
                4 months ago

                I did! I know where they are and which scripts they point to, but as for going into the scripts and trying to remember what they’re actually doing… I’ll get to it some day lol

  • bodaciousFern@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    17
    ·
    edit-2
    4 months ago

    I’m using Gentoo with systemd and a customized kernel, and additionally I have the /usr partition LUKS encrypted. Because /usr is absolutely essential for systemd to function, I configured dracut to make a specially crafted initrd which activates the luks lvm and prompts for the password to decrypt and mount /usr on startup before systemd init tries to run.

    About a year or two ago, some update to dracut or some other dependency (assumption) caused the dracut generated initrd’s to kernel panic. After multiple days of troubleshooting, I discovered that just copying forward an older initrd in /boot and naming it to match the new kernel, e.g. initramfs-6.6.38-gentoo.img , allows the system to boot normally .

    So, my Gentoo is booting a kernel 6.6.something with a ramdisk generated in the 5.9 kernel era. I am dreading the day when this behavior breaks and I can no longer update my kernel 😳

  • cizra@lemm.ee
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    4 months ago

    BZ2-ing up a terabyte of zeroes (back when a TB was more than people commonly had, then zipping that file up together with another file, to bypass virus scanners in emails that prevent emailing .exe files.

    I’ve also seen a self-referential .zip file somewhere that contains itself.

  • WFH@lemm.ee
    link
    fedilink
    English
    arrow-up
    14
    ·
    4 months ago

    On my previous laptop, the trackpad had a bug that made it spam interrupts after waking up from sleep. It ruined battery life and basically kept one core at 100% permanently.

    So I duct-taped a systemd script that unbound and bound the trackpad after each wake up.

    #!/bin/sh
    case "$1" in
            post)
                    echo -n "i2c_designware.0" > /sys/bus/platform/drivers/i2c_designware/unbind
                    echo -n "i2c_designware.0" > /sys/bus/platform/drivers/i2c_designware/bind
            ;;
    esac
    
  • prime_number_314159@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    4 months ago

    I ran out of crtcs, but I wanted another monitor. I widened a virtual display, and drew the left portion of it on one monitor, like regular. Then I had a crown job that would copy chunks of it into the frame buffer of a USB to DVI-d adapter. It could do 5 fps redrawing the whole screen, but I chose things to put there where it wouldn’t matter too much. The only painful thing was arranging the windows on that monitor, with the mouse updating very infrequently, and routinely being drawn 2 or more places in the frame buffer.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    4 months ago

    Had a Centos VM that kept slipping time. Every week it would loose about 30min. No amount of NTP syncing got the time correct until manual intervention.
    Msp couldn’t work it out, couldn’t rebuild the server for infrastructure reasons, and only that server had the issue. The other 3 VMs on that host were fine.

    Cron job on one server took it current time, sshed to the dodgy server and configured the correct time.

  • umbrella@lemmy.ml
    link
    fedilink
    arrow-up
    13
    ·
    4 months ago

    holy shit i was about to post about how i have automatic login and lock to start a program that refuses to work correctly on boot through systemd.

    but then you guys are here casually posting some of the worst duct tape shit ive heard of so far. im not sure if i should reprimand or congratulate you for that jankiness.

  • woelkchen@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    4 months ago

    An old (now decommissioned) notebook of mine had a broken headphone jack. I didn’t have BT headphones then. Audio output worked technically but the detection whether headphones were plugged in or not did no longer work.

    I wrote a very short amixer script to force unmute the jack, set the volume to 50 or so percent and set the speaker volume to 0% but not “mute” state. I could then use my wired headphones again.

  • communism@lemmy.ml
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    4 months ago

    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)

    if [ "$(playerctl status)" = "Playing" ]; then
        exit 0
    else
        exec "/path/to/lockscreen/script"
    fi
    

    (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

  • Aceticon@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    4 months ago

    I got an Orange Pi 5 Plus to play with smallish AIs (because it has an NPU) and I normally access it remotely, so I have to know its IP address to do it.

    In order to easilly know the IP address of it, I’ve wired a little 128x64 monochrome OLED screen to it (Orange PIs, like Raspberry PIs have a pin connector giving access to GPIO and interfaces like I2C, Serial and SPI) which talks via I2C.

    Turns out those interfactes aren’t active in Linux by default (I.e. no /dev/i2c-x), so I figured out that I had to add a kernel overlay to activate that specific interface (unlike with the Raspberry PI whose Linux version has a neat program for doing it, in the Orange Pi you have to know how the low level details of activating those things), which I did.

    To actually render characters on that screen I went with an ARM Linux port of a graphics library for those screens I used before with Arduino, called u8g2)

    Then I made a program in C that just scans all network interfaces and prints their names and IP addresses on that screen, and installed it as a Cron job running once a minute.

    Now, as it turns out when you shutdown your Linux on that board, if you don’t disconnect it from power there is actually still power flowing through the pin connector to any devices you wire there, so after shutdown my screen would remain ON and showing the last thing I had put there, but because the OS was down it would naturally not get updated.

    So the last thing I did was another small C program which just sends to that screen the command for it to go into power saving mode, shutting it down. This program was then installed as a Systemd Service to run when Linux is shutting down.

    The result is now that there is a little screen hanging from the box were I put this board with Linux which lists its IP addresses and the info is updated if it connects other interfaces or reconnects and gets a new IP address. Curiously I’ve actually been using that feature because it’s genuinely useful, not just a funny little project.

    • flux@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      Maybe consider static ip assignment in your DHCP server (e.g. internet router) if at all possible… Then you can add a name to it to /etc/hosts.

      Alternatively you could use Avahi to provide mdns names to your local network