On Mon, 4 Nov 2019 18:15:52 +0100, "R.Wieser"
declaimed the following:
>Dennis,
>
>> As can be seen, this R-Pi 3B+ running a recent Raspbian (via
>> NOOBS) does NOT show differences.
>
>Odd. My NOOBS (v3.2.0) installation is just a few weeks old with just a
>few packages added (gtk2 & 3). Though when I did that "xdg-mime query
>filetype" on a python script hashbanged* with "python3" it returned
>"text/x-python3".
>
>*you're calling it "shebang". Is that the official name ?
>
I learned "bang" for ! back in the 70s, where it was used on Xerox CP/V
OS for command script lines (no bang meant it was data line).
I learned "shebang" as short for "shell bang". My mind tends to use
"sharp" or "pound" for # (though technically, a "sharp" has two vertical
lines and two slanting horizontals, while the "octothorpe" has slanted
verticals and plain horizontals). {Hmmm, I suppose "shabang" would be an
option for "sharp bang"}
Possibly the gtk# installs rewrote some of the MIME tables.
pi@rpi3bplus-1:~$ dpkg-query -l gtk*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-================================-==============-============-==============
=================
ii gtk-update-icon-cache 3.24.5-1+rpt2 armhf icon theme
caching utility
ii gtk2-engines:armhf 1:2.20.2-5 armhf theme
engines for GTK+ 2.x
ii gtk2-engines-clearlookspix:armhf 1:2.20.7 armhf clearlookspix
theme for GTK+ 2.
ii gtk2-engines-pixbuf:armhf 2.24.32-3+rpt1 armhf pixbuf-based
theme for GTK+ 2.x
ii gtk2-engines-pixflat:armhf 0.2 armhf PiXflat
theme engine for GTK+ 2
un gtk2.0-binver-2.10.0 (no
description available)
un gtk3-binver-3.0.0 (no
description available)
pi@rpi3bplus-1:~$
(I think that says "ii" Install/Installed, "un" Unknown/Not) Only have gtk2
stuff from the looks of it, so I'd suspect gtk3 might have changed a few...
>> pi@rpi3bplus-1:~$ cat /etc/mailcap
>
>What is "mailcap", and why should I be looking in it for stuff related to
>mimetypes ? I would assume, from the name, it has something to do with
>email, but I must be wrong there ...
>
MIME => Multimedia Internet Mail Extension
The original usage was for email headers to identify what non-text content
is encapsulated in email.
"mailcap" was a file identifying "mail capabilities". That is -- what
program is needed to process an email containing specific MIME data.
The usage by Linux desktops is secondary -- ie: we already have a file
linking MIME types to programs, can we somehow make use of that to launch
files from a desktop?
>P.s.
>Do you know if there is a tool/app available to add/change desktop icon
>assignments for non-app files (like the python script files) ? I've been
>able to do it by hand, but if there is something simpler available I'm all
>for it. :-)
>
Unfortunately, the only time I run a desktop is when installing a new
NOOBS release. All the rest of my usage has been via SSH login to a text
console.
I'd probably have to start by reading something like...
https://wiki.archlinux.org/index.php/XDG_MIME_Applications although I don't
see anything specific to the icon that would be displayed.
I do have a desktop for Debian 10 running inside VirtualBox on my
Windows machine. I use XFCE (rather than some variant of LXDE/LXQT) on
that, and it shows a generic "text document" for a .py file. But then, it
also shows that for an executable (compiled) C program...
I find...
wulfraed@debian:~$ cat /usr/share/applications/python3.7.desktop
[Desktop Entry]
Name=Python (v3.7)
Comment=Python Interpreter (v3.7)
Exec=/usr/bin/python3.7
Icon=/usr/share/pixmaps/python3.7.xpm
Terminal=true
Type=Application
Categories=Development;
StartupNotify=true
NoDisplay=true
But the icon appears to only be used by the desktop when displaying, say,
the right-click "open with" menu.
https://www.oreilly.com/library/view/linux-annoyances-for/0596008015/ch01.html
(about halfway down) has a section of creating launchers, but for Python it
would be specific to a particular script. That is, you'd have to create one
for each Python script you wanted to run by just clicking on it. In my test
it created a file (note: normally this would be IN the Desktop directory as
it shows on the desktop itself -- but I moved it into my home directory
where it show in the file manager)
wulfraed@debian:~$ cat test.py.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=test.py
Comment=Python 3.x
Exec=/usr/bin/python3.7 /home/wulfraed/test.py
Icon=python3.7
Path=/home/wulfraed
Terminal=true
StartupNotify=false
wulfraed@debian:~$
That means I have both test.py (source file with just text document icon)
and test.py.desktop (launcher using Python icon) in my home directory. The
launcher can be moved to other locations.
There is no one-time just to change the icon of the .py files, that I
can find. One could create a script that searches for *.py files and
creates *.py.desktop files, putting the proper path on the Exec line, and
also in Path, and the correct Name too. Though it would have to assume
either "terminal=true" or assume all such files are GUI scripts.
I just connected a display to the R-Pi. Created a similar file
(couldn't find a simple way to do that from the GUI -- had to use text
editor). Then found I had to install xterm -- seems the "launch in
terminal" doesn't find the R-Pi terminal. R-Pi is also trying to be
"friendly" in that it pops up a requester when you double click asking if
you want to execute or open (hmm, maybe I needed to chmod the .desktop file
so it was flagged as an executable). Not sure where it found the Icon it
used, it didn't look like a Python icon. But... the gist is that a
/launcher/ file can be created for specific script files, and the launcher
can have an icon specified.
I've found nothing equivalent to how Windows associates icons to file
types (which seems to be that it uses the icon associated with the
application specified in the OpenWith registry entry of the file /type/).
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|