she/they

  • 0 Posts
  • 41 Comments
Joined 2 years ago
cake
Cake day: July 1st, 2023

help-circle
  • OinkstoLinux@lemmy.worldToday I found out about fish shell
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    20 days ago

    One thing that bothers me about Nushell (even if it doesn’t really matter) is honestly just how bloated the table style is, with three columns in each column margin and six columns of enforced line numbers. Why can’t it display tables in the same style as regular UNIX commands?

    Another thing that bothered me is that the “blessed” way to parse tables from external commands seems very fragile to me. Iirc the builtin parsing commands work solely off table headers, which are locale dependent for many commands, so a script might appear to work fine but suddenly break if an LC_* environment variable sneaks in somewhere. The size filter trick works nicely for ls, but doing the same thing becomes painful again when using df.

    I also found the script syntax (implicit line continuations, command seperation, etc.) difficult to understand but presumably that’s just a matter of familiarity.

    I’ll have to give it another try in the future but for now Fish is good enough for me.


  • That’s not entirely true, unless you choose to nixify everything. You can just have a basic Nix configuration that installs whatever programs you need, then use stow (or whatever symlink manager you prefer) to manage the rest of your config.

    You can’t entirely forget that you’re on NixOS because of FHS noncompliance but even then getting nix-ld to work doesn’t require a lot of effort.


  • OinkstoProgrammer Humor@programming.devRust
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 month ago

    No C program is written to satisfy a borrow checker and most wouldn’t compile with one, so adding it would require rewriting the world anyways. At that point why not choose a language that, in addition to being memory safe, also drastically cuts down on other kinds of UB, has sum types, sane error handling, a (mostly) thread safe standard library, etc.?




  • Another alternative approach would be to add a duplicate desktop file, but to write it declaratively using Home Manager:

    # in home.nix
    home.file.".local/share/applications/firefox.desktop".source =
      pkgs.runCommand "firefox-desktop" { } ''
        cp "${pkgs.firefox}/share/applications/firefox.desktop" "$out"
        substituteInPlace "$out" \
          --replace-fail "Terminal=false" "Terminal=true"
      '';
    
    # - or -
    home.file.".local/share/applications/firefox.desktop".text = ''
      [Desktop Entry]
      Name=Firefox
      Icon=firefox
      Exec=firefox --name firefox %U
    '';
    

    It would be possible to DIY this with user activation scripts, but I don’t really see a value in doing that over the symlinkJoin.


  • Since the desktop files come directly from a package you’ll need to change the package you’re installing. This works best if you use the postPatch phase of symlinkJoin:

    pkgs.symlinkJoin {
      inherit (pkgs.firefox) pname version;
      paths = [ pkgs.firefox ];
      postPatch = ''
        # String replacement example - will run the app in a terminal
        substituteInPlace "$out/share/applications/firefox.desktop" \
          --replace-fail "Terminal=false" "Terminal=true"
      '';
    }
    

    The reason for using symlinkJoin here is that it creates a package with the same outputs as the original Firefox, but with this bash script having run. You can use this like any other package:

    let
      firefox' = <...>
    in
    {
      environment.systemPackages = [ firefox' ];
      # - or -
      programs.firefox.package = firefox';
    }
    

    Note that symlinkJoin has special handling for postPatch, but ignores all other stdenv phases, so you need to do everything in one bash script. You can use all the parameters for runCommand though, such as buildInputs and nativeBuildInputs - e.g. for compiling sass in a wrapper derivation.

    In some cases it’s useful to also inherit meta or passthru because it’s used in some nixpkgs/nixos sanity checks, but it’s usually not required.

    Another approach would be to use overrideAttrs, which will also work but will cause Nix to rebuild the package from scratch. This might be fine or even desired in some cases, but you probably don’t want to do that in this case.


  • Many people who don’t know what they’re talking about in this thread. No, used memory does not include cached memory. You can confirm this trivially by running free -m and adding up the numbers (used + cached + free = total). Used memory can not be reclaimed until the process holding it frees it or dies. Not all cached memory can be reclaimed either, which is why the kernel reports an estimate of available memory. That’s the number that really matters, because aside from some edges cases that’s the number that determines whether you’re out of memory or not.

    Anyway the fact that you can’t run Linux with 16GB is weird and indicates that some software you are using has a RAM leak (a Firefox extension perhaps?). Firefox will use memory if it’s there but it’s designed to cope with low memory as well, it just unloads tabs quicker so you have to reload often. There are also extensions that make tab unloading more aggressive, maybe that would help - especially if there’s memory pressure from other processes too.





  • In this case it’s more of a switch away from the last cool new thing. Totem (like Music) was built around a media library navigated from within the app. By default Totem doesn’t even support opening videos from the file manager, which is something you would probably expect of a video player. It also crashed for me when I tried using it as intended so I’m not surprised to see it replaced by an app that really is just a video player.

    That said many apps get replaced not for feature reasons but just by being GTK3, and they tend to get replaced by their own forks to GTK4 (such as the upcoming replacement of Evince). Why their devs choose to upgrade toolkits this way I cannot say.



  • It’s prettier than a TTY and you can pick whether you want a Wayland or an X11 session without having to know the correct startup commands. You can pick between different desktops too. And a Display Manager can offer on-screen keyboard and touchscreen support while a TTY can’t (at least GDM does, I’m not sure about SDDM off the top of my head).

    Aside from that whatever command you are using in the TTY to launch Plasma might or might not be the same commands SDDM uses, which might or might not lead to issues in setting up the environment. If your environment is fine and you don’t care about having to use a physical keyboard then of course you can remove it. It’s not exactly load bearing.




  • I am very sorry to remind everyone about the existence of Visual Basic, but it has:

    • VbCrLf
    • VbNewLine
    • ControlChars.CrLf
    • ControlChars.NewLine
    • Environment.NewLine
    • Chr(13) & Chr(10)

    And I know what you’re asking: Yes, of course all of them have subtly different behavior, and some of them only work in VB.NET and not in classic VB or VBA.

    The only thing you can rely on is that “\r\n” doesn’t work.


  • OinkstoLinux@programming.devThe Wizard and His Shell
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    5 months ago

    GUIs do have advantages in things like discoverability. Honestly the 1983s Apple Lisa nailed this with the idea of having clickable menus annotated with keyboard shortcuts, so users could do the same thing faster next time. For some reason we stopped doing this (especially in web apps), but that’s a reason to make better GUIs, not to RETVRN to the feature set of a VT100.

    I don’t know why we have to go on nonsensical diatribes about “UNIX wizards” though when we’re fundamentally talking about a handful of minor UI improvements to things that already exist.


  • Oinkstolinuxmemes@lemmy.worldKudos to Nvidia
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    5 months ago

    It depends a lot on which specific GPU you have and whether it’s a laptop.

    New-ish GPU in a desktop with the monitor plugged directly into the GPU? Easy to get working, literally a checkbox on most distros.

    1000 series GPU or older in a laptop and you need reasonable battery life and/or some “advanced” features like DP Alt-Mode? Good luck.

    Edit: Also, no Wayland until very recently. Possibly never, depending on the age of the GPU.


  • It’s wild how on the orange website I can read entirely sensible discussions about tricky Bash semantics or whatever, while people in a parallel thread are seriously arguing the Trump admin’s repressions are dwarfed by… whatever “repressions” they think happened during Covid. And I don’t even click on the threads about disabilities (especially autism) anymore because it’s so predictably sad.