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 Sun 21 Dec 2014, 12:43
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
jwm_tools-0.9 (was jwm_menu_create)
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 8 of 9 Posts_count   Goto page: Previous 1, 2, 3, ..., 6, 7, 8, 9 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2387
Location: UK

PostPosted: Mon 12 Mar 2012, 14:03    Post_subject:  

Support added for the XDG standard 'NoDisplay' option..
See lines marked #20120312 for changes.

Code:
for DESKTOP_FILE in /usr/share/applications/* ; do
   #[ "$( cat $DESKTOP_FILE | grep -m1 ^NoDisplay=true)" != "" ] && continue
   ICON="" CATS="" NAME="" EXEC="" SKIP=false #prevent carryover #20120312, added SKIP
   while read LINE || [ "$LINE" ] ; do
      case $LINE in
         NoDisplay=true*) SKIP=true ;; #20120312
         Name=*|Name?${myLANG%_*}?=*) NAME="${LINE#*=}"'' ;; # sc0ttman... should use "Name[$myLANG]=" if found
#         Comment=*|Comment?${myLANG%_*}?=*) COMMENT="${LINE#*=}"''  ;; #jwm doesn't support tooltips on menu items yet ...
         Icon=*) ICON="${LINE#*=}"''  ;;
         Categories=*) CATS="${LINE#*=}"'' ;;
         Exec=*) EXEC="${LINE#*=}"'' ;;
      esac
      
   done < $DESKTOP_FILE   
   [ "${SKIP}" = true ] && continue #20120312

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2620
Location: www.eussenheim.de/

PostPosted: Wed 14 Mar 2012, 15:12    Post_subject: jwm_tools-0.9.1
Sub_title: in menu now
 

sc0ttman wrote:
Support added for the XDG standard 'NoDisplay' option..
See lines marked #20120312 for changes.

...done

Running in Racy 5229 was not possible because no language files included. In normal cases a program would run English.....

Thus I have fixed some bugs and, for easier testing added the entry jwm_tools: Parameters in jwmconfig.
Thus launches jwm_param_gui where you can choose from the installed languages (Dutch added)

Have fun

---
edit: deleted 0.9.2.pet
jwmconfig2_jwm_param_gui.png
 Description   .. and another language added
 Filesize   19.1 KB
 Viewed   1193 Time(s)

jwmconfig2_jwm_param_gui.png


Edited_times_total
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2620
Location: www.eussenheim.de/

PostPosted: Wed 14 Mar 2012, 15:35    Post_subject:  

Sorry
yet a bug in 1 of the scripts
value not "" but " " (always 1 space too much)
does not change SUBMENU and DRIVES

-----
edit: here is a fix.

----
edit: bug located
choices were always overwritten by config file
quick fix:
search in file
$HOME/.jwm/JWMRC
for
SUBMENU="1" #SUBMENUS=""
DRIVES="1" #DRIVES=""
and change every found into
#SUBMENU="1" #SUBMENUS=""
#DRIVES="1" #DRIVES=""

----
thanks for testing
pet deleted : take version 0.9.3 next post please

Edited_times_total
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2620
Location: www.eussenheim.de/

PostPosted: Thu 15 Mar 2012, 16:21    Post_subject: jwm_tools-0.9 (was jwm_menu_create)
Sub_title: version 0.9.3
 

Please delete config file /root/.jwm/JWMRC
then install 0.9.3.pet

What´s new?

jwm_param_gui can be launched from JWM configuration

known bugs are fixed

menu has an alternative for translations now
no more inside /usr/share/applications/*.desktop
but simply in 1 file, ex: /usr/share/locales/de/names

/usr/share/locales/de/names wrote:
s%"Abiword wordprocessor"%"Abiword Textverarbeitung"%
s%"FFConvert multimedia converter"%"FFConvert Multimedia-Konverter"%
s%"Mixer generic sound mixer"%"Mixer Sound-Mischpult"%
s%"Pmount mount/unmount drives"%"Pmount Laufwerke ein-/aushängen"%

Copy this file (170 program names from racy, extendable) into your locales and you can translate everything very quick (momanager needed more than 1 minute for each word and I think this is much better)



----
edited 2012-10-18
downloaded 164 times
deleted jwm_tools-0.9.3.pet
use jwm_tools-0.9.4.pet please Smile

Edited_times_total
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Sat 02 Jun 2012, 03:28    Post_subject:  

J have been working on some C projects lately and haven't gotten the stuff done here that I wanted to, so I am posting a quick, updated todo list. - let me know if I am missing something

    sync up with patches - thanks guys
    finish support for multiple custom trays, including app trays, swallow and all other niceties.
    have option for drives as a menu instead of a tray (then jwm -reload will update them on the fly)
    remove the %* from the execs in the menu - jwm does not support drag and drop, so %U, %s, %f and whatever are meaningless
    (NOTE: what if there is an rxvt -e with a printf "%s...", ...)
    add tools for viewing pdf and other doc types that can be converted to images to reduce resource usage similar to the image viewer (mubusy in mupdf will do pdf and several other formats, abiword's cli can do others, etc...)
    Explain the purpose of unix-ifying the tools and general documentation.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
maxerro


Joined: 10 Oct 2010
Posts: 65

PostPosted: Sat 02 Jun 2012, 08:34    Post_subject:  

You might consider using data from /sys/block (instead of /sys/dev/block) in that lite drive-detector, and get it all organized even easier (and slightly faster). Partitions could be displayed as sub-menus. (And every partition could have its own sub-menu, if you want to add more options like mount/unmount/open-in-fm/info/[dare to blank/format/backup/play]/...)
Also consider displaying partition size next to the name (since it's handed on a plate):
size = /sys/block/drive/queue/hw_sector_size x /sys/block/drive[/partname]/size

Wanted to suggest something else too, but can't remember... It'll strike me later...
Back to top
View user's profile Send_private_message 
maxerro


Joined: 10 Oct 2010
Posts: 65

PostPosted: Sat 02 Jun 2012, 10:17    Post_subject:  

OK, forget that little size formula.
It appears that on newer hard-drives (after 2010) you may need to check /sys/block/drive/queue/logical_block_size or physical_block_size.

Edited_time_total
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Sat 02 Jun 2012, 10:29    Post_subject:  

There is a nifty little trick for that.
[ -f "file" ] && Var=$(<file)
Then use
${Var:-default_value}

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
maxerro


Joined: 10 Oct 2010
Posts: 65

PostPosted: Sat 02 Jun 2012, 11:59    Post_subject:  

These are the values that should be used:

/sys/block/drive[/partname]/size * 512 (in bytes)
or
/sys/block/drive[/partname]/size / 2048 (in MBytes)

... for all drives (for now).

Anyone who buys one of the new Advanced-Format HDDs and gets the wrong size reading, please report here (kindly).
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Mon 04 Jun 2012, 00:14    Post_subject:  

I have built a static version of jwm 579 against musl libc and tinyx11 - confirm, icons, png, xpm and jpeg enabled. No Xinerama or Xft, but should work on just about any distro and only uses 1.6Mb RAM with a solid background.

Looks like garbage with the builtin font (DejaVu Sans is not supported) so I set all the fonts to:
-adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1
... and it looks pretty good.
jwm-579.tar.gz
Description  confirm dialogs disabled here
gz

 Download 
Filename  jwm-579.tar.gz 
Filesize  272.99 KB 
Downloaded  345 Time(s) 
jwm-579.tar.gz
Description  the binary inside is _NOT_ upx'd
gz

 Download 
Filename  jwm-579.tar.gz 
Filesize  275.11 KB 
Downloaded  342 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Sat 16 Jun 2012, 21:43    Post_subject:  

I made a patch for jwm_menu_create to show icons that have entries in the .desktop file that don't have an extension, presuming they are .png format. I have kept it pure bash, there may be a better way though.

See here.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Tue 26 Jun 2012, 00:45    Post_subject:  

I am glad you brought that up, I had forgotten that non-compliance.

I'll add a todo to patch jwm - looks like its in image.c @
ImageNode *LoadImage(const char *fileName) {
it could just try to add the suffixes after the first pass to fileName and retry

still need to remove the %U %f etc from the execs though
I think it can be fixed in command.c by doing a s*printf and using NULL values prior to exec (maybe using strstr 1st to see if it has a %*) ... the problem with % is that it gets special treatment compared to normal characters.

I think I'd do this though:
Code:
Icon=*.xpm|Icon=*.png|Icon=*.jpg||Icon=*.jpeg) ICON="${LINE#*=}"''  ;;
Icon=*)ICON="${LINE#*=}.png"''  ;;


here is some tentative code for doing desktop icons using *.desktop files in $HOME/Desktop (useful for systems, including virtual machines with as little as 4Mb of RAM)

Code:
#!/bin/sh

[ -f ${HOME}/.jwm/JWMRC ] || cp /etc/JWMRC ${HOME}/.jwm/JWMRC
. ${HOME}/.jwm/JWMRC
[ -f ${HOME}/.jwm/jwm-icons ] && mv -f ${HOME}/.jwm/jwm-icons ${HOME}/.jwm/jwm-icons~ && echo "<JWM>" >${HOME}/.jwm/jwm-icons &
{   #localization block
[ $myLANG ] || myLANG=${LANGUAGE%% *}
[ $myLANG ] || myLANG=${LANG%_*}

[ -f /usr/share/locale/$myLANG/LC_MESSAGES/jwm ] && . /usr/share/locale/$myLANG/LC_MESSAGES/jwm
LANG=C
}

#should make check for display, but we can also set MAX_X in the JWMRC
[ ! "$MAX_X" ] && SCREEN_WIDTH=`xwininfo -root |awk '/geometry/{print $2}' |awk 'BEGIN{FS="x"}/x/{print $1}'` && MAX_X=$(($SCREEN_WIDTH-75))

XPOS=25
YPOS=25

for A_FILE in ${HOME}/Desktop/* ; do
ICON="" CATS="" NAME="" EXEC="" LINE="" COMMENT="" #prevent carryover from previous file
case "$A_FILE" in
*.desktop)
   while read LINE || [ "$LINE" ]; do
      case $LINE in
         Name=*|Name?${myLANG%_*}?=*) NAME="${LINE#*=}"'' ;;
         Comment=*|Comment?${LANG%_*}?=*) COMMENT="${LINE#*=}"''  ;;
         Icon=*.xpm|Icon=*.png|Icon=*.jpg|Icon=*.jpeg) ICON="${LINE#*=}"'' ;;
         Icon=*)ICON="${LINE#*=}.png"'';;
         Exec=*) EXEC="${LINE#*=}"'' ;;
      esac
      
   done < $A_FILE   

   [ "${EXEC}" ] && wait && echo '<Tray layout="vertical" x="'$XPOS'" y="'$YPOS'" layer="0" border="0" width="50" >
   <TrayButton popup="'${COMMENT:-$NAME}'" icon="'${ICON:-mini-dog.xpm}'">exec:'$EXEC'</TrayButton>
   <TrayButton popup="'${COMMENT:-$NAME}'" label="'${NAME:0:6}'">exec:'$EXEC'</TrayButton>
</Tray>' >>${HOME}/.jwm/jwm-icons &
XPOS=$(($XPOS+75))
[ $XPOS -gt $MAX_X ] && YPOS=$(($YPOS+75)) XPOS=25
;;
*)echo "$A_FILE" not supported >/dev/stderr;;   #todo xdg-open it?
                                    #find $ICONPATH -iname $A_FILE*
esac

done
wait && echo "</JWM>" >>${HOME}/.jwm/jwm-icons
jwm-desktop.png
 Description   here is a screeny with jwm providing the desktop... sortof
 Filesize   37.34 KB
 Viewed   1254 Time(s)

jwm-desktop.png


_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Tue 26 Jun 2012, 04:43    Post_subject:  

Does JWM/fixmenus/jwm_menu_create/whatever handle applications with "Terminal=true" in the .desktop file correctly?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Tue 26 Jun 2012, 15:43    Post_subject:  

I could, but unfortunately it probably would not work on all puppy's hacked desktop files... normally they would end up running
$TERM -e $EXEC
in older Puppy this would typically end up being
rxvt -e rxvt -e sh -c command args
(newer Pups have terminal=false set when the exec= already has been modified with the terminal)

I'd rather it be compliant and fix issues that it identifies rather than try to work around them though, but I'd need to look at the spec.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Wed 04 Jul 2012, 18:40    Post_subject:  

I wish I had never started looking at this, Puppy has a _lot_ of non-compliant behavior that could actually be simplified if it were (well it could be simplified without making it compliant too, but why bother with that?)

For instance I doubt we need 4 instances of delayedrun... or about 100 variations of autostarting sfs files on mount:
instead implement autostart

The menu generator in ALL standard directories

Create icons for each of standard icon names (look into patching jwm for imlib2 like icewm ... then it would also be pretty cool to implement my simple icon tray directly in jwm - just need to inotify watch each image and redraw on change)

Include these standard categories and add an OnlyShowIn support for jwm (and Rox?)

implement a better default handler (that does not depend on ROX-Filer) using mime info from desktop file entries including Trash and thumbnail support if possible (basically xdg-open lite)

shift jwm tools to using recently released xsettings spec

In order to do this programatically I will be going to 1 include file per operation: menu, install, tray, desktop, theme, temp (for notify, imageviewer, etc...) This will allow things like seamless jwm -refresh upon program installation (one for main menu and one for slower install menu) or operations on drive trays being inserted/removed to trigger jwm -refresh ... as well as some experimental features such as controlling desktop icons, drive menus, viewing images, notifications etc...

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 8 of 9 Posts_count   Goto page: Previous 1, 2, 3, ..., 6, 7, 8, 9 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1060s ][ Queries: 13 (0.0063s) ][ GZIP on ]