Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-05-12 09:31:15

zorggy
Member
Registered: 2016-05-12
Posts: 6

Configure context menu

Hello,

I need to create a complete desktop environment for special users and I'm testing Xfce. Here is what is necessary:

  • No bars at all (task manager, application laucher...)

  • A context menu (from the right mouse button) for special applications and to log out

I've been able to remove the bars and to create a brand new 'Applications' sub-menu of the context menu. However this is not completely what I would like. Is it possible to fully customize the context menu? If yes, how to do it?

Thanks in advance,
Zorggy.

Offline

#2 2016-05-12 13:02:59

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 8,040

Re: Configure context menu

Hello and welcome.

zorggy wrote:

Is it possible to fully customize the context menu?

Unfortunately no, its currently hard-coded.

However, if you disable icons on the desktop and enable the applications menu on the right click (Settings Manager > Desktop > Icons > Icon Type and Settings Manager > Desktop > Menus), you can have your system only display a customized Applications menu.

Offline

#3 2016-05-12 14:05:38

zorggy
Member
Registered: 2016-05-12
Posts: 6

Re: Configure context menu

Thank you very much for your fast reply, ToZ. The solution you gave works even if the installed version of xfce is 4.10.1, so the path is not exactly the same: In the Desktop window, Icons tab, there is a combo named 'Icon Type' providing 3 choices. It was 'File/launcher icons' and I set 'Minimized application icons'. Thank you again, the solution was not obvious!

I have another question related this problem: Intead of using graphical interface to change the settings, is it possible to modify some files, in the OS or in the user's home directory? I have hundreds of hosts multiplied by dozens of such users.

Offline

#4 2016-05-12 14:24:29

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 8,040

Re: Configure context menu

zorggy wrote:

I have another question related this problem: Intead of using graphical interface to change the settings, is it possible to modify some files, in the OS or in the user's home directory? I have hundreds of hosts multiplied by dozens of such users.

Perhaps. When are you trying to modify these files? If the user accounts have not yet been setup, then you can modify the default settings in /etc/xdg/xfce4 (may be different depending on the distro you are using) and upon account creation, those settings would be used.

If you are looking at making the changes to existing user accounts, it gets a more complicated. BTW, you don't need to use the graphical interface to make these changes, you can also use the command line xfconf-query utility as well. This ends up beign a good alternative for scripted changes.

Offline

#5 2016-05-12 15:13:57

zorggy
Member
Registered: 2016-05-12
Posts: 6

Re: Configure context menu

We are using CentOS7, creating the special accounts and all their configurations.
Wow, I didn't know the xfconf-query utility. It's a kind of magic! Running

xfconf-query -c xfce-desktop -p /desktop-icons/stype -s 1

directly forces the parameter I want, and it is dynamic, no need to reload anything!

I still need to investigate this tool to force no panel and few other things. This forum is very reactive, it's a pleasure!

Offline

#6 2016-05-18 09:29:25

zorggy
Member
Registered: 2016-05-12
Posts: 6

Re: Configure context menu

Hello,

I come back after having integrated the menu construction into our deployment tool for tests. It's clean as changes are limited to ~/.config/menus/foo-applications.menu, ~/.local/share/applications/*.desktop and ~/.bashrc for XDG_MENU_PREFIX=foo-. This will impact only special users.

However I'm still blocked for some Xfce parameters such as the one previously described: the way to change the applications menu is directly displayed as the context menu (mouse right click on desktop). The xfconfig-query command can only be run by users while graphically logged in. I need to configure almost 50000 special accounts, I can't do it manually.

It would be perfect to change Xfce parameters only for special users directly from root tasks (with no X connection). Is it possible?

Last edited by zorggy (2016-05-18 09:40:59)

Offline

#7 2016-05-18 12:50:44

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 8,040

Re: Configure context menu

Generally speaking, you have 2 options that you can use to accomplish this:

1. If an X session is not available (the user is not logged in), you can manually edit the associated xml configuration files (in this case ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml). With respect to the desktop-icons configuration, something like this should do:

sed -i '/<property name="style" type="int"/s/value="."/value="1"/' /home/USER/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml

2. Create a .desktop entry in the global startup directory (usually /etc/xdg/autostart) that will run a shell script that will automatically run the xfconf-query commands when the user logs in.

Offline

#8 2016-05-18 15:20:53

zorggy
Member
Registered: 2016-05-12
Posts: 6

Re: Configure context menu

Oh it's great! One step further...

I would like not to touch a general setting that could affect normal users, so fiddling with xml files is a good way. However the ~/.config/xfce4 hierarchy does not exist until the user logs in with Xfce the very first time. So it's not possible to modify files not yet there.

My next question is then: would it be possible to create the ~/.config/xfce4 hierarchy for a user without really starting Xfce?

Thank you ToZ for your multiple replies.

Offline

#9 2016-05-18 17:41:02

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 8,040

Re: Configure context menu

If the user has not yet logged in, the ~/.config/xfce4 hierarchy will be created by copying over the default one (usually /etc/xdg/xfce4). You can place a default xfce4-desktop.xml in (/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/ and it should be used as the default xml config file for all new users (I haven't tested this, but it should work).

Thank you ToZ for your multiple replies.

No worries, but I'm starting to get curious about what you're doing with Xfce. You mentioned earlier 50000 accounts. Are you trying to take over the world?

Offline

#10 2016-05-19 07:08:19

zorggy
Member
Registered: 2016-05-12
Posts: 6

Re: Configure context menu

OK, it's logical and simple. But I won't modify the source directory (/etc/xdg/xfce4) so that normal users won't be affected, I will only force special users' directories with some changes, then I'll be sure these special environment will stay stable.

I don't see any other problem for now. I need to go ahead, check all that and include it in the upgrade management to provide a full operational environment for the control rooms. There are more than 60 special users multiplied by more than 750 workstations. We are still using icewm which is not much developped and no longer supported by our distribution. So I'm exploring other light WM and Xfce seems a good solution. I have to provide the same environment as before without the bugs of icewm smile The world can continue sleeping, I won't invade it with Xfce...

Offline

Board footer

Powered by FluxBB