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 Tue 30 Sep 2014, 06:29
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
PAP - Puppy Application Panels - Your favorite apps panel
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Author Message
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Sun 20 Feb 2011, 08:52    Post subject:  PAP - Puppy Application Panels - Your favorite apps panel
Subject description: Yad / Zenity script
 


http://img11.imageshack.us/img11/3598/201102200323461280x800s.png

what is it?
Pap is an application panel / launcher.

What does it do?
It allows you to quickly configure a panel of all your favorite applications.

How to use?
On first run a folder is created /root/control this is where the applications links for the panel are stored.
To add a new application to the pap panel click on the 'Add application' button this will open a new GUI with:
1. Application 'name' option
2. Application 'icon' option
3. Application 'executable' option.

Enter a name you wish to use for the application.

Enter or Drag and drop the path to an icon you wish to display ( i find like the desktop icons 48x48 size to be the best )

Enter or drag and drop the path to the application executable - or this could be a terminal command i.e 'rxvt -e mc' for midnight commander file manger.

Now click the 'ok' button and the application should be added to the pap panel

To remove an application from the panel navigate to the /root/control directory and delete which ever application/s you no longer want on the panel.

pap requires Yad / Zenity for the GUI - only a small 26K download here:
http://www.murga-linux.com/puppy/viewtopic.php?t=58306

To install.
Download and move to /root/my-applications/bin
It is a self extracting file just click on it in location.
http://dl.dropbox.com/u/3009188/pap.gz

To uninstall.
Just delete the pap script in /root/my-applications/bin and delete the /root/control directory.

To run.
Click on the script or drag a link to desktop or terminal command: pap.

cheers.

Last edited by stu90 on Thu 24 Feb 2011, 10:48; edited 1 time in total
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Thu 24 Feb 2011, 10:47    Post subject:  

Not much love for the PaP but here is an update for it anyway.

v.2
Now has a launch bar and support for multiple panels.

Panels of your own choosing can be added to the script on line 6. each panel needs a corresponding directory in: /root/pap/ of the exact same name.
For instance with the example panels that are in the pap v2 script, you would need to create directories:
/root/pap/pap-app
/root/pap/pap-desktop
/root/pap/pap-setup
/root/pap/pap-system


PaP script needs to be placed in:
/root/my-applications/bin



Code:
#!/bin/bash
#pap - bar v 0.2
#stu90

###add /remove panels line 6 - panels need a directory of the same name in /root/pap###
panels="pap-app!pap-setup!pap-desktop!pap-system"

###pap-bar script location line 9###
loc="/root/my-applications/bin/pap-bar"

bar="/tmp/pbar"

yad --title="PaP - Bar" --center --form \
--field="Open Panel":CB "$panels" \
--icons --button="Add To Panels:0" --button="gtk-cancel:1" --button="gtk-ok:2" > $bar

button=$?
case $button in
0)
###pap-add adds new applications to panels###
addap="/tmp/addap"
echo "opening PAP - add gui"
yad --title "PaP - Add Aplication " --width=500 --form --separator='|' \
--text "                                 Add new applications to the panels.   " \
--field="Panel Choice":CB "$panels" \
--field="Application Name" "Gnome Mplayer" \
--field="Application Icon"  "/usr/share/pixmaps/gnome-mplayer.xpm" \
--field="Application Executable" "/usr/bin/gnome-mplayer" \
--icons --button="gtk-cancel:1" --button="gtk-ok:2" > $addap

button1=$?
case $button1 in
1)
echo "cancel pressed exiting"
exit 0 ;;
2)
panel=$(cut -s -d "|" -f 1 $addap)
name=$(cut -s -d "|" -f 2 $addap)
icon=$(cut -s -d "|" -f 3 $addap)
exec=$(cut -s -d "|" -f 4 $addap)

location="/root/pap/$panel"

echo "[Desktop Entry]" > $location/"$name".desktop
echo "Name=$name" >> $location/"$name".desktop
echo "Icon=$icon" >> $location/"$name".desktop
echo "Exec=$exec" >> $location/"$name".desktop
echo "added '$name' to $panel panel"
;;
esac
rm -f $addap && $loc
;;
1)
echo "cancel pressed exiting"
exit 0 ;;
2)
select=$(cut -s -d "|" -f 1 $bar)
echo "opening $select panel"
yad --title="$select" --geometry=550X350 --center --icons --read-dir="/root/pap/$select/" ;;

esac

rm -f $bar
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Thu 24 Feb 2011, 15:44    Post subject:  

hmm now you made me think - why did you have to go and do that?

with the no buttons option, if yad can set a background image (not sure??? - may need to use a .gtkrc file for this), this _could_ provide a desktop

use the following jwm group settings
noborder, sticky, maximized, notitle, nofocus, nolist, layer:1
(it may be necessary to use a symlink to yad so that all yad apps don't behave this way)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Thu 24 Feb 2011, 21:32    Post subject:  

It looks like you can get most of it from the command line-

Quote:

--on-top
Place window over other windows.

--undecorated
Make window undecorated (remove title and window borders).

--sticky
Make window visible on all desktops.
--no-buttons
Don't show buttons.

--image (but I don't think this is a background image)




Cheers,
s

Last edited by seaside on Thu 24 Feb 2011, 23:36; edited 1 time in total
Back to top
View user's profile Send private message 
harii4


Joined: 30 Jan 2009
Posts: 444
Location: La Porte City, IA , U.S.A.

PostPosted: Thu 24 Feb 2011, 22:58    Post subject:  

Neat!
This sounds much more easy to use than "tabble". Smile

Have not tested it yet - some silly questions?
Can you leave the Application 'name' option blank or do you need to input something?
Is there away to get an tighter icon pattern? (less white/wasted space?)

Looking for an application speed launcher - think "speed dial" menu

_________________
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Thu 24 Feb 2011, 23:41    Post subject:  

stu90 wrote:
Not much love for the PaP but here is an update for it anyway.

I'm just waiting for a yad pet that works in 4.2 (waiting for myself to compile it will take longer Laughing )

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Fri 25 Feb 2011, 00:01    Post subject:  

sc0ttman wrote:
stu90 wrote:
Not much love for the PaP but here is an update for it anyway.

I'm just waiting for a yad pet that works in 4.2 (waiting for myself to compile it will take longer Laughing )


I compiled Yad in 431- might work.

Regards,
s
yad.tar.gz
Description  Yad compiled in pup431
gz

 Download 
Filename  yad.tar.gz 
Filesize  128.09 KB 
Downloaded  359 Time(s) 
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 25 Feb 2011, 10:01    Post subject:  

seaside wrote:
sc0ttman wrote:
stu90 wrote:
Not much love for the PaP but here is an update for it anyway.

I'm just waiting for a yad pet that works in 4.2 (waiting for myself to compile it will take longer Laughing )


I compiled Yad in 431- might work.

Regards,
s

Thanks very much for the effort, unfortunately not working...GTK errors or something.. I'll give it a go myself..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 25 Feb 2011, 10:52    Post subject:  

IIRC it needed gtk-2.16 to compile, upgrade gtk and you should be OK (anything later than 2.16.6 can have some weird side effects on 4.x pups)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 25 Feb 2011, 11:25    Post subject:  

Update to v3
Now has ability to add applications from /usr/share/application directory (thanks seaside)



Code:
#!/bin/bash
#pap - bar v 0.3
#stu90
##added select application from existing .desktop/menu files - seaside##

###add /remove panels line 7 - panels need a directory of the same name in /root/pap###
panels="pap-app!pap-setup!pap-desktop!pap-system"

###pap-bar script location line 10###
loc="/root/my-applications/bin/pap-bar"

bar="/tmp/pbar"

yad --title="PaP - Bar" --center --form \
--field="Open Panel":CB "$panels" \
--icons --button="Add To Panels:0" --button="gtk-cancel:1" --button="gtk-ok:2" > $bar

button=$?
case $button in
0)
###pap-add adds new applications to panels###
addap="/tmp/addap"

DESK=`ls /usr/share/applications  | yad --separator=" " --center --height=350 \
--text="To add a new Application to your panel select from the \n Application list and click the Add Application button. \n
To add a Custom Application that is not in the Application \n list click the Make Custom button." \
--list --column="Applications" --button="gtk-cancel:1" --button="Make Custom:0" --button="Add Application:0"`
if [ "$?" = "1" ]; then
echo "cancel pressed exiting"
exit 0
fi

for line in /usr/share/applications/$DESK;do
eval `grep -E '^Name|^Icon|^Exec' "$line" | tr " " "_"` # no spaces
done

yad --title "PaP - Add Application " --width=500 --form --separator="|" \
--text "                                 Add new applications to the panels.   " \
--field="Panel Choice":CB "$panels" \
--field="Application Name" "$Name" \
--field="Application Icon" "[Enter full path to a custom icon]" \
--field="Application Executable" "$Exec" \
--icons --button="gtk-cancel:1" --button="gtk-ok:2"  > $addap

button1=$?
case $button1 in
1)
echo "cancel pressed exiting"
exit 0 ;;
2)
panel=$(cut -s -d "|" -f 1 $addap)
name=$(cut -s -d "|" -f 2 $addap)
icon=$(cut -s -d "|" -f 3 $addap)
exec=$(cut -s -d "|" -f 4 $addap)

location="/root/pap/$panel"

echo "[Desktop Entry]" > $location/"$name".desktop
echo "Name=$name" >> $location/"$name".desktop
echo "Icon=$icon" >> $location/"$name".desktop
echo "Exec=$exec" >> $location/"$name".desktop
echo "added '$name' to $panel panel"
;;
esac
rm -f $addap && $loc
;;
1)
echo "cancel pressed exiting"
exit 0 ;;
2)
select=$(cut -s -d "|" -f 1 $bar)
echo "opening $select panel"
yad --title="$select" --geometry=550X350 --center --icons --sort-by-name --read-dir="/root/pap/$select/" ;;

esac

rm -f $bar
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 25 Feb 2011, 11:34    Post subject:  

technosaurus:
Sounds interesting - not sure if you can set the background for Yad or not, i think i recall being able to do something similar for Rox filer so maybe?

harii4:
I don't think it is possible to leave the names blank - Icon spacing seems to be dictated by the name length - bigger the name bigger the spacing, i did notice in Yad --help the option to set --item-width Set the width of dialog items so maybe yo u could get a tighter grouping not sure?
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Fri 25 Feb 2011, 18:47    Post subject:  

stu90,

Looking good..... Smile

You might include the *.desktop icon name shown so it would be possible to track down the path to add.. e.g.
Code:
--field="Application Icon" "[Enter full path]  $Icon" \


Regards,
s
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 26 Feb 2011, 09:20    Post subject:  

You can get icon paths like this
[ ${ICON:0:1} != / ] && ICON='find /usr/share -iname $ICON'
(Note: I don't have backtick on my Droid for the find part)[/code]

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Sat 26 Feb 2011, 12:28    Post subject:  

technosaurus,

Very nice -
Code:

[ ${Icon:0:1} != / ] && Icon=`find /usr/share -iname $Icon`


Thank you,
s
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 807
Location: Mishawaka IN

PostPosted: Thu 15 Aug 2013, 15:14    Post subject:  

Hello stu90/91

This is a nice little app that you have done. Is there a way to make a button for launching the app that you click on?

I am making a pet for it with a desktop file. May put this in one of my remasters!


Cheers
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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.1111s ][ Queries: 13 (0.0158s) ][ GZIP on ]