Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-03-30 17:56:45

jpk
Member
Registered: 2018-03-30
Posts: 3

Hiding Desktop Icons from command line

Dear All - Really enjoying XFCE! I have a question and have searched quite a bit but have not found a conclusive answer.

I have an Ubuntu 16 LTS box with a bunch of non-sudo user accounts on it. Each account can be "XRDP"ed into. XFCE is the environment that fires up when the XRDP connection is started. I would like to:
- Hide all icons on the desktop
- Hide the top menu bar
Essentially a kiosk with a browser running in kiosk mode.

I know that I can use the GUI - however, I am looking for a CLI way to do this for 30-40 users. Also, using the GUI per user will not work since by default when an XRDP session is disconnected, the session is not restored. You have to change the port mapping from -1 to ask<Port #> etc. which I don't want to do for 30-40 users.

I looked at https://forum.xfce.org/viewtopic.php?id=6348 and it does seem interesting but not quite on the lines of what I was looking for. I have run xfce4-about to get the version number but all I see is:

xfce4-about: Cannot open display: .
Type 'xfce4-about --help' for usage information.

I searched and tried
xfconfig-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
but my system does not have xfconfig-query installed

Any advice is very welcome!

Offline

#2 2018-03-30 19:09:49

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,625

Re: Hiding Desktop Icons from command line

Hello and welcome.

searched and tried
xfconfig-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
but my system does not have xfconfig-query installed

The command is actually xfconf-query.

I would like to:
- Hide all icons on the desktop
- Hide the top menu bar

What exactly are you referring to when you say "top menu bar"? Every app's "File Edit ...." bar, or the panel?

xfce4-about: Cannot open display: .
Type 'xfce4-about --help' for usage information.

Are you running this in a graphical environment? Try instead:

xfce4-about -V

I would suggest creating a script that runs your xfconf-query command, create a .desktop file for that script and put it in /etc/xdg/autostart so that it executes for every user on log in. For the menu/panel part, if it's the panel you don't want displayed, add "xfce4-panel -q" to the end of the script (or uninstall xfce4-panel if you don't want to use it)..

Offline

#3 2018-03-31 00:07:39

jpk
Member
Registered: 2018-03-30
Posts: 3

Re: Hiding Desktop Icons from command line

Thank you :-) - Appreciate the reply!

I tried from the CLI
xfconf-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
and got
Failed to init libxfconf: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11.

Then I logged into an XRDP session and tried out the command and it ran, essentially that from the CLI - there was no X11 session Duh!
xfce4-about -v gives 4.12.1

Running the Xfconf-query command above in the xrdp session does not give any errors, however, the changes don't seem to take effect for the users even on a reboot.

I attach an image of what I would like to accomplish.
https://ibb.co/dTVn0S

I made a script, chmod +x ed it, chowned root:root it and dumped it in /etc/xdg/autostart and then rebooted but still on a xrdp connection the menu at the top and the bottom of the screen and the icons still appear - arrggh! Here is what is inside the script

#!/bin/sh

xfconf-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
xfce4-panel -q

Thank you in advance for any guidance!
PS - I did verify that when in an active RDP session, xfce4-panel -q hides both top and bottom menus but
xfconf-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
does not get rid of the home, filesystem etc. icons.

Offline

#4 2018-03-31 00:14:20

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,625

Re: Hiding Desktop Icons from command line

jpk wrote:

PS - I did verify that when in an active RDP session, xfce4-panel -q hides both top and bottom menus but
xfconf-query -c xfce4-desktop -np '/desktop-icons/style' -t 'int' -s '0'
does not get rid of the home, filesystem etc. icons.

Can you post back the results of the following commands:

ps -ef | grep xfconfd
ps -ef | grep desktop
xfconf-query -c xfce4-desktop -lv

Edit:

I made a script, chmod +x ed it, chowned root:root it and dumped it in /etc/xdg/autostart and then rebooted but still on a xrdp connection the menu at the top and the bottom of the screen and the icons still appear - arrggh!

Put the script in /usr/local/bin and put the following (myconfig.desktop) into /etc/xdg/autostart:

[Desktop Entry]
Version=1.0
Name=CustomConfigs
Comment=My Custom Configs
Exec=/usr/local/bin/myscript
Icon=applications-system
Terminal=false
Type=Application
StartupNotify=false
OnlyShowIn=XFCE;

It should show up in every user's Settings Manager > Session and Startup > Application Autostart list.

Last edited by ToZ (2018-03-31 00:22:04)

Offline

#5 2018-03-31 00:43:06

jpk
Member
Registered: 2018-03-30
Posts: 3

Re: Hiding Desktop Icons from command line

Yes - I will try this- and thanks for the amazingly helpful reply!

I googled around a bit and tried a few things. I used

echo -e '#!/bin/sh\nxfce4-panel -q;\nxfconf-query -c xfce4-desktop -np '"'"'/desktop-icons/style'"'"' -t '"'"'int'"'"' -s '"'"'0'"'"';

to dump the commands in a shell script in the kiosk users home dir, chmod'ed it and chowned it by every individual user and then I find that including the script to start on an xrdp session is actually doing the trick. Not quite clear why this is working now, will need to verify if everything is good after reboots and some more testing.

From the CLI if I try the commands for a user I get the following results. Applogies for the image, apache guacamole - xrdp combo won't let me copy out the results easily so took a screenshot.
https://ibb.co/f4mc0S

The approach you suggest for the .desktop file , I did a version of that in .config/autostart/ and wrote a script to kick out unused xrdp sessions. I just tagged the above code to the existing commands that get executed on startup of an xrdp session and right now for 1 account it works. I'll verify and update the thread in a bit.

Thank you again for the massively useful guidance!

Offline

Board footer

Powered by FluxBB