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 23 Jul 2014, 10:18
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 3 of 9 [124 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2372
Location: UK

PostPosted: Sat 20 Aug 2011, 08:26    Post subject:  

technosaurus wrote:
Optimization aside, it appears that Google translate skips capitalized words (as it should, grammatically it indicates a proper name) fortunately sed has a tolower function, but then there is a twist, usually the first word _is_ a proper name. Also the localized names follow name= alphabetically by locale, so doing the read while trick could help out.

Httpd may be able to fix some of those.... http -d .... there was a thread with a better method that zigbert started for pmusic lyrics.

I was looking for a 'tolower' option Smile

And you are correct, a lot of capitalized names should not be translated... To be honest, the first word of each entry should not be translated, most of the time...

And I know I should have posted it elsewhere, but my HD was/is dying on me, and I had to get it uploaded quick - I only had it in terminal, not saved (hence the needless bits/mistakes in there).. Sorry!

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


Joined: 16 Sep 2009
Posts: 2372
Location: UK

PostPosted: Sat 20 Aug 2011, 08:27    Post subject:  

also, I read users of netbooks (and smaller screens in general) complaining that sub-menus are a real pain the neck... I personally feel no need for them, but dont mind having them.. So I'm not voting either way..
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2372
Location: UK

PostPosted: Sat 20 Aug 2011, 10:17    Post subject:  

EDIT: translations for french, german, russian and spanish here: http://www.murga-linux.com/puppy/viewtopic.php?p=555135#555135
_________________
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: 2500
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Mon 22 Aug 2011, 14:57    Post subject: jwm_tools  

technosaurus wrote:
something like this:
(for the imaginary reverse alphabet english language)
Code:
#!/bin/sh
for FILE in $@; do
[ -e ${FILE} ] && sed -i "
s/a/z/
s/b/y/
s/c/x/
" ${FILE} || echo $FILE not a file >/dev/stderr
done


brilliantly simple - I like it ... and it would work for any script/text file ... but beware of translating key words in scripts (file, echo etc...)


Success in translating the original .jwmrc by simply adding double quotes and omitting keywords (there was just "false in acomment")
wary513

jwm_menu_create_translate_template:
Code:
#!/bin/sh
# translation at end of jwm_menu_create
OUT="jwm_menu_create_tr"
echo -n > $OUT

cat /root/.jwmrc | grep label= | cut -d '"' -f2 > /dev/shm/jwm_menu_translate
keywords="false "
while read LINE ; do
 [[ "$keywords" =~ "$LINE" ]] || echo "s#\"${LINE}#\"${LINE}#g" >> $OUT
done <  /dev/shm/jwm_menu_translate

# copy $OUT to $OUT_myLANG
# translate $OUT_myLANG
# sed -f jwm_menu_create_tr_de /root/.jwmrc > /dev/shm/.jwmrc_de
# cp /dev/shm/.jwmrc_de  /root/.jwmrc
# jwm -restart


Attached a little gui for switching language of menu

technosaurus wrote:
Ideally I would like to eventually be able to have a Puppy start out with only static uclibc busybox, Xvesa, jwm and terminal (+ a few helpers).

FIne, Xvesa is important for my VIA mini-ITX box Very Happy
jwm_languageswitcher.tar.gz
Description 
gz

 Download 
Filename  jwm_languageswitcher.tar.gz 
Filesize  995 Bytes 
Downloaded  354 Time(s) 
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Mon 22 Aug 2011, 20:59    Post subject:  

v 0.4 is released with more translations and a bugfix that fixes broken keybindings. See initial post for .pet.

Would it be easier on everyone (read developers) if I return jwm_menu_create going to stdout instead of creating the jwmrc file directly? I could always include a wrapper script(s) for the general user.

This is a little template for my next jwm tool (jwm_image_view), I still need to write the script to go with it, but it will be similar to jwm_notify
Code:

<Tray  autohide="false" insert="right" halign="center" y="1" border="0">
<TrayButton popup="Previous" label="<" ></TrayButton>
<TrayButton popup="Next" label=">" ></TrayButton>
<TrayButton popup="Smaller" label="-" ></TrayButton>
<TrayButton popup="Larger" label="+" ></TrayButton>
<TrayButton popup="Maximize" label="[]" ></TrayButton>
<TrayButton popup="Close" label="X"></TrayButton>
</Tray>

<Tray  autohide="false" insert="right" halign="center" y="28"  border="0" height="192" >
<TrayButton popup="$MESSAGE_HERE" icon="/usr/share/backgrounds/default.jpg"></TrayButton>
</Tray>
jwm_image_view.png
 Description   
 Filesize   40.23 KB
 Viewed   1070 Time(s)

jwm_image_view.png


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


Joined: 18 May 2008
Posts: 4277

PostPosted: Tue 23 Aug 2011, 00:18    Post subject:  

Ok here is the next jwm tool as promised, you will need to add
Code:
<Include>/root/.jwm/jwmrc-image</Include>
somewhere in your jwmrc ... it will be in v 0.5
Code:
#!/bin/ash

while ([ $1 ]) do
case ${1} in
   *.png|*.jpg|*.xpm)[ $IMAGE1 ] && IMAGES=${IMAGES}' '${1} && IMAGELAST=${1} || IMAGE1=${1};;
   height=*)eval ${1};;
   Close)rm -rf ${HOME}/.jwm/jwmrc-image;jwm -restart;exit;;
   *);;
esac
shift
done

PREVIOUS=${IMAGELAST}' '${IMAGE1}' '${IMAGES%*${IMAGELAST}}
NEXT=${IMAGES}' '${IMAGE1}
SMALLER='height='$((${height:-192}/2))' '${IMAGE1}' '${IMAGES}
LARGER='height='$((${height:-192}*2))' '${IMAGE1}' '${IMAGES}

MAXHEIGHT=`xwininfo -root`
MAXHEIGHT=${MAXHEIGHT##*-geometry *x};
MAXHEIGHT=$((${MAXHEIGHT%%+*}-50));
MAXIMIZE='height='${MAXHEIGHT}' '${IMAGE1}' '${IMAGES}


[ $height ] && height='height="'$height'"'
echo '<JWM><Tray  autohide="false" halign="center" y="1" border="0">
   <TrayButton popup="Previous - not yet implemented" label="<" >exec:jwm_image_view '${height}' '${PREVIOUS}'</TrayButton>
   <TrayButton popup="Next - not yet implemented" label=">" >exec:jwm_image_view '${height}' '${NEXT}'</TrayButton>
   <TrayButton popup="Smaller" label="-" >exec:jwm_image_view '${SMALLER}'</TrayButton>
   <TrayButton popup="Larger" label="+" >exec:jwm_image_view '${LARGER}'</TrayButton>
   <TrayButton popup="Maximize" label="[]" >exec:jwm_image_view '${MAXIMIZE}'</TrayButton>
   <TrayButton popup="Close" label="X">exec:jwm_image_view Close</TrayButton>
</Tray>
<Tray  autohide="false" halign="center" y="25"  border="2" '$height' >
<TrayButton popup="'${IMAGE1}'" icon="'${IMAGE1:-mini-dog.xpm}'">exec:jwm_image_view Close</TrayButton>
</Tray></JWM>' > ${HOME}/.jwm/jwmrc-image
jwm -restart
Note: I intentionally used xwininfo because it has been ported to xcb and will compile into a low resource binary with uclibc or musl. Let me know if anyone has a shell only way that will work in Xorg _and_ Xvesa to get the screen resolution.

I think for Xorg I can look in xorg.conf for "PreferredMode"
    Option "PreferredMode" "####x###"

usually Xvesa has its own file in /etc/videomode too
    0x011B 1280x800x24


does anyone know if these are consistent across hardware and puppy versions?

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


Joined: 30 Jun 2006
Posts: 915

PostPosted: Tue 23 Aug 2011, 06:20    Post subject:  

JWM Menu categories Dutch translation.

Code:
nl*)   #Dutch
      jwm_Desktop="Bureaublad"
      jwm_DesktopSettings="Bureaublad Instellingen"
      jwm_DesktopCountry="Land Instellingen"
      jwm_DesktopApplets="Applets"
      jwm_System="Systeem"
      jwm_SystemConfig="Systeem Configuratie"
      jwm_SystemMemory="Apparaten"
      jwm_SystemSchedule="Planning"
      jwm_Setup="Instellingen"
      jwm_SetupEntry=""
      jwm_SetupWizard="Wizard Instellingen"
      jwm_SetupUtility="Hulpmiddelen"
      jwm_Utility="Hulpmiddelen"
      jwm_UtilityUtilities=""
      jwm_UtilityArchiving="Archief"
      jwm_UtilityConsole="Terminal"
      jwm_Filesystem="Bestandssysteem"
      jwm_FilesystemManager="Bestandsbeheer"
      jwm_FilesystemMount="Schijven aan-/afkoppelen"
      jwm_FilesystemUtilities="Hulpprogramma's"
      jwm_FilesystemFind="Vinden"
      jwm_Graphic="Grafisch"
      jwm_GraphicGraphics=""
      jwm_GraphicEdit="Grafische editor"
      jwm_GraphicUtility="Hulpprogramma's"
      jwm_Document="Document"
      jwm_DocumentCompose="Opstellen"
      jwm_DocumentText="Tekst"
      jwm_DocumentUtilities="Hulpoprogramma's"
      jwm_Business="Zakelijk"
      jwm_BusinessSheets="Rekenblad"
      jwm_BusinessCalculator="Rekenmachine"
      jwm_BusinessUtilities="Hulpprogramma's"
      jwm_Personal="Persoonlijk"
      jwm_PersonalPlan="Agenda"
      jwm_PersonalUtilities="Hulpprogramma's"
      jwm_Network="Netwerk"
      jwm_NetworkDialup="Inbel-netwerk"
      jwm_NetworkRemote="Netwerk"
      jwm_Internet="Internet"
      jwm_InternetWWW=""
      jwm_Multimedia=""
      jwm_MultimediaMedia=""
      jwm_MultimediaBurn="Media branden"
      jwm_Fun="Spelletjes"
      jwm_Help="Hulp"
      jwm_Shutdown="Afsluiten"
      jwm_Exit="Exit naar prompt"
      jwm_Reboot="Herstarten"
      jwm_Poweroff="Computer afsluiten"
      jwm_RestartX="X herstarten"
      jwm_RestartJWM="JWM herstarten"
      ;;


_________________


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


Joined: 16 Sep 2009
Posts: 2372
Location: UK

PostPosted: Tue 23 Aug 2011, 06:58    Post subject:  

0.4 is looking awesome!!

technosaurus wrote:
Would it be easier on everyone (read developers) if I return jwm_menu_create going to stdout instead of creating the jwmrc file directly? I could always include a wrapper script(s) for the general user.

That would be nice, although to be honest, I dont see myself redirecting it anywhere else - as long as I have a backup .jwmrc I don't really mind replacing it directly...

And obviously I am no expert, but I have used the Xvesa videomode file to get resolutions in Puppy Arcade.. As far as I remember it works fine..

_________________
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: 4277

PostPosted: Tue 23 Aug 2011, 18:31    Post subject: jwm_tools-0.5  

jwm_tools-0.5 released see initial post for .pet
Changelog:
v 0.5
added jwm_image_view ... usage: jwm_image_view [images]
add drive tray ... usage jwm_create_drives
fixed a bug in jwm_notify -- used by the drive tray
removed static ${HOME}/.jwm/jwmrc-install - autogenerate with jwm_install_menu_create
blacklisted only BuildingBlock,DOC,DEV in jwm_install_menu_create (NLS should appear now)
added TODOs
- split out localizations in separate files to be sources
- background setting - already have image_viewer & gtk2jwm for the colors
jwm_tools-0.5.png
 Description   jwm_image_view (viewing /usr/sjare/backgrounds/*)
drive tray (using 24x24 pngs at bottom center)
install menu open in the top left
 Filesize   45.94 KB
 Viewed   988 Time(s)

jwm_tools-0.5.png


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


Joined: 18 May 2008
Posts: 4277

PostPosted: Fri 26 Aug 2011, 01:59    Post subject:  

Ok, I now have a goal for the 1.0 version

I am tired of simple little changes to the "static" xml files (which are still valid xml) borking some aspect of something. There a several different tools out there with various methods of poking/prodding the xml with the shell to beat it into submission and as many different styles of breaking it all out. So I tried to come up with the simplest way to fix/support all of these issues/concerns.

as I posted in the pupngo thread

I think I have come up with a way to let users (or pupleteers) choose and support everywhere from a single jwmrc to a separate include for every parameter. Almost too simple, so I am sure it will need tweaks....

just use a separate config file with

Var1=
Var2=
... where the vars are all the parameters covered in http://joewing.net/programs/jwm/config.shtml

Easily sourced by...for instance?
. $HOME/.JWMRC
A program could choose to use only 1 or all vars to generate 1 or many xml files

And it would be fast and easy to modify with the while read line case format.

Thoughts?

_________________
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 27 Aug 2011, 05:47    Post subject:  

From users' point of view the advantage would be that they could quickly define several jwm profiles that they could switch easily. Or the emphasis is on detail of customization?
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Mon 29 Aug 2011, 19:27    Post subject:  

not sure the question, but maybe this will answer it

v0.6 is released


1. monolithic configuration file that can easily be used by any program to know what the jwm settings are, use them, change them etc... without having to hack at xml files with the shell
2. script to modify the configuration file (up to 9 parameters at a time)
3. jwm_menu_create now uses the config file (at ${HOME}/.jwm/JWMRC) to set almost all parameters (tray, keys and groups not yet implemented - see ${HOME}/.jwm/jwmrc-extra)
4. Submenus and drive icon tray are now enabled/disabled via JWMRC
5. drive tray is now part of the main .jwmrc if enabled
6 removable drives now display a usb icon (devicehandler doesn't however have an unmount option... or other frills )
7. jwm_notify and jwm_image_view now share a temporary jwmrc file (${HOME}/.jwm/jwmrc-tmp)
8. add jwm_param_set to modify jwm settings
usage:
jwm_param_set 'DRIVES="true"'
jwm_menu_create && jwm -restart
#will rebuild the jwmrc and include a drive tray at bottom center
jwm_param_set 'DRIVES=""'
jwm_menu_create && jwm -restart
#will rebuild the jwmrc and exclude the drive tray at bottom center
even with the extra

a gui wrapper can just do this
Code:
. ${HOME}/.jwm/JWMRC
#bunch of gui crud here
jwm_param_set 'PARAM1="'${VALUE}'"' ...
jwm_menu_create && jwm -restart


note the double and single quotes in jwm_param_set --- I find it easier to use than backslashing quotes (which are needed becaus some params have spaces or begin with a #)
jwm_tools-0.6.pet
Description 
pet

 Download 
Filename  jwm_tools-0.6.pet 
Filesize  11.14 KB 
Downloaded  335 Time(s) 

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


Joined: 10 Oct 2010
Posts: 65

PostPosted: Tue 30 Aug 2011, 12:40    Post subject:  

Yes, I can modify the JWMRC (among other things) to answer my question. Thanks.
You have a couple of suggestions in PM. Hope at least some of them will be useful.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2500
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Wed 31 Aug 2011, 11:50    Post subject: jwm_tools-0.6
Subject description: 1st gui
 

As I had some difficulties applying jwm_param_set I was using sed again Smile
Code:
#!/bin/sh
# jwm-tools-gui
# TODO: what about comments in config file?
#       color selectors, checkboxes,...

# 2 file locations
new_values="/dev/shm/jwm_tools_gui"
conf=${HOME}/.jwm/JWMRC
. $conf

text1=$(gettext "Select <span color='darkgreen'>one</span> ore <span color='darkred'>several</span> items
 then click or press OK button
 to change the <span color='darkred'>values</span> of the <span color='darkgreen'>selected</span> items")

text2=$(gettext "Now change value")

# ask what has to be changed
change_it=$(cat $conf \
| yad --title="jwm-tools"  --image="gtk-preferences" --text="$text1" --height=300 \
      --list --multiple \
      --column="" \
| tr '|' ' ' )
choice=$?
[[ $choice -eq 1 || $choice -eq 252 ]] && exit 0     
 
# let user change selected values
echo -n "" > $new_values
for ONEchange in $change_it
do
     param=`echo $ONEchange | cut -d '"' -f 1`
 old_value=`echo $ONEchange | cut -d '"' -f 2`
 
 new=$(echo $ONEchange \
      | yad --image="gtk-edit" --text="$text2" \
            --form \
            --field="$param" "$old_value" \
      | cut -d '|' -f1
      )

 echo "s#${param}\"${old_value}\"#${param}\"$new\"#"  >>$new_values   
done

#apply changes
mv $conf ${conf}tmp
sed -f $new_values ${conf}tmp > $conf
sync
jwm_menu_create && jwm -restart

#end


How can
param=`echo $ONEchange | cut -d '"' -f 1`
be coded without cut Question
jwm_tools_gui.png
 Description   1st attempt
 Filesize   16.21 KB
 Viewed   865 Time(s)

jwm_tools_gui.png

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


Joined: 18 May 2008
Posts: 4277

PostPosted: Wed 31 Aug 2011, 12:54    Post subject:  

cut/sed can normally replaced by string manipulations

lets say:

VARNAME='BG="/usr/share/backgrounds/default.jpg"'

and you want this value
NEWVAL=/usr/share/backgrounds/newbg.jpg

echo ${VARNAME//${VARNAME#*=}/\"$NEWVAL\"}


(for more info google bash substring manipulation)

but if you would rather use jwm_param_set, I probably wasn't clear enough on the format

jwm_param_set 'VAR1="value1"' 'VAR2="value2"'
#note double quotes (blue) around value and single quotes (red) around each parameter
I am sure there is a better way to set them, this was the first one I came up with to change multiple parameters while respecting # (in colors) and spaces (font names)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 9 [124 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 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:  

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.1195s ][ Queries: 13 (0.0060s) ][ GZIP on ]