WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Disabling the desktop click menu [SOLVED]  (Read 10872 times)

Offline 2os

  • Newbie
  • *
  • Posts: 22
Disabling the desktop click menu [SOLVED]
« on: April 23, 2014, 09:38:29 PM »
I create TC flash drives for use by end users for specific purposes. The context menu that appear when clicking on the desktop contain menu items that if used by and end user, will disrupt their session (e.g. Logout). I researched this forum and figured out that the click context menu can be disabled by editing the content of flwm_topside.tcz.

I unpack flwm_topside.tcz and rename this file: /usr/local/bin/flwm_topside to something else. Then I repack flwm_topside.tcz and replace the original file on the flash drive in /tce/optional with the modified file.

The result is no context click menu but the mouse cursor is changing to an X and open windows have no windows controls at the top right corner to close the window or re-size them.

Is there a more elegant way to disable the desktop click menu without butchering flwm_topside.tcz the way that I do and avoid the negative side effects I described?

« Last Edit: May 01, 2014, 02:18:39 PM by 2os »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11556
Re: Disabling the desktop click menu
« Reply #1 on: April 23, 2014, 10:04:01 PM »
Hi 2os
Quote
I unpack flwm_topside.tcz and rename this file: /usr/local/bin/flwm_topside to something else. Then I repack flwm_topside.tcz and replace the original file on the flash drive in /tce/optional with the modified file.
All you've done there is rename the binary of the window manager, effectively disabling it.
Menus are script controlled by:
usrlocal/bin/flwm_topside_initmenu
usrlocal/bin/flwm_topside_makemenu
usrlocal/bin/flwm_topside_menu_common
usrlocal/bin/flwm_topside_ondemand
and possibly some other scripts.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Disabling the desktop click menu
« Reply #2 on: April 24, 2014, 10:00:53 AM »
I'm not sure if the same can be done in FLWM, however, in Fluxbox I have changed  ~/.fluxbox/init  to not point to  ~/.fluxbox/menu  (which always gets rewitten by TC) but instead point to my customized menu  ~/.fluxbox/menu_custom .
'Applications' and 'OnDemand' menu items (which are kind of dynamic as these are getting rebuild when new apps are loaded) are still included in my right-click menu (actually everything; I just added stuff) but I would be able to exclude any of the other items in my custom menu.
Download a copy and keep it handy: Core book ;)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11036
Re: Disabling the desktop click menu
« Reply #3 on: April 24, 2014, 02:29:23 PM »
Some WMs, like JWM, allow you to disable the menu.
The only barriers that can stop you are the ones you create yourself.

Offline 2os

  • Newbie
  • *
  • Posts: 22
Re: Disabling the desktop click menu
« Reply #4 on: April 29, 2014, 10:24:56 AM »
Thank you all for your comments. I will comment to each post below:

Hi 2os
All you've done there is rename the binary of the window manager, effectively disabling it.
Menus are script controlled by:
usrlocal/bin/flwm_topside_initmenu
usrlocal/bin/flwm_topside_makemenu
usrlocal/bin/flwm_topside_menu_common
usrlocal/bin/flwm_topside_ondemand
and possibly some other scripts.

Rich - the menu items called by the scripts you referenced can be disabled in one step by renaming Xprogs.tcz. The purpose behind disabling Xprogs is to remove the standard buttons from the xbar but it has the added benefit of removing these menu items too. With Xprogs disabled, the click menu still contain three items: SystemTools, New desktop, Logout. These menu items are counter productive when deploying a TC product used by end users as thin client or kiosk machine. They seem to be generated by the said binary file.

I'm not sure if the same can be done in FLWM, however, in Fluxbox I have changed  ~/.fluxbox/init  to not point to  ~/.fluxbox/menu  (which always gets rewitten by TC) but instead point to my customized menu  ~/.fluxbox/menu_custom .
'Applications' and 'OnDemand' menu items (which are kind of dynamic as these are getting rebuild when new apps are loaded) are still included in my right-click menu (actually everything; I just added stuff) but I would be able to exclude any of the other items in my custom menu.

Misalf - I loaded fluxbox but discovered that it fails to load once I disable Xprogs. As said, this is necessary to remove the standard wbar buttons.

Some WMs, like JWM, allow you to disable the menu.

curaga - I loaded JWM and searched for an option to disable the click menu. JWM is well documented and I read through the JWM site looking for a way to get this done. I could not find a reference that might clue me in on how to get this done. This can be in large due to my own ignorance and inability to interpret or make sense of some of this documentation. Seems that configurations of JWM should be controlled by the .jwmrc file but the fact of the matter is that you can practically blank this file and the menu will still remain.

Thank you all for your input. At this point I'm not aware of a clean way to disable the desktop click menu short of using flwm and disabling its primary binary file which has undesirable side effects (no window controls).

This post is for the sake of documenting my findings on this matter. If anyone has anything else to add to it please chip in.

Thanks!
« Last Edit: April 29, 2014, 10:32:05 AM by 2os »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Disabling the desktop click menu
« Reply #5 on: April 29, 2014, 12:33:47 PM »
Renaming Xprogs.tcz to prevent certain icons from appearing in wbar is not very elegant, I'd say. It's start up script (/usr/local/tce.installed/Xprogs) would no longer be executed.

Instead, you can exclude certain icons using  tc-wbarconf .
Users will still be able to execute programs from Xprogs.tcz (even if renamed) from the terminal, anyway (if they know the commands).
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Disabling the desktop click menu
« Reply #6 on: April 29, 2014, 01:54:38 PM »
Not only unelegant but preventing Xprogs from starting may produce many undesirable effects.  eg: all the apps expected to run will no longer be available...  Like network app, services, date tool, swapfile, exittc, mmttool, etc etc

Besides it's much better to edit/remove the desktop files for desktop menu items and remove the icon png's for wbar icons you don't want to show, then remake Xprogs extension. This way you can have wbar icons and desktop menu items as desired without crippling the system.

cd /etc/sysconfig/tcedir/optional
tce-load -wil squashfs-tools-4.x.tcz && unsquashfs -d Xprogs Xprogs.tcz

edit (app).desktop and png files in
Xprogs/usr/local/share/applications
Xprogs/usr/local/share/pixmaps

rm Xprogs.tcz
rm Xprogs.tcz.md5.txt
mksquashfs Xprogs/ Xprogs.tcz


Sent from my iPhone using Tapatalk
« Last Edit: April 29, 2014, 02:54:03 PM by coreplayer2 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11036
Re: Disabling the desktop click menu
« Reply #7 on: April 30, 2014, 03:30:41 AM »
My .jwmrc has this comment:

<!-- The root menu, if this is undefined you will not get a menu. -->
   <!-- Additional RootMenu attributes: onroot, labeled, label -->
   <RootMenu height="16" onroot="123">
...
The only barriers that can stop you are the ones you create yourself.

Offline 2os

  • Newbie
  • *
  • Posts: 22
Re: Disabling the desktop click menu [SOLVED]
« Reply #8 on: May 01, 2014, 02:17:10 PM »
Excellent remarks!! Made all the difference.

Suggestion by coreplayer2 taught me how to edit Xprogs instead of disabling it and it works as advertised. So now Xprogs is in play and the wbar buttons I wanted to remove are gone.

With Xprogs not disabled I went back to check on Misalf's original suggestion of using fluxbox and custom menu file. This has a similar effect to the approach Rich suggested with flwm. Most of the menu items are removed but three are left in, one of them is Exit which, as said, I must remove too.

And last, sending me back to the hall of shame, curaga's remark about comment in JWM's .jwmrc. I removed the section that is relating to the menu from .jwmrc and sure enough, no menu!!! That statement was staring me in the face every time I parsed this file for possible clues and I never saw it until curaga pointed it out.  :-[

Double gain this time: Learned how to work with Xprogs and finally, figured out how to disable the click menu.

Thank you all for your excellent input and good help!!


Offline 2os

  • Newbie
  • *
  • Posts: 22
Re: Disabling the desktop click menu [SOLVED]
« Reply #9 on: May 05, 2014, 08:08:36 AM »
I also disable aterm.tcz by renaming it to keep the terminal off my wbar. Do you see any undesirable side effects to disabling aterm, and if yes, can you suggest a better way to keep it off the wbar?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14768
Re: Disabling the desktop click menu [SOLVED]
« Reply #10 on: May 05, 2014, 08:23:28 AM »
don't load the aterm extension...

Offline 2os

  • Newbie
  • *
  • Posts: 22
Re: Disabling the desktop click menu [SOLVED]
« Reply #11 on: May 05, 2014, 10:35:02 AM »
Removed it from tce/onboot.lst. Guess it is the correct way of getting it done.

Thanks!

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Disabling the desktop click menu [SOLVED]
« Reply #12 on: May 05, 2014, 11:08:09 AM »
Do the same as Xprogs,  remove the graphic.   
Or use the tcWbarConf app to remove the icon from the wbar



Sent from my iPhone using Tapatalk

Offline 2os

  • Newbie
  • *
  • Posts: 22
Re: Disabling the desktop click menu [SOLVED]
« Reply #13 on: May 05, 2014, 02:33:39 PM »
Yes, that works too. Seems like the tcWbarConf app is the easiest and cleanest way to handle it. I decided to use it to remove the rest of the buttons too instead of editing Xprogs. It is quicker and cleaner. Glad I learned how to edit Xprogs, nonetheless.

Thanks!
« Last Edit: May 05, 2014, 03:49:49 PM by 2os »