pointless

  • 0 Posts
  • 33 Comments
Joined 1 year ago
cake
Cake day: June 23rd, 2023

help-circle








  • Putting the following with executable permissions inside ~/.local/share/nautilus/scripts/SCRIPTNAME adds a right click menu to Nautilus that serves the same purpose:

    #!/bin/bash
    
    CLIPBD=''
    [[ "${XDG_SESSION_TYPE}" == "x11" ]] && CLIPBD='xsel -ib'
    [[ "${XDG_SESSION_TYPE}" == "wayland" ]] && CLIPBD='wl-copy --trim-newline' && wl-copy --clear
    
    echo -n "${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}" \
      | tee >(xargs -I {} notify-send "Path Copied:" "{}") \
      | ${CLIPBD}
    

    The ‘notify-send’ bit isn’t necessary; it just puts up a notification.

    Mentioning only because it’s a simple demonstration of a pretty easy way to extend Nautilus for all kinds of purposes; w/o messing around with the pygobject interface. (There’s supposed to be an xdg standard for file manager extensions like this, but managers use their own custom folders, syntax, etc. for such extensions. I think pcmanfm adheres to the standard; Dolphin requires a .desktop file somewhere; Thunar, Caja, & Nemo work similar to Nautilus.)






  • wvstolzing@lemmy.mltoLinux@lemmy.mlIs anyone using awk?
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    6 months ago

    awk predates perl as well as python by a pretty large margin (1978); it’s useful, of course, for processing things in a pipeline, but as it became obsolete as a general-purpose scripting language, users have had less and less of a reason to learn its syntax in detail – so nowadays it shows up in one-liners where it could be replaced by a tiny bit of cut.

    I had worked through a good bit of the O’Reilly ‘sed & awk’ book – the first programming book I got, after being enticed by shell scripting in general. Once I learned a bit of Python, & got better at vim scripting, though, I started using it less and less; today I barely remember its syntax.


  • FWIW, I’m typing this on the latest GNOME, on wayland, on nvidia proprietary drivers; and it works just fine — EXCEPT for suspend & resume, which is annoying to be sure; but on 2 screens with different refresh rates & different dpi ratios I at least don’t run into some of the weird behavior I do run into using X11.

    I used to be an Xfce purist; but this particular setup is even less taxing on the GPU (GTX 970) compared to Xfce’s standard compositor (around 20W on light usage, vs. 35+W); & and the font rendering is slighly better, which is a huge factor AFAIC.


  • wvstolzing@lemmy.mltoLinux@lemmy.mlD-Bus overview
    link
    fedilink
    arrow-up
    26
    ·
    edit-2
    6 months ago

    Skimmed over the whole article – I wish this had been available back when I was trying to piece together the basics from the documentation. There really needs to be a 2nd part, though, with some discussion of the GVariant signatures, which the author says were ‘beyond the scope of’ this article – which is true; nevertheless, understanding that syntax (and how to use it e.g. with gdbus) is an absolute requirement for using dbus properly; and as a silly amateur, I lost so much time over them.