196
submitted 11 months ago by BlanK0@lemmy.ml to c/linux@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] walthervonstolzing@lemmy.ml 20 points 11 months ago* (last edited 11 months 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.)

[-] lefaucet@slrpnk.net 3 points 11 months ago

Bad ass! Thank you for this wisdom

this post was submitted on 29 Jan 2024
196 points (98.5% liked)

Linux

48721 readers
2365 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS