jwm_tools-0.9 (was jwm_menu_create)

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

jwm_param_gui

#98 Post by L18L »

tested and fixed:
- SUBMENU
- DRIVES
added
- LANGUAGE

screenshot see
http://murga-linux.com/puppy/viewtopic. ... &start=403

----------------------
edited
buggy
use version 0.7.3 (4 posts down) please.
Attachments
jwm_param_gui.gz
rename to jwm_param_gui
(3.39 KiB) Downloaded 653 times
Last edited by L18L on Sun 19 Feb 2012, 10:18, edited 1 time in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#99 Post by BarryK »

technosaurus wrote:
BarryK wrote:technosaurus,
Note that the fixmenus in Woof has some extra functionality, to support the 'menu_strings' SSS domain. See file:

http://bkhome.org/fossil/woof2.cgi/arti ... 6564d629e6

Note, putting that extra code in will not matter for puppies that don't have menu_strings, as it tests for existence of the file.
I think these are already translated in jwm_menu_create ... and many more (Thank others, I barely speak english, but am fluent in shell)
Ok.

For the record, that link to Fossil repo is out of date, the fixmenus file has changed considerably:

http://bkhome.org/fossil/woof2.cgi/arti ... aa4298e9dc
[url]https://bkhome.org/news/[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#100 Post by technosaurus »

I'll probably do a new minor point release this week with some xlations, but I want to do a little experiment first ... export LANG=C after the translation variables are loaded to see if 1. Translations stick with proper characters and such, and 2. Test speed difference

If anyone has more bug/translation fixes ...
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#101 Post by 01micko »

I believe there is a feature request [of sorts] for <StartupCommand> integration... here .. if you're interested.
Puppy Linux Blog - contact me for access

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

jwm_param_gui

#102 Post by L18L »

technosaurus wrote:...
If anyone has more bug/translation fixes ...
Tested jwm_para_gui in latest racy
did not work because no config file

A config file is being created by jwm_menu_create.

I have integrated this into jwm_param_gui together with adding the LANGUAGE parameter

Code: Select all

# create missing config file ~/.jwm/JWMRC and missing LANGUAGE parameter

version=0.7.3
--------
Maybe moving the location of translation files
from
/usr/share/locale/*/LC_MESSAGES/jwm
to
/usr/share/locales/*/jwm
is a good idea?

________________________________

edit
NOTE, background image does not change
jwm_param_gui is just changing values in JMRC
Attachments
jwm_param_gui.gz
remove .gz
(3.68 KiB) Downloaded 647 times
Last edited by L18L on Sun 19 Feb 2012, 17:48, edited 1 time in total.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#103 Post by sc0ttman »

technosaurus wrote:I want to do a little experiment first ... export LANG=C after the translation variables are loaded to see if 1. Translations stick with proper characters and such, and 2. Test speed difference
I'm 90% sure that works.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#104 Post by musher0 »

technosaurus wrote:It seems ok to a non-native speaker, but is it necessary to have "SESSION" in all caps? ..or is that based on a distro/puplet specific shutdown script?
Hi, technosaurus.

No, it could be "Session", but AFAIK there seems to be a consensus in Toutou's to have it in caps. Maybe to bring attention to this item, as if saying "this is where you control your session". I don't care either way, really.

BFN
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#105 Post by musher0 »

01micko wrote:
>Well for now would any native French users say Musher0's translation effort beats techno's google effort? If so I'll put it in Slacko.

If you use the Google one... at least make sure you have the "Calculate" item read "Calculs" and not "Calcus" -- which could as well be "Cactus"...(ouch) or even something vulgar...
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#106 Post by sc0ttman »

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

Code: Select all

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
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

jwm_tools-0.9.1

#107 Post by L18L »

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
Attachments
jwmconfig2_jwm_param_gui.png
.. and another language added
(19.1 KiB) Downloaded 1315 times
Last edited by L18L on Wed 14 Mar 2012, 22:10, edited 2 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#108 Post by L18L »

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
Last edited by L18L on Thu 15 Mar 2012, 20:26, edited 2 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

jwm_tools-0.9 (was jwm_menu_create)

#109 Post by L18L »

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)

Image

----
edited 2012-10-18
downloaded 164 times
deleted jwm_tools-0.9.3.pet
use jwm_tools-0.9.4.pet please :)
Last edited by L18L on Thu 18 Oct 2012, 11:53, edited 2 times in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#110 Post by technosaurus »

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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

#111 Post by maxerro »

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...

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

#112 Post by maxerro »

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.
Last edited by maxerro on Sat 02 Jun 2012, 15:56, edited 1 time in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#113 Post by technosaurus »

There is a nifty little trick for that.
[ -f "file" ] && Var=$(<file)
Then use
${Var:-default_value}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

#114 Post by maxerro »

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).

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#115 Post by technosaurus »

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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#116 Post by 01micko »

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.
Puppy Linux Blog - contact me for access

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#117 Post by technosaurus »

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: Select all

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: Select all

#!/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
Attachments
jwm-desktop.png
here is a screeny with jwm providing the desktop... sortof
(37.34 KiB) Downloaded 1480 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply