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 Mon 22 Dec 2014, 11:05
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 9 of 9 [130 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9
Author Message
disciple

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

PostPosted: Thu 05 Jul 2012, 02:37    Post subject:  

Quote:
instead implement autostart

Yes.
For when your window manager doesn't provide the functionality, I thought there was a shell script somewhere like github or gitorious produced by some Arch person... but if there was, I can't find it now. Maybe I was thinking of http://gitorious.org/xdg-autostart/ (not a shell script).

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

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

PostPosted: Thu 05 Jul 2012, 02:51    Post subject:  

Quote:
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)

I think the "new generation" pcmanfm actually handles this (file associations, not opening files from the command line like xdg-open), quite well, and I've been wondering what the chances would be of linking something like Rox or the old GTK searchmonkey against libfm to get this functionality... but I'm sure it's a lot too difficult for me.

This thing looks fun:
https://bbs.archlinux.org/viewtopic.php?pid=1124843https://github.com/Cloudef/PKGBUILDS/tree/master/linopen

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

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

PostPosted: Sun 15 Jul 2012, 08:55    Post subject:  

disciple wrote:
Quote:
instead implement autostart

Yes.
For when your window manager doesn't provide the functionality, I thought there was a shell script somewhere like github or gitorious produced by some Arch person... but if there was, I can't find it now. Maybe I was thinking of http://gitorious.org/xdg-autostart/ (not a shell script).

Another one (also not a shell script): https://bitbucket.org/jjacky/dapper

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Thu 18 Oct 2012, 07:45    Post subject: Re: jwm_tools-0.9 (was jwm_menu_create)
Subject description: version 0.9.4
 

Once upon a time...
L18L wrote:
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 word processor"%"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)



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

What´s new?

- You can switch (back) to English now

Does it not look nice in in of the "sinister languages" Laughing
jwm_tools_LANGUAGE.png
 Description   
 Filesize   22.07 KB
 Viewed   916 Time(s)

jwm_tools_LANGUAGE.png

jwm_tools-0.9.4.pet
Description 
pet

 Download 
Filename  jwm_tools-0.9.4.pet 
Filesize  18.71 KB 
Downloaded  524 Time(s) 
Back to top
View user's profile Send private message 
torios

Joined: 05 Dec 2014
Posts: 16

PostPosted: Fri 05 Dec 2014, 19:39    Post subject: menu fixes  

I have been modifying the script for use on Ubuntu, and I handle a few things slightly different.

First... Icons and Exec=
if [[ "${ICON##*.}" == "xpm" ]] || [[ "${ICON##*.}" == "svg" ]] || [[ "${ICON##*.}" == "png" ]] || [[ "${ICON}" == "/*" ]]
then
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>'
else
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'.svg">'${EXEC%\ \%?}'</Program>'
fi


And secondly for the case statement to get the info I added two items
case $LINE in
Name?${myLANG%_*}?=*|Name=*) NAME="${LINE#*=}"'' ;; # sc0ttman... should use "Name[$myLANG]=" if found
TryExec=*|Exec=*) EXEC="${LINE#*=}"'' ;;
Categories=*) CATS="${LINE#*=}"'' ;;
Icon=*) ICON="${LINE#*=}"'' ;;
Terminal=*) TERM="${LINE#*=}"'' ;;
'[Desktop Action'*) break ;;
"["*" Shortcut Group]") break ;;
the last two things check for Ubuntu specific (?) Desktop Actions and Shortcut Group for apps like Chrome...

I also include an xdg desktop directories folder, and parse that for localization for the category names... Which are structured like the Lubuntu menu
case "$CAT" in
AudioVideo)AV=${AV}${MenuEntry};;
Development)DEV=${DEV}${MenuEntry};;
Education)ED=${ED}${MenuEntry};;
Game)GAME=${GAME}${MenuEntry};;
Graphics)ART=${ART}${MenuEntry};;
Network)NET=${NET}${MenuEntry};;
Office)OFF=${OFF}${MenuEntry};;
Science)SCI=${SCI}${MenuEntry};;
Settings)SET=${SET}${MenuEntry};;
System)SYS=${SYS}${MenuEntry};;
Utility)ACC=${ACC}${MenuEntry};;
*)Misc=${MISC}${MenuEntry};; #add Miscellaneous category?
esac
If anyone is interested in this menu script let me know... it generates a Root menu, so it looks and behaves much like the old Gnome2 menu or the LXDE/XFCE etc... menus
I put my menu generation script in
/etc/menu-methods
and install menu && menu-xdg so this script is run everytime a program is installed...
The end of the script also does
sed -i 's/&/&amp;/g' ${MENUFILE}
RESULT=$(jwm -reload)
to replace & with the xml &amp
and reloads the menu

I use svg icons but feel free to change svg to whatever you like best
Basically it checks to see if it starts with '/' which would mean it is full path
and it looks to see if it has a . extention to keep that the same as well...
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4427

PostPosted: Fri 05 Dec 2014, 23:21    Post subject:  

Quote:
Code:
if [[ "${ICON##*.}" == "xpm" ]] || [[ "${ICON##*.}" == "svg" ]] || [[ "${ICON##*.}" == "png" ]] || [[ "${ICON}" == "/*" ]]
then
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>'
else
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'.svg">'${EXEC%\ \%?}'</Program>'
fi

could be
Code:
case "${ICON##*.}" in
  *.xpm|*.png|*.svg|/*):;;
  *)ICON="${ICON}.${DEFAULTICONTYPE:-svg}"
     #allows default icon type to be set in config
esac
MenuEntry='
<Program label="'${NAME}'" icon="'${ICON}'">'${EXEC%\ \%?}'</Program>
'

and also
Code:
"[Desktop Entry]"*)continue;;
"["*)break;; #handle any other random extra groups

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


Joined: 18 May 2008
Posts: 4427

PostPosted: Fri 05 Dec 2014, 23:48    Post subject:  

I just threw an xdg_autostart script together to use as a jwm <StartupCommand>

http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html

just place .desktop files that you want to autorun in /etc/xdg/autostart/ or $HOME/.config/autorun/

It assumes that $XDG_CURRENT_DESKTOP is set appropirately; for puppy using mostly gtk2 apps, to get a full desktop environment, set it to XFCE and/or GNOME ... in /etc/profile or your bashrc just set:
XDG_CURRENT_DESKTOP=GNOME:XFCE
and it will run all apps with OnlyShowIn=GNOME;XFCE
but not run any apps with NotShowIn=GNOME;XFCE
or set it to XDG_CURRENT_DESKTOP to JWM and add it to the OnlyShowIn= or NotShowIn= parameter of the .desktop files as necessary

Code:
#!/bin/ash

matchDeskEnv(){
   ret=1; IFS=";"
   for Env in ${1}; do
      case ":${XDG_CURRENT_DESKTOP}:" in
         *":${Env}:"*)ret=0;break;;
      esac
   done
   return $ret
}

doDesktopFile(){
   EXEC="";EXECPATH="";BACK=$PWD
   while read LINE; do
      case "$LINE" in
         Exec=*)EXEC=${LINE#*=};;
         Path=*)EXECPATH=${LINE#*=};;
         Hidden=true*)return;;
         OnlyShowIn=*)matchDeskEnv ${LINE#*=} || return;;
         NotShowIn=*)matchDeskEnv ${LINE#*=} && return;;
      esac
   done < $1
   [ "$EXECPATH" ] && cd $EXECPATH
   [ "$EXEC" ] && $EXEC &
   [ "$EXECPATH" ] && cd $BACK
}

AUTOSTARTDIR=${XDG_CONFIG_HOME:-${HOME}/.config/}/autostart
for Entry in ${AUTOSTARTDIR}/*.desktop; do
   doDesktopFile $Entry
done

IFS=":"
for DIR in ${XDG_CONFIG_DIRS:-/etc/xdg}; do
   for Entry in ${DIR}/autostart/*.desktop; do
      #allow users to block/override system settings
      [ -f "${AUTOSTARTDIR}/${Entry##*/}" ] && continue
      [ -f "${Entry}" ] && doDesktopFile $Entry
   done
done

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

Joined: 05 Dec 2014
Posts: 16

PostPosted: Mon 08 Dec 2014, 23:55    Post subject:  

I should add that I look for
Code:
Terminal=*) TERM="${LINE#*=}"''  ;;

and then
Code:
if [ "${TERM}" == "true" ]
then
EXEC="x-terminal-emulator -e ${EXEC}"
fi


So things like htop will work correctly.
I will look at your autostart scripts soon (still looking at sdesk)
That may be an easier way to handle autostarting all together.
Much more intuitive for new users Smile

Thanks for the input.. the icon code doesn't work exactly as I want (adds svg to files with a path....) but it looks cleaner.. so I will look more at it.
Back to top
View user's profile Send private message 
torios

Joined: 05 Dec 2014
Posts: 16

PostPosted: Tue 09 Dec 2014, 00:01    Post subject:  

Another question... do you know of anyone who has already made a way to parse icon themes (like the theme files or whatever) to add the appropriate directories for jwmrc?

This could then be checked and the extension added in the menu script.

Thanks for your help by the way! It is wonderful to have a usable JWM on Ubuntu!!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4427

PostPosted: Tue 09 Dec 2014, 20:48    Post subject:  

torios wrote:
I should add that I look for
Code:
Terminal=*) TERM="${LINE#*=}"''  ;;

and then
Code:
if [ "${TERM}" == "true" ]
then
EXEC="x-terminal-emulator -e ${EXEC}"
fi


Don't use TERM that way, it is a reserved variable used to set the terminal. It is actually helpful... That case should probably be
Terminal=*)["${LINE#*=}" == "true" ] && EXEC="$TERM -e $EXEC";;
(btw if you want x-terminal-emulator to be your default $TERM, add an export for it in /etc/profile or $HOME/.bashrc)

Quote:
Thanks for the input.. the icon code doesn't work exactly as I want (adds svg to files with a path....) but it looks cleaner.. so I will look more at it.

I thought that shells didn't do fallthrough cases, so I just used ):;; instead of )break;; ... normally that code would only add the svg (or default if set) when the icon doesn't have a supported extension or start with a '/'.... I don't recall if its allowed to have relative paths or with variables, but if so that could be changed to */*

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 9 of 9 [130 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9
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.0982s ][ Queries: 13 (0.0062s) ][ GZIP on ]