Just a basic programmer living in California

  • 1 Post
  • 26 Comments
Joined 1 year ago
cake
Cake day: February 23rd, 2024

help-circle

  • That’s a helpful one! I also add a function that creates a tmp directory, and cds to it which I frequently use to open a scratch space. I use it a lot for unpacking tar files, but for other stuff too.

    (These are nushell functions)

    # Create a directory, and immediately cd into it.
    # The --env flag propagates the PWD environment variable to the caller, which is
    # necessary to make the directory change stick.
    def --env dir [dirname: string] {
      mkdir $dirname
      cd $dirname
    }
    
    # Create a temporary directory, and cd into it.
    def --env tmp [
      dirname?: string # the name of the directory - if omitted the directory is named randomly
    ] {
      if ($dirname != null) {
        dir $"/tmp/($dirname)"
      } else {
        cd (mktemp -d)
      }
    }
    





  • This is a big reason for me. Also because if anything breaks - even if my system becomes unbootable - I can select the previous generation from the boot menu, and everything is back to working.

    It’s very empowering, the combination of knowing that I won’t irrevocably break things, and that I won’t build up cruft from old packages and hand-edited config files. It’s given me confidence to tinker more than I did in other distros.




  • hallettj@leminal.spacetoLinux@lemmy.mlHow do you backup?
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 months ago

    My conclusion after researching this a while ago is that the good options are Borg and Restic. Both give you incremental backups with cheap timewise snapshots. They are quite similar to each other, and I don’t know of a compelling reason to pick one over the other.


  • hallettj@leminal.spacetoLinux@lemmy.mlSWAY desktop
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    3 months ago

    Are you using swayidle? It’s supposed to automatically keep the screen on when there is full-screen video playing. It’s the same in Gnome: you generally don’t need caffeine if a full-screen video is going.

    How are you playing videos? Maybe the player doesn’t correctly implement the idle inhibit protocol. Or if you’re using sway bindings to make the window fullscreen instead of using the app’s own fullscreen mode then maybe the player doesn’t know it’s fullscreen, and doesn’t set up the idle inhibit.

    If you do want manual idle inhibit control, if you use Waybar it has an idle inhibitor module that mimics caffeine. If you don’t use Waybar there is a little Python script you can run. Kill it when you want to stop inhibiting idle. actually wib looks like a better option


  • I’m gonna take a couple of stabs in the dark.

    According to this Stack Overflow answer using tee can prevent the prompt from drawing which makes it appear that a script has not terminated. The answerer’s workaround is to put a very short sleep command after the tee command.

    If this is what happened to you maybe the reason the script works in bash but not in zsh is because you have different prompts configured in those two shells.

    Another idea is to replace tee with sponge from moreutils. The difference is that sponge waits for the end of stdin before it starts writing which can avoid problems in some situations.


  • hallettj@leminal.spacetoLinux@lemmy.mlPlug-and-play development environment
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    4 months ago

    Oh yeah, and Nix has the advantage that you don’t need containers. If you want to run a graphical app in a container it might be tricky to access the window manager on the host system. Maybe that’s why you were setting up i3? Yeah, containers are great and flexible, but they also have a variety of downsides so Nix is better ;)






  • It would be great if there were a way to translate x86 binaries for ARM without emulation. Has Valve found some way to do that? From a bit of searching I see they’ve been testing games on ARM, and that testing involves a version of Proton/Wine that runs on ARM. But it looks to me like they’re testing with ARM binaries for those games?

    I’m as enthusiastic as anyone about more Linux usage, and I agree that Linux support for ARM is a good selling point. But the reason Linux works so well on ARM is that we use all this open-source software that anyone can compile for ARM. I don’t think it’s honest to point to closed-source software that we can’t recompile, and imply that it will work better on Linux because other software runs natively on ARM on Linux.



  • You can do tag-based file management on Linux. Linux filesystems support “extended attributes” or “xattr”. There is some software out there that uses xattr for tagging. I don’t know what the best options are right now for tag-based file management, but I think it exists.

    Looking at what’s out there I see there are also apps that each use their own out-of-band tagging schemes. There’s a CLI, tmsu, and a GUI, TagSpaces. I don’t think these interoperate with each other’s tags.

    Of course those supplement instead of replacing hierarchical organization.

    The talk of hypertext and “escaping paper” makes me think of Obsidian which embraces hyperlinking, tags, and mind mapping via its canvas feature.