Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 20 Sep 2017, 10:52
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Script to put usbdrive icon in systray (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [45 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
wow

Joined: 29 Jun 2006
Posts: 1034
Location: Peru

PostPosted: Sat 18 Mar 2017, 00:06    Post subject:  

http://www.murga-linux.com/puppy/viewtopic.php?p=946888#946888

Español Algunos cambios:
    Nueva diseño u orden para los elementos del menú: Pmount || Nombre de Dispositivo1 | Particiones de Dispositivo1 || Nombre de Dispositivo2 | Particiones de Dispositivo2 || Actualizar.
    Menu: Añadido un nuevo botón [Nombre de Dispositivo] para abrir la/las carpeta/"punto de montaje" si está montada alguna partición del dispositivo

English: Few changes:
    Menu, New layout: Pmount || Device1 Name | Device1 partitions || Device2 Name | Device2 partitions || Reload/Refresh.
    Menu: Added button [Device name] to open mount-point(s) if mounted.


Por defecto/Default:


Mínimo/Minimal: -n
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 2972
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sat 18 Mar 2017, 06:46    Post subject:  

Bonjour,
Waou, this script is really a good idea and the result quite amazing!
Thank you!
May I say 2 little (silly?) things?
    - Why not use English inside the script to comment how it is built and how it works (I am of those who are very interested in this - it is how I learn - but do absolutely/unfortunately not speak Spanish!)?
    - There is a window that displays messages down right of the screen. For me and probably some other users, who have their taskbar top of the screen and (or) run in dualscreen, it is not convenient. I firstly didn't see this popup window so much I was glazing over my notification area in the taskbar on the other screen Razz ...

[EDIT]: French po/mo as attached files.

Cordialement.
pusitray_fr.tar.gz
Description 
gz

 Download 
Filename  pusitray_fr.tar.gz 
Filesize  1.81 KB 
Downloaded  46 Time(s) 

_________________

Back to top
View user's profile Send private message Visit poster's website 
nilsonmorales


Joined: 15 Apr 2011
Posts: 915
Location: El Salvador

PostPosted: Sun 19 Mar 2017, 13:51    Post subject:  

Hello Argolance, you mean the comment lines translated in english?
what notifier are you using, dunst, gxmessage, yaf-splash, i think you need configure that thing in you local configuration.

_________________
My blog | | Github


Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 2972
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Mon 20 Mar 2017, 05:21    Post subject:  

Hello Nilson,
nilsonmorales wrote:
you mean the comment lines translated in english?
what notifier are you using, dunst, gxmessage, yaf-splash, i think you need configure that thing in you local configuration.

The only language we have in common is English. We may regret it but that is the way it is. So I think it is a pity not to use English to comment code lines inside scripts (to make them understandable), instead of the creator's native language (here Spanish!) as well as gettexted lines which are originally in Spanish, excluding all the people who do NOT speak Spanish and overall, must be translated into English... for English speaking users (as long as you have got the language package):, Shocked
Obviously, that is my personal opinion. On the French Forum, we have a talented script creator (musher0), who does the same, against all odds, and I still believe it is (not a shame!) just a pity! Wink

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
wow

Joined: 29 Jun 2006
Posts: 1034
Location: Peru

PostPosted: Tue 21 Mar 2017, 00:24    Post subject:  

http://www.murga-linux.com/puppy/viewtopic.php?p=946888#946888
Particiones de tipo vfat ahora deberían montarse rápidamente.

vfat partitions should now be mounted faster.
Back to top
View user's profile Send private message 
wow

Joined: 29 Jun 2006
Posts: 1034
Location: Peru

PostPosted: Wed 22 Mar 2017, 05:59    Post subject:  

http://www.murga-linux.com/puppy/viewtopic.php?p=946888#946888

Arreglado: el montaje de partiticones vfat era demasiado rápido para darle tiempo al menú de actualizarse.

Fixed: vfat partition mounting was too fast for the menu to update.
Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 626

PostPosted: Wed 22 Mar 2017, 13:26    Post subject:  

@wow, nilson
I called wow's first script usb_systray, placed it in /root/my-applications/bin/ and put a symlink to it in /root/Startup. . The icon shows in the tray and seemed to work. Clicking the Plus sign before an unmounted device, mounted it and clicking Minus unmounted it. The NTFS device (sda1) was not listed. PMount worked. I didn't know what Actualizer meant and nothing visible seem to happen when activated.

I set up the new script, pusitray (the last version after Edit9 here), on a different tahr-6.0.5 as before. Additionally, I unzipped pusitray_langpack_english01.zip, renamed *.mo to pusitray.mo and put it in /usr/share/locale/en/LC_MESSAGES/. See attached screenshots. Nothing happens neither when I click the script in /root/my-applications/bin/ nor on booting. The icon does not show.

Do I have the right script? Am I missing something? What am I doing wrong?

Edit10 was posted just before mine so haven't tried the revision yet, but don't anticipate any change. I'll report later.
pusitray_placements.png
 Description   confirmation of files placement
 Filesize   57.32 KB
 Viewed   314 Time(s)

pusitray_placements.png


_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
wow

Joined: 29 Jun 2006
Posts: 1034
Location: Peru

PostPosted: Wed 22 Mar 2017, 15:01    Post subject:  

Español: Esta es una nueva versión de prueba, es ligeramente más rapida porque ahora solo realiza actualizaciones parciales en lugar de generar todos desde 0. Pero me parece que consume algo más de cpu.

English:This is a new test version, it is slightly faster because now it only writes partial updates instead of generate all items from 0. But it seems to me that it uses more cpu.

Bugfix: puppy boot(usbflash) device is now detected properly. and won't be un/mounted when clicked.
https://app.box.com/s/7nvvc5qpbbuol6jqhzyyr9ylvl2tpuaf

corvus wrote:
...I personally use, via command line, a script (created by Yan Li in 2009), that need sdparm.

http://sg.danny.cz/sg/sdparm.html: "sdparm is designed for both the 2.6 and 2.4 Linux kernel series."
Argolance wrote:
- There is a window that displays messages down right of the screen.

That's just an small notification to tell me the script has updated its menu and is ready to mount or unmount the next device. It is set to "echo" but it will use the next line if available, gxmessage, then yaf-splash, yad and notify-send.
You can comment out these lines to disable it.
Code:
[ "$(which gxmessage)" ] && MSG_CMD="gxmessage -borderless -nofocus -bg black -fg white -timeout 3"
[ "$(which yaf-splash)" ] && MSG_CMD="yaf-splash -close box -timeout 3 -placement bottom-right -bg black -fg white -text"
[ -e "/usr/lib/gtkdialog/box_splash" ] && MSG_CMD="/usr/lib/gtkdialog/box_splash -close box -timeout 3 -placement bottom-right -bg black -fg white -text"
[ "$(which yad)" ] && MSG_CMD="yad --no-buttons --borders 10 --skip-taskbar --no-focus --undecorated --timeout-indicator bottom --text-align=left --timeout 5 --geometry=200x50-10-50 --text"
[ "$(which notify-send)" ] && MSG_CMD="notify-send -t 5000 -u normal"   

B.K. Johnson wrote:
I called wow's usb_systray, ... renamed *.mo to pusitray.mo and put it in /usr/share/locale/en/LC_MESSAGES/

Try to rename the .mo file to usb_systray.mo. Both must have the same filename.
B.K. Johnson wrote:
The NTFS device (sda1) was not listed. PMount worked.

This script its designed to work only with usb drives, it will ignore puppy boot device, internal sata drives or other storage devices.
B.K. Johnson wrote:
Nothing happens neither when I click the script in /root/my-applications/bin/ nor on booting. The icon does not show.

Try to install a more recent version of yad, also try to run the script from command line.

Last edited by wow on Wed 29 Mar 2017, 14:43; edited 3 times in total
Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 626

PostPosted: Wed 22 Mar 2017, 22:43    Post subject:  

wow suggested here
Quote:
Try to install a more recent version of yad, also try to run the script from command line.

Sure enough, when pusitray is executed from the command line, I got this error:
Code:
root# pusitray
MSG_CMD=yad
Unable parse command line: Unknown option --borders
root#


YAD-0.38.2 is available from SourceForge.
From the README, it doesn't look like the standard ./configure && make && make install procedure.
Can some good soul please compile and prepare a pet or sfs?
Thanks.

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 915
Location: El Salvador

PostPosted: Wed 22 Mar 2017, 22:55    Post subject:  

Version 11: I've tried to do different events, so far everything seems to work fine. Is nice 'honesty' Very Happy

_________________
My blog | | Github


Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 915
Location: El Salvador

PostPosted: Wed 22 Mar 2017, 23:30    Post subject:  

B.K. Johnson
greengeek provides this package for 32 bits here http://murga-linux.com/puppy/viewtopic.php?p=890055#890055

_________________
My blog | | Github


Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 626

PostPosted: Thu 23 Mar 2017, 00:20    Post subject:  

nilsonmorales
Thanks for the link, Let you know how it works out.

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 626

PostPosted: Thu 23 Mar 2017, 12:20    Post subject:  

Nilson wrote:
Quote:

greengeek provides this package for 32 bits here http://murga-linux.com/puppy/viewtopic.php?p=890055#890055

Got it. It is a version several revisions earlier than the latest on the website. However, it is good enough for psuitray to display its icon in the tray. WORKING (almost, see below). Thanks again.

However there is a particular niggle that needs work.
Nilson, as your command of English is better than wow's, please translate for him.

ATM, I have 3 storage devices attached
sda1 HD NTFS
sdb1 Flash FAT32 boot drive tahr-6.0.5
sdc1 Flash FAT32
Prior to installing pusitray and since installing it, at boot, sdb1 is mounted and so indicated with a tab; other devices are unmounted - no tabs.
In the psuitray infobox, sda1, being an NTFS it doesn't appear (understood). Both sdb1 and sdc1 have + before them in the infobox to indicate unmounted.but this is not true. sdb1 is mounted. It is /home, is always mounted and should have a permanent '-' sign. Secondly, when the '+' before sdc1 is clicked, the contents are displayed, but a tab on the icon to indicate mounted does not appear. Thirdly, if I click on the sdc1 icon, the indicator tab appears and contents listed, but the '+' in psuitray does not change. Clicking '+' once displays the contents and message that it is being mounted when it already has been. Then on clicking the '-' sign, the device is unmounted and the tab correctly removed.

To summarize:
(1) the boot drive should always have a '-'
(2) when '+' is selected to mount a device, an indicator tab should appear on the corresponding icon.

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
wow

Joined: 29 Jun 2006
Posts: 1034
Location: Peru

PostPosted: Thu 23 Mar 2017, 22:44    Post subject:  

B.K. Johnson wrote:
...
sdb1 Flash FAT32 boot drive tahr-6.0.5
...
Both sdb1 and sdc1 have + before them in the infobox to indicate unmounted.but this is not true. sdb1 is mounted. It is /home, is always mounted and should have a permanent '-' sign

Fixed. It now displays puppy version and won't allow user to mount or unmount.

http://murga-linux.com/puppy/viewtopic.php?p=946888#946888
Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 915
Location: El Salvador

PostPosted: Fri 24 Mar 2017, 00:56    Post subject:  

YAD version 0.38.2 shows the icon too small in the tray, so I compiled 0.38.1 in x-tahr (tahrpup fork), that seems to work fine
Code:
autoreconf -ivf
./configure --prefix=/usr
make
make DESTDIR=/tmp/yad-0.38.1 install
cd /tmp
dir2pet yad-0.38.1
petget yad-0.38.1.pet

Quote:
$ yad --version
0.38.1 (GTK+ 2.24.23)

https://my.pcloud.com/publink/show?code=XZrLPUZrVlQLw3RmX0wU1iVRz3IHFiyrJH7

_________________
My blog | | Github


Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [45 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1028s ][ Queries: 15 (0.0085s) ][ GZIP on ]