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 Sat 15 Dec 2018, 12:04
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
Various *.desktop files to (re)start various WMs
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
musher0

Joined: 04 Jan 2009
Posts: 13168
Location: Gatineau (Qc), Canada

PostPosted: Sun 24 Dec 2017, 12:00    Post subject:  Various *.desktop files to (re)start various WMs  

Hello all.

The old wmswitcher script from 2011 was mentioned in the waimea thread here.
I said I'd try modernize it and I will try.

But as a "side-thought", I thought an approach through *.desktop files could do the
job too. It's entirely optional, of course, but some people may find this handy.

The pet archive includes *.desktop restart files for the following WMs:
Quote:
echinus fluxbox icewm jwm kde
openbox pekwm waimea wmx xfce
If you use them, they will show up in the Utilities section of your menu.

Merry Christmas!

~~~~~~~~~~
(Please download second version from post below.)

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)

Last edited by musher0 on Sun 24 Dec 2017, 23:42; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13168
Location: Gatineau (Qc), Canada

PostPosted: Sun 24 Dec 2017, 23:40    Post subject:  

Hello all.

This 2nd version will only copy in /usr/share/applications the restart*.desktop files
for the window managers you have, excluding your "main" WM (the one you are in
when you install this pet). I think that this is more "intelligent" (said the resident
dummy..., i.e. moi ) Wink than a dozen of restart files showing up in the Utilities
section of a menu -- which was the situation with my first version.

At install time, it does the job from the pînstall.sh script.

After you have installed another WM which is in the list, you can (re)run the script
< restartWMs-gnl.sh > at /root/my-applications/restartWMs/. If the name of that
WM is in the list, its restart*.desktop file will be copied to the
/usr/share/applications directory. (You can also copy it by hand.)

Finally, you can add the name of a WM to the list in your text editor, should the
need arise.

I'm including the script. Please read the comments.
Code:
#!/bin/sh
#  /root/my-applications/restartWMs/restartWMs-gnl.sh
# (For general use. If you install a new WM that is
# already listed in list WM.lst2, re-run this script.)
# and
# pinstall.sh # which is run at time of install.
# (c) )musher0, Dec. 24, 2017
####
cd  /root/my-applications/restartWMs
while read line;do
   if [ "`which $line`" ];then
      if [ "$line" != "`cat /etc/windowmanager`" ];then
      # The *.desktop file for your main WM is not copied.
         cp -f restart_$line.desktop /usr/share/applications
      fi
   fi
done <  /root/my-applications/restartWMs/WM.lst2
# You can add other WMs to this list if you wish and
# create a restart*.desktop file for it using an existing
# one as template. Once done, rerun this script.


Feedback welcome. BFN.
restartWMs-0.2.pet
Description 
pet

 Download 
Filename  restartWMs-0.2.pet 
Filesize  1.23 KB 
Downloaded  131 Time(s) 

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13168
Location: Gatineau (Qc), Canada

PostPosted: Thu 28 Dec 2017, 13:44    Post subject:  

Edit, Jan. 2 2018. My apologies to those who downloaded this previously. I discovered
some errors in version 2, in the paths. Version 3a corrects this oversight. Again, sorry.


~~~~~~~~~~~~~~~~~~~~~~
Hello all.

Still another version. My apologies to those who have downloaded the previous ones.

This version 0.3 does not include any *.desktop files. It generates them.
I should have thought of this before...

Here is an example of a *.desktop file it creates:
Code:
[Desktop Entry]
# Warning -- For use with PuppyLinux only.
# Avertissement -- Utiliser seulement avec PuppyLinux.
Encoding=UTF-8
Icon=/usr/share/pixmaps/puppy/startup.svg
Comment=Replaces your current window manager with this one.
Comment[fr]=Remplace votre gestionnaire de fenêtres actuel par celui-ci.
Name=Restart jwm
Name[fr]=Redémarrer jwm
Exec=restartwm jwm
Terminal=false
Type=Application
Categories=Utility
GenericName=WM Switcher
GenericName[fr]=Changeur de gestionnaire de fenêtre
Please heed the warning, oh ye people of other distros? Wink

This is the script that generates it:
Code:
##!/bin/sh
#  /usr/bin/restartWMs-gnl3a.sh
#
# Requiert : | Requires: restartwm
# Goal: create *.desktop files to launch various window managers. |
# Objectif: créer des fichiers *.desktop pour lancer divers gest. de fen.
#
# -- Notes (EN) --
# 1) For use only with PuppyLinux or its derivatives. Other distros may NOT
# --- have the required < restartwm > script.
# 2) You can add one or more WM(s) to the WM.lst2 file. Check how it launches,
# --- however. If it launches as "startthingy", you will need to alter line 47 below.
# 3) In all cases, simply re-run this script to create a restart*.desktop file for it.
#
# -- Notes (FR) -- (...)
#
# © Christian L'Écuyer,Gatineau (Qc), Canada,  Dec. 24 2017. GPL3
# (Alias musher0 [forum Puppy].) # Rév. Dec. 28 2017, Jan. 1st 2018.
################# # https://opensource.org/licenses/GPL-3.0
# (GPL3 License) (...)
####
Top="[Desktop Entry]
# Warning -- For use with PuppyLinux only.
# Avertissement -- Utiliser seulement avec PuppyLinux.
Encoding=UTF-8
Icon=/usr/share/pixmaps/puppy/startup.svg
Comment=Replaces your current window manager with this one.
Comment[fr]=Remplace votre gestionnaire de fenêtres actuel par celui-ci."

Bottom="Terminal=false
Type=Application
Categories=Utility
GenericName=WM Switcher
GenericName[fr]=Changeur de gestionnaire de fenêtre"

cd  /root/my-applications/restartWMs

while read line;do
   if [ "`which $line`" ];then # Only if you have this WM | Seulement si vous avez ce gest. de fen.
      RestartFile="/usr/share/applications/restart_$line.desktop"
      # "/mnt/ram1/restart_$line.desktop" # test

      case "$line" in fluxbox|kde|xfwm4) ExecLine="Exec=restartwm start$line" ;;
         *) ExecLine="Exec=restartwm $line" ;;
      esac

      echo -e "$Top\nName=Restart $line
Name[fr]=Redémarrer $line\n$ExecLine\n$Bottom\n" > $RestartFile
   fi
done <  /root/my-applications/restartWMs/WM.lst2

fixmenus # New in v. 3a
restartwm



Please read these Notes:
Quote:
# Goal: create *.desktop files to launch various window managers. |
# [...]
#
# -- Notes (EN) --
# 1) For use only with PuppyLinux or its derivatives. Other distros may NOT
# --- have the required < restartwm > script.
# 2) You can add one or more WM(s) to the WM.lst2 file. Check how it launches,
# --- however. If it launches as "startthingy", you will need to alter line 47 below.
# 3) In all cases, simply re-run this script to create a restart*.desktop file for it.
#

There is no pinstall script in this version. You have to go through the trouble of
creating these *.desktop files yourself. Sad

However, this script itself has a *.desktop entry under the name
"WM_Switches.desktop". To encourage user laziness just a little bit! Smile

BFN.
restartWMs-0.3a.pet
Description  Please use this one
pet

 Download 
Filename  restartWMs-0.3a.pet 
Filesize  2.46 KB 
Downloaded  124 Time(s) 

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13168
Location: Gatineau (Qc), Canada

PostPosted: Tue 02 Jan 2018, 02:03    Post subject:  

Hello all.

I updated the message and the script in my previous post.
There was an error in the paths. Sorry about that.

To whoever downloaded it, please download the edited version. Thanks.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
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.1345s ][ Queries: 12 (0.0418s) ][ GZIP on ]