You are not logged in.
Pages: 1
In OpenSuse/Plasma one can place a Filemanager-SuperUser launch icon
in the panel and clicking it will ask for the password after which it works
exactly as if root had launched it. I make this icon red, and the window will
also sport root colors which I set to red so that there is never any doubt.
It's the best idea Suse ever had, I've been doing this for a very long time
and have never had a problem.
here's my suse-Plasma DT, see left panel below date:
https://i.imgur.com/uRNgqGr.png
here the same in Devuan-XFCE where the icon is there
but I haven't tried to make it work yet:
https://i.imgur.com/kvN9DNF.png
Presently I'm working on my Slackware system in which the only
FM I can launch with sudo is thunar (I use a special version of
the above icon with a white "Th" in it).
sudo thunar
which gets me a thunar window with root privs.
This window even has a (_barely_) pinkish alert-bar saying
"Warning: you are using the root account.You may harm your system"
Question-1:
Where is this color/text stored? It's not enough, can I make it louder?
Question-2:
How can I launch any other FM off an icon or in cLi as root with sudo
(no pwd since I have sudoers set up that way)?
TIA
Offline
You really shouldn't use "sudo thunar" - too many things can go wrong with environment and permissions if you run it that way. The preferred method is to invoke it with:
pkexec thunar
...or:
thunar admin:///
Both of those will safely preserve your current environment. Only the pkexec will still have the warning/infobar though.
To answer your questions:
Question-1:
Where is this color/text stored? It's not enough, can I make it louder?
It uses the theme's color settings for alert bars - it can be overridden though. See: https://forum.xfce.org/viewtopic.php?id=14935. You would use "color" and "background-color" variables.
Edit: you need to add the following to /root/.confg/gtk-3.0/gtk.css:
.thunar infobar * { background-color: blue; color: yellow }
Question-2:
How can I launch any other FM off an icon or in cLi as root with sudo
(no pwd since I have sudoers set up that way)?
If you have sudoers set up to not require a password, then launch the app still using "sudo appname" (please see my first point) and you won't be prompted for the password.
Last edited by ToZ (2022-03-23 21:44:15)
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
You really shouldn't use "sudo thunar" - too many things can go wrong with environment and permissions if you run it that way.
Such as?
When I launch an FM as SU I want no constraints, not even if I want to recursively delete or reperm every file on a partition.
So much more reason for serious warning. For example in Plasma I set up for the window colors to be red as well.
The preferred method is to invoke it with:
pkexec thunar
...or:
thunar admin:///
Only the pkexec will still have the warning/infobar though.
That's why I'll stick with pkexec or sudo :-)
But it's nice to know about admin:/// too, especially since in the case of other than thunar the other two error out with
# pkexec dolphin
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Aborted
It uses the theme's color settings for alert bars - it can be overridden though. See: https://forum.xfce.org/viewtopic.php?id=14935. You would use "color" and "background-color" variables.
Edit: you need to add the following to /root/.confg/gtk-3.0/gtk.css:.thunar infobar * { background-color: blue; color: yellow }
Thank you very much.
That ref. says to edit /root/.config/gtk-3.0/gtk.css
.thunar .warning { font-size: 0pt; margin: -30px; }
I've never done any CSS, an explicit example would be appreciated. And since Thunar seems to be the only FM that I can launch with either of the two methods giving a possibility for such a warning, I definitely do want to edit that 'css' :-)
Offline
That ref. says to edit /root/.config/gtk-3.0/gtk.css
.thunar .warning { font-size: 0pt; margin: -30px; }
I've never done any CSS, an explicit example would be appreciated. And since Thunar seems to be the only FM that I can launch with either of the two methods giving a possibility for such a warning, I definitely do want to edit that 'css' :-)
I think the reference was for a previous version of thunar. For the current version, use:
.thunar infobar * { background-color: blue; color: yellow }
...and change the colors to suit (you can use RGB designations as well - e.g. #ff0000). Put the content into the file /root/.config/gtk-3.0/gtk.css
(create the file if it doesn't exist).
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Created folder and file, works like a charm. Thanks!
Offline
The preferred method is to invoke it with:
pkexec thunar
...or:
thunar admin:///
Both of those will safely preserve your current environment. Only the pkexec will still have the warning/infobar though.
What is this admin:/// ??? Never seen that before. On some of my debians this gets a 'operation not supported' and on older setups it WIPES out thunar function! No error or return from a terminal invoking just thunar, and menu or launchers cease working! What does this depend on? Nowhere does it work for me?
I use pkexec usually and it works fine.
Offline
Gvfs supports a number of schemes including admin:///, computer:///, recent:/// (see https://wiki.gnome.org/Projects/gvfs/schemes). Depending on your distro, you may need to have extra packages installed and you need to have polkit set up properly. Try running:
thunar admin:///
...from a terminal window to see if it generates any errors. I'm not sure exactly when it was made available, so its possible that older versions of gvfs may not support it.
In fact, the newer versions of thunar will have shortcuts in the sidebar for computer:/// and recent:///. You can also create a bookmark to admin:/// and have it easily accessible from within thunar as well.
Edit: gvfsd-admin was added to gvfs version 1.29.4
Last edited by ToZ (2022-03-24 10:45:48)
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Interesting, I guess I did know some of that.
$ thunar admin:///
Thunar: Failed to open "admin:///": Operation not supported
$ apt policy gvfs
gvfs:
Installed: (none)
Candidate: 1.46.2-1
Version table:
1.46.2-1 500
So that one I guess is obvious, a stripped narrow focus Debian11 vm without a pkexec enabled user and no sudo installed. I wondered if this 'cheat' would work.. On another below is a Debian10 with an polkit empowered user pkexec opens a root thunar with no errors.
$ apt policy gvfs
gvfs:
Installed: 1.38.1-5
Candidate: 1.38.1-5
Version table:
*** 1.38.1-5 500
500 http://ftp.us.debian.org/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
$ pkexec thunar
However '$ thunar admin:///' in that one makes a mess without showing any error. Following the command, 'thunar' in the terminal then does nothing. 'Directory Menu' will not spawn a thunar, The generic "File Manager" menu entry then opens "File Manager Settings" instead of the declared thunar. It clears on next logon.
I will keep an eye on this and test more Debian variations when convenient. Don't consider it something to fix, I was curious to whether it offered a privileged shortcut that should no bet. Polkit is setup a little different in Denian and I'm unsure how this relates since the ill effect is on a system with a fully configured and working polkit.
Offline
Pages: 1
[ Generated in 0.012 seconds, 9 queries executed - Memory usage: 580.88 KiB (Peak: 598.16 KiB) ]