Skip Navigation

User banner
Posts
0
Comments
159
Joined
2 yr. ago

  • 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.)

  • My experience is very limited, especially on GTK3; but I think GTK4 really streamlined listview/model operations, especially with the newly introduced GtkExpression, & the ability to bind GObject properties to expressions that the toolkit will figure out when to evaluate & plug in.

    The following blog entries help establish the fundamental concepts pretty well, I think: https://blog.gtk.org/2020/06/07/scalable-lists-in-gtk-4/ https://blog.gtk.org/2020/06/08/more-on-lists-in-gtk-4/ https://blog.gtk.org/2020/09/08/on-list-models/ — but the crux of the matter really is GObject, & signalling; & ToshioCP's tutorial fills an important gap in the existing body of documentation.

    Also, the Lists section on the Gtk4 Demo app is really helpful (e.g., the comments on the 'Clocks' example explain how to use GtkExpression really well: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/demos/gtk-demo/listview_clocks.c?ref_type=heads#L2 ).

    -- EDIT: Also, I think the new GJS 'GTK4 Book' does a good job explaining the new widgets & data structures -- so even if you aren't using the JS bindings, the code examples can be helpful: https://rmnvgr.gitlab.io/gtk4-gjs-book/application/list-widgets/ ; I never used GJS (just C, and pygobject); but the GJS book helped me quite a bit wrt the ListStore, and setting up DBus connectivity:

  • Where's the 'PtrSc' key? On Peter's keyboard presumably.

  • Sure if you drag it through the garden.

  • King shit

    Jump
  • What I can't quite make sense of, is how 'James' itself is a diminuitive of 'Jacob'.

  • King shit

    Jump
  • I believe 'Harry' is the Welsh version of English 'Henry', & German 'Heinrich'. ... At least that's the impression I got from Shakespeare's 'Henriad' plays (H. IV 1-2, & H. V)

  • GNU-Epoch is not the UNIX-Epoch.

  • Hi; I rely on nvidia-smi mostly; but the nvidia-settings gui app also shows temperatures & wattage (though that app might be x11-only).

  • 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.

  • Chromium has been running on a fork of WebKit called 'blink' for a while now; 'bare' WebKit is closer to Safari.

  • 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.

  • 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.

  • Another vote for Tesseract -- just to clarify the terminology, though: PDF is a fragile format best used read-only; so you really don't want to edit a pdf, but make a new one using the same (or cleaned-up) bitmaps and a new ocr text layer.

    Now, tesseract is excellent at recognizing glyphs; but especially if the scanned image is a little fuzzy, the layout detection falters; and when it falters, you get redundant line breaks, & chunks of text in the wrong order -- all of which gets incredibly annoying for searching & copying purposes. So if you can spare the time, and the text requires it, you may need to mark regions (paragraphs & titles mainly) on the bitmap image manually. There exist a few frontends to Tesseract that help with a task like that; check out, e.g., https://github.com/manisandro/gImageReader - inside single paragraph blocks of text, Tesseract doesn't get as easily confused; and the text output is in the correct reading order, & w/o redundant breaks.

  • Better cite Wozniak as the one who 'made' Apple; but anyway.

  • I have a little extension of my own that just sends out selections from the `` tag from a tab open on Firefox to my database; I haven't been able to figure out how to add that to any collection — neither do I want to, because it's of no use to anyone but me, as the 'database' in question is just postgrest running on my home router; so I don't want to make this extension public. So for now I'm using HTTPShortcuts on Android for a similar purpose; though it can only send out a url from a 'share' option under Firefox.

  • As of bash 4.3, (which came out nearly 10 years ago) it's possible to get readline to set a variable to do that: https://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES?h=bash-4.3#n832

    I've haven't used bash in a long time, but there are many questions/answers on stackoverflow that provide hints as to implementing an indicator like that. One zsh's 'zle' (line editor) it's a matter of setting an environment variable inside a custom prompt; so the bash approach should be similar.

  • Oh wow I didn't realize he repeated 'developers, developers, ...' 666 times on that event.