Lock panel

Forum rules
Before you post please read how to get help
Post Reply
DavidTerp
Level 2
Level 2
Posts: 99
Joined: Tue May 17, 2016 11:18 am

Lock panel

Post by DavidTerp »

Hello,

The following commands can lock the panel, in order to prevent user to move icons or indicators, for Xubuntu:

Code: Select all

sudo cp  ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
sudo sed -i '/<channel/ s/>/ locked="*" unlocked="root">/' /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
pkill xfconf
xfce4-session-logout --fast --logout
Unlock:

Code: Select all

sudo rm /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
pkill xfconf
xfce4-session-logout --fast --logout
With Linux Mint XFCE, these commands have alternative effect. The lock don't keep our panel customized and restore the default panel... locked. The unlock restore our panel customized. What the hell is that?
So, please, could you tell what commands can lock/unlock panel in order to keep our panel customized?
Try yourself:
1- Let's go to customize your panel
2- Lock it with the commands
3- See the beautiful default panel locked
4- Unlock the panel with these commands and see your panel customized.
Desktop : Linux Mint Mate latest release - Intel i5 - 8 GB - Dualboot Windows
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: Lock panel

Post by MrEen »

HI DavidTerp,

Your steps have confused me (usually quite easy to do) as the the ~/.config copy should override what's in in /etc/xdg, yet you're altering the latter.

I can toggle locked/unlocked with this command:

Code: Select all

xfconf-query -c xfce4-panel -p /panels/panel-1/position-locked -T
If you have multiple panels, you might need to check the panel names first with this command:

Code: Select all

xfconf-query -c xfce4-panel -p /panels -lv
You'll notice the "grab bar" on the panel disappears as soon as the locking toggle fires, so no logout necessary.

Does that help?
DavidTerp
Level 2
Level 2
Posts: 99
Joined: Tue May 17, 2016 11:18 am

Re: Lock panel

Post by DavidTerp »

I tested. Your command don't lock the position of icons, neather indicators, of the panel. I checked the name of the panel before. I'm here to get about the way to lock the entire compound of the panel, including position of icons, menu and indicators. I think you didn't check my demand before reply. Could you test my command posted with a virtual machine to see what I mean. I don't talk about the lock option in the settings of panel:
https://i.imgur.com/rsFVajS.png
With the commands to lock, the move option is missing:
https://i.imgur.com/PrciAkV.png
Desktop : Linux Mint Mate latest release - Intel i5 - 8 GB - Dualboot Windows
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: Lock panel

Post by MrEen »

Well, I can't test it right now, but will try to in the next few days. I'm still using Mint 18.3 and there is no locked="*" setting in the file, so the sed command won't do anything here.

I must say I cannot understand how it could work, when you're altering the file in /etc/xdg... which should never get read when the copy in ~/.config still exists. Are you following that by logging in as root? Or is this so new users that are created after this have the new settings?
ajgreeny
Level 5
Level 5
Posts: 704
Joined: Mon Nov 19, 2007 3:27 pm

Re: Lock panel

Post by ajgreeny »

I've never done this to a panel but there was a time, when I used desktop launchers, that I made the files that control the launcher icons immutable with command

Code: Select all

sudo chattr +i .config/xfce4/desktop/icons*
Edit this to .config/xfce4/panel for your situation
Doing this stopped those launchers changing their position on the desktop, which did happen quite often and was very annoying.
You will have to remove the immutable flag if you should need or want to make any changes youtself to the panel with command

Code: Select all

sudo chattr -i .config/xfce4/panel/*
I have no idea if you can do that to the panel configuration files or possibly the folder .config/xfce4/panel to stop any changes being made to those files.

I don't know if this will work to stop users of the GUI removing items from the panel or if it simply means that those items will be replaced automatically when you next login.
Give it a try and let us know.
DavidTerp
Level 2
Level 2
Posts: 99
Joined: Tue May 17, 2016 11:18 am

Re: Lock panel

Post by DavidTerp »

ajgreeny wrote:
Mon Nov 23, 2020 5:21 pm
I've never done this to a panel but there was a time, when I used desktop launchers, that I made the files that control the launcher icons immutable with command

Code: Select all

sudo chattr +i .config/xfce4/desktop/icons*
Edit this to .config/xfce4/panel for your situation
Doing this stopped those launchers changing their position on the desktop, which did happen quite often and was very annoying.
You will have to remove the immutable flag if you should need or want to make any changes youtself to the panel with command

Code: Select all

sudo chattr -i .config/xfce4/panel/*
I have no idea if you can do that to the panel configuration files or possibly the folder .config/xfce4/panel to stop any changes being made to those files.

I don't know if this will work to stop users of the GUI removing items from the panel or if it simply means that those items will be replaced automatically when you next login.
Give it a try and let us know.
These commands doesn't lock then panel. I didn't succeed to modify to lock the panel.
Desktop : Linux Mint Mate latest release - Intel i5 - 8 GB - Dualboot Windows
Post Reply

Return to “Xfce”