Tiny Core Linux

Tiny Core Base => TCB Tips & Tricks => Topic started by: jur on July 12, 2010, 08:57:27 PM

Title: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: jur on July 12, 2010, 08:57:27 PM
Step-by-step instructions how to add or remove wbar entries for tc 3.3 or later

To add stuff:

1. Create a calling script eg myscript (no extension) for your app/function and drop this script (or a hyperlink to your app or script)  in /tce/ondemand. (If you have trouble finding /tce/ondemand, it is created with any ondemand items.)

2. Create an icon with exact matching name, except for the extension, eg myscript.img. Drop this icon (or a hyperlink to it) in /tce/ondemand. Make sure the icon will be available when wbar starts, and that the name is an exact match, or wbar will not start at all.

Note that anything you add like this, will also appear in the window manager's right-click ondemand menu.

3. Restart X to have the new entries effected.

To remove entries which you have added before:

Start AppsAudit, and use OnDemand. Simply click on the entries in the right column to blow them away.

To hide icons for items you added, or any icons:

Start wbarconfig, and click on entries in the left column. To unhide them click on entries in the right column.
Title: Re: Step-by-step instructions how to hack wbar to remove (or add) entries
Post by: vishrut_n_shah on October 15, 2010, 11:50:06 PM

Thanks a lot... :D :D :D :D
Title: Re: Step-by-step instructions how to hack wbar to remove (or add) entries
Post by: gd102 on October 31, 2010, 09:48:22 PM
Thanks :D
Title: Re: Step-by-step instructions how to hack wbar to remove (or add) entries
Post by: jur on October 31, 2010, 11:51:07 PM
The original instructions have been obsoleted by the new tools in tcl-3.3. The first post has been updated with current instructions.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: hiro on January 02, 2011, 02:07:46 PM
Can I change the icon of an app which doesn't use ondemand?

Eventually I would like to have two icons calling the same app, but with different options and icons.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: jur on January 02, 2011, 05:27:30 PM
Apps which are not OnDemand use the built-in app icon - you can't selectively change the icon for these.

Perhaps it would be best to make wrapper scripts for each case for your particular app and drop these in tce/ondemand as described in the first post. I do exactly that for rox filer - I have two icons in wbar, one for normal use and a red one for sudo.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: hiro on January 02, 2011, 06:13:00 PM
And if I want to create an extension including two icons? I don't think I can squash the ondemand dir, is there no alternative?
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: Raschid on February 26, 2012, 05:05:04 AM
Does this still work for TC4.x?
Try as I might I cannot get it to work:
- script and icon with matching names in /tce/ondemand
- script appears in rightclick/ondemand menu and works as advertised
- icon does not show in wbar

any ideas?

thx,
   raschid
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: nomer on March 05, 2012, 05:40:40 PM
&Raschid
It works for me running TinyCore 4.1
What does this command give you?
Quote
ls `cat /opt/.tce_dir`/ondemand
Here is what it looks like on my system:
Quote
asunder      calc.img   homebank            notify-python-2.7   tango-icon-theme  wine
asunder.img  compiletc  inkscape-tutorials  obconf              wesnoth           xarchiver
boost        geany      intltool            scons               wesnoth.img       xarchiver.img
calc         geany.img  libglade            squashfs-tools-4.x  wget
"calc" and "calc.img" are the custom items that I've created. Also "wesnoth.img" is a image that was placed by me instead of TC.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: Solev on March 09, 2012, 06:22:48 AM
Same problem than Raschid : no icon in wbar.

An idea ?

Thanks.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: AbNoRMiS on March 09, 2012, 10:29:45 AM
Can I change the icon of an app which doesn't use ondemand?

Eventually I would like to have two icons calling the same app, but with different options and icons.
if there is extension which has a name for example extension.tcz
and which has icon /usr/local/share/pixmaps/extension.png
and desktop-file /usr/local/share/application/extension.desktop

to change its icon should do the following
# 1. make exchange folder in your backup directory /opt
mkdir /opt/exchange
# 2. copy any icon that you want to replace the extension.png to /opt/exchange folder
cp -f any_icon.png /opt/exchange/extension.png
# 3. add string cp -f /opt/exchange/extension.png /usr/local/share/pixmaps to /opt/bootlocal.sh
echo "cp -f /opt/exchange/extension.png /usr/local/share/pixmaps" >> /opt/bootlocal.sh

to add a second icon should do the following
# 1. copy any icon that you want make as second icon to /opt/exchange named it as extension-2.png
cp -f any_icon.png /opt/exchange/extension-2.png
# 2. copy existing extension.desktop following by link to /opt/exchange named it as extension-2.desktop
cp -H /usr/local/share/applications/extension.desktop /opt/exchange/extension-2.desktop
# 3. add string cp -f /opt/exchange/extension-2.png /usr/local/share/pixmaps to /opt/bootlocal.sh
echo "cp -f /opt/exchange/extension-2.png /usr/local/share/pixmaps" >> /opt/bootlocal.sh
# 4. add string cp -f /opt/exchange/extension-2.desktop /usr/local/share/applications to /opt/bootlocal.sh
echo "cp -f /opt/exchange/extension-2.desktop /usr/local/share/applications" >> /opt/bootlocal.sh

now should make the following changes in the file /opt/exchange/extension-2.desktop
replace all entries extension.png to extension-2.png
change entry Icon=extension to Icon=extension-2
make sure that following line is present
X-FullPathIcon=/usr/local/share/pixmaps/extension-2.png
add needed options to line Exec=extension

and finally
make sure that /opt/exchange will be backed up
save changes by command
filetool.sh -b
or do reboot with backup
and see results

guaranteed work in version tc4+
about tc3+ does not know
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: hiro on March 09, 2012, 11:20:59 AM
Abnormis: There's something strange with your text format. I can't read this in neither Chrome nor dillo.

Technically: not everyone has persistant opt.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: AbNoRMiS on March 09, 2012, 11:42:03 AM
sorry, this is because of too long lines
monitor 24" :)
thanks, now will correct
Technically: not everyone has persistant opt.
this also can be simply solved
echo "opt/exchange" >> /opt/.filetool.lst
also now correct
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: gerald_clark on March 09, 2012, 11:53:59 AM
All of opt is backed up with V4.
There is no need to add it to .filetool.lst.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: hiro on March 09, 2012, 11:57:26 AM
Oh, shit, I didn't know. Thanks
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: AbNoRMiS on March 09, 2012, 11:58:29 AM
as far as i can remember, opt is backed up only since version 4.1
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: AbNoRMiS on March 11, 2012, 03:01:21 PM

3. Restart X to have the new entries effected.

if i'm not mistaken can simply execute the wbar.sh
to restarting wbar and apply changes
it will be easier and will do it without restart x
again, if i'm not mistaken then this should works in tc4+
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: redisded on March 31, 2016, 04:16:31 AM
Hello all,

I know this topic is a bit old, but i had the problem of an entry which was present in the menu but not in the wbar.

As this topic is linked on the documentation wiki, I think it could be a good place to give my solution.

I created an entry to connect to a rdp server, but my mistake was, I believe, that I just called it rdesktop, which is also the name of the command to connect my server.

When I realised this, I simply changed the name of my entry (and the icon linked to it) to connect_server, and my entry shown up in the wbar.

So, if you have a script that shows up in the menu, but not in the wbar, just check if its name is not the name of a system command.

Sorry for my poor English...

Redisded.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: Misalf on March 31, 2016, 07:34:57 AM
Quote
I created an entry to connect to a rdp server, but my mistake was, I believe, that I just called it rdesktop, which is also the name of the command to connect my server.

I guess  rdesktop.tcz  was loaded when you tried adding your custom icon?
OnDemand entries are only shown if there isn't already an extension with the same name loaded.

/usr/local/bin/wbar_setup.sh
Code: [Select]
if [ ! -e /etc/sysconfig/noondemandicons ]; then
INSTALLED=/usr/local/tce.installed
ONDEMAND="$TCEDIR"/ondemand
for F in `ls -1 "$ONDEMAND"/*.img 2>/dev/null`; do
  IMG="${F##/*/}"
  APPNAME="${IMG%.img}"
  if [ ! -e "$INSTALLED"/"$APPNAME" ]; then
    if ! grep -qw -m1 "^t: *${APPNAME}$" "${TCEDIR}"/xwbar.lst 2>/dev/null; then
      echo "i: $ONDEMAND/$IMG" >> "$TCEWBAR"
      echo "t: $APPNAME" >> "$TCEWBAR"
      echo "c: $ONDEMAND/$APPNAME" >> "$TCEWBAR"
    fi
  fi
done
fi


Since  rdesktop.tcz  doesn't contain a  *.desktop  file, which would be used to create the menu entry and wbar icon, no wbar icon is shown. Only the OnDemand menu entry from the Window Manager remains.

I guess it might be useful to restrict the exclusion of OnDemand items in wbar based on the existence of a *.desktop file?

Code: [Select]
if [ ! -e /etc/sysconfig/noondemandicons ]; then
FREEDESK=/usr/local/share/applications
ONDEMAND="$TCEDIR"/ondemand
for F in `ls -1 "$ONDEMAND"/*.img 2>/dev/null`; do
  IMG="${F##/*/}"
  APPNAME="${IMG%.img}"
  if [ ! -e "$FREEDESK"/"$APPNAME".desktop ]; then
    if ! grep -qw -m1 "^t: *${APPNAME}$" "${TCEDIR}"/xwbar.lst 2>/dev/null; then
      echo "i: $ONDEMAND/$IMG" >> "$TCEWBAR"
      echo "t: $APPNAME" >> "$TCEWBAR"
      echo "c: $ONDEMAND/$APPNAME" >> "$TCEWBAR"
    fi
  fi
done
fi

Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: redisded on April 01, 2016, 04:46:57 AM
Hi all,

thanks Misalf for your explanations, indeed, rdesktop.tcz was already loaded.

I have now troubles with the execution of my scripts from the menu or the wbar (nothing happen), I will open a new thread for that if I can't solve it myself, but as this thread will be seen by many persons coming from the documentation, there is at least one question which I believe is interesting to ask here :

Is there a logfile of what's happening when I launch a personnal script from menu or wbar ?

Redisded.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: Misalf on April 01, 2016, 05:14:11 AM
Not for wbar. All of its output goes to  /dev/null .
Error messages from the Window Manager can be seen in  /tmp/wm_errors .
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: redisded on April 01, 2016, 05:31:17 AM
Thank you again Misalf !

I found there an error saying my script is not found when I launch it by the menu; However, when I list the tcedir, I can see my scripts...

I have a similar problem with the command source that behave like it would when I source a file from command line, but get a file not found error when I try to source the same file from my script...

This may come from me misunderstanding the principle of busybox.

I will search this way for a while and open a new topic for that if necessary because this is not related to the thread subject anymore.

Redisded.
Title: Re: Step-by-step instructions how to add or remove wbar entries (tcl-3.3)
Post by: coreplayer2 on April 02, 2016, 11:19:44 PM
Normally when you receive an error reporting that the script could not be found, it is most likely referring to the interpreter which is not installed.  Or something simple like the path or file name was wrong.

Check the first line of your script, am assuming the script is written in Bash.  In which case you'll need to install the Bash extension.