WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: wbar - Possible to edit a .wbar item execution as root?  (Read 3821 times)

Offline amgh

  • Newbie
  • *
  • Posts: 22
wbar - Possible to edit a .wbar item execution as root?
« on: February 09, 2015, 08:03:20 AM »
Hi,

Is it possible to edit the .wbar in /home/tc to start an application as root? Like for example the XFE, can I edit the line :

"c: exec /usr/local/bin/xfe" in the .wbar file

to

"c: exec sudo /usr/local/bin/xfe", or something like that?

I see that after the system restarts, all the changes are lost. (As an experiment, I tried changing the description syntax "t" for 'firefox-official' to 'Firefox'). I do not know how to permanently make the changes. I tried searching for more information on this but I'm not able to find the answer.

Thank you.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #1 on: February 09, 2015, 09:04:11 AM »
~/.wbar  is recreated every time the desktop starts or when apps are getting loaded. So there is no point in backing up that file. However, you can easily create your own wbar icons by placing a script plus a png image (file name extension renamed to .img) into the  /etc/sysconfig/tcedir/ondemand  directory and optionally exclude the original icon by editing the  /etc/sysconfig/tcedir/xwbar.lst  file (which is not for lading tczs despite its file name extension) by using the wbar config GUI  tc-wbarconf .

One downside is though, that you wouldn't be able to name your custom wbar icon to just anything you want 'IF' you need the ondemand feature for this particular icon.
F.e. a script named "Firefox" (with a capital F) wouldn't load the firefox extension ondemand since the ondemand icons are named after the extension's file name. "Firefox" not same as "firefox".
« Last Edit: February 09, 2015, 09:08:45 AM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline amgh

  • Newbie
  • *
  • Posts: 22
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #2 on: February 09, 2015, 09:44:14 AM »
Thank you Misalf, that cleared up some doubts.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #3 on: September 20, 2015, 04:57:51 AM »
Misalfs comment doesn't really answer the question because it just states how to add apps. I am trying to do something similar to the OP. I want to completely customize wbar by just having 3 apps there (two custom ones and exittc so the user can shutdown). I tried to create my own /home/tc/.wbar in a remaster as well and it seems TC startup symlinks that to tce.icons so what is thr best way to include persistent changes to that file? Ive searched and theres no answer that completely says how to customize it in a remaster. The config seems super trivial (text, execute, and icon lines) but TC seems to use it differently than other distros. For now, ive resorted to using iDesk for my kiosk but wbar is a bit more next gen style a la OSX so Id like to get a solution with that working. Thanks.
« Last Edit: September 20, 2015, 05:00:03 AM by nim108 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #4 on: September 20, 2015, 05:19:34 AM »
Hi nim108
Try using  Wbar Conf  from the control panel to exclude items you don't wish to see.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #5 on: September 20, 2015, 06:41:54 AM »
Hi nim108
Try using  Wbar Conf  from the control panel to exclude items you don't wish to see.
Rich thanks, that works fine, but I want the changes to be persistent (it's why I mentioned the remaster) as I am creating a Live CD that should just have wbar customized out of the box. I am using a dynamic remaster that overlays a customized gz on top of core.gz. Is it sufficient to just edit the xwbar.lst file to achieve a custom wbar? I'm not sure what to change. Some other forums mention having to tweak Xlibs/Xprogs and other things which is beyond the scope of editing a simple config file. The book only seems to mention wbar once too and nothing on this particular topic.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #6 on: September 20, 2015, 10:00:01 AM »
Nop, adding the xwbar.lst in the remaster doesn't do anything. I tested by removing everything but the exittc entry from TC's default ~/.wbar config and copying it over to /cde/xwbar.lst. Rebuilt my remaster and booted up, and it still shows the default TC bar.

EDIT: So adding a /home/tc/.wbar in your remaster DOES work because on bootup, TC will fail to run the symlink cmd (ln -s) to link tce.icons to ~/.wbar (you will see ".wbar already exists" errors upon booting up). Not sure what I was doing wrong before. Anyway, I'm sure this is not the cleanest way to do it, but I guess it works for now. Still, what is the proper way to do this?
« Last Edit: September 20, 2015, 10:18:38 AM by nim108 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #7 on: September 20, 2015, 11:14:48 AM »
If I get you right, you don't want any icons to be added dynamically?

In that case, you should use a wbar config file named something else, and start wbar manually in your .xsession, pointing it to your custom config file. Then remove the icons lines so the system wbar is not started.

This will make wbarconf useless for it, etc.
The only barriers that can stop you are the ones you create yourself.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #8 on: September 20, 2015, 12:30:17 PM »
Thanks curaga, that may actually work, I will test. Yes for live CD, I want wbar icons to be static the same way they are for idesk. This seems to be the best way. Following that same theory, I can probably just include my own /usr/local/tce.icons file right? Meaning nothing in TC will overwrite it?
« Last Edit: September 20, 2015, 12:43:18 PM by nim108 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: wbar - Possible to edit a .wbar item execution as root?
« Reply #9 on: September 21, 2015, 01:31:24 AM »
No, the tce.icons file is regenerated upon some hooks, so better not to use it. Also, the noicons bootcode might be needed to fully avoid system icons.
The only barriers that can stop you are the ones you create yourself.