Desktop environment based on Fvwm

TOOLS

Below all command line tools are listed used in Fvwm-Nightshade.


NAME

fns-menu-desktop - Reads XDG menu files and creates Fvwm menus

SYNOPSIS

fns-menu-desktop [ --help|-h ] [ --version|-v ] [ --install-prefix DIR ] [ --desktop NAME ] [ --menu-type NAME ] [ --theme NAME ] [ --with-titles|-w ] [ --enable-mini-icons ] [ --size|-s NUM ] [ --mini-icon-dir|-t DIR ] [ --app-icon NAME ] [ --dir-icon NAME ] [ --title|-t NAME ] [ --insert-in-menu NAME ] [ --get-menus all|desktop ] [ --set-menus menu_paths ] [ --verbose ]

DESCRIPTION

This is a python script which parses XDG menus definitions to build corresponding fvwm menus.

OPTIONS

Main Options

--help

Show the help and exit.

--version

Show the version and exit.

--install-prefix DIR

Optional parameter to override the standard locations for XDG menu definitions. The standard locations are /etc/xdg/menus (and $HOME/.config/menus if it exists).

--desktop NAME

Optional parameter to override the NAME of the main desktop environment installed on the system. If a system offers multiple desktop environments $XDG_MENU_PREFIX is typically set and is ignored if --desktop is denoted. Possible names are: gnome, kde, xfce, lxde, debian, etc.

--menu-type NAME

Defines which type of menus should be found. Possible NAME types could be: applications, settings, preferences, etc.

Note that if the specified menu type doesn’t exist the generated menu is empty!

--theme NAME

Defines the used icon theme. Default is gnome but all others found in /usr/share/icons could be used except the hicolor theme because it’s the default fallback theme if no icon is found.

--with-titles|-w

If this option is set menus are generated with titles. Default is no titles.

--title|-t NAME

Option to define the menu title NAME of the top menu used by Fvwm’s Popup command. Default is "FvwmMenu".

--insert-in-menu NAME

Option to insert generated menu(s) IN a menu NAME (its top title).

Note that this option does not work correctly with the Regnerate Menus menu entry in a normal built menu since items inserted into such a menu cannot be removed (currently). If you use this option there and want to update your menus, you have to restart fvwm. A better way is to use dynamic menus (see the example in the USAGE section).

--get-menus all|desktop

Prints a space separated list of full menu paths. all is all menus on the system except empty ones. desktop is desktop related menus. No menu generation is done.

This option is meant for use with the configuration tool.

--set-menus menu_paths

Expects a space separated list of full menu paths to generate user specified menus

This option is meant for use with the configuration tool.

--verbose

Enables additional information printouts on STDERR.

Icons Options

By default, fns-menu-desktop builds menus without mini-icons. To enable mini-icons use:

--enable-mini-icons

This option enables mini-icons in the menus. If set, 24x24 mini- icons are used. If the specified icon isn’t that size it will be converted if ImageMagick is installed and saved in $HOME/.fvwm/icons or to the directory specified with --mini-icon-dir option. Otherwise no icon appears in the menu for that entry. With most distributions, all the menu entries will have mini-icons appropriate to the application.

--size|-s NUM

If --enable-mini-icons is used the size of the icons can changed with this parameter. Default is 24.

--mini-icon-dir DIR

When the right size mini-icon isn’t available, fns-menu-desktop creates icons with the right size in $HOME/.fvwm/icons. If you don’t want to use the default directory, $HOME/.fvwm/icons, use this option to specify a different folder.

--app-icon NAME

If --enable-mini-icons is used and for an application no icon is found gnome-applications as default icon is used. But if the gnome icon theme isn’t installed no default icon appears. So another icon can defined here.

Only the name of an icon is needed not the path!

--dir-icon NAME

If --enable-mini-icons is used and for a directory in a menu no icon is found gnome-fs-directory as default icon is used. But if the gnome icon theme isn’t installed no default icon appears. So another icon can defined here.

Only the name of an icon is needed not the path!

USAGE

Without any parameters fns-menu-desktop creates a menu named "FvwmMenu" with sub menus found for the main desktop environment installed on the system.

To add the default generated menu to the "Root" menu add the following to your fvwm config file ~/.fvwm/config (in Fvwm-Nightshade it is already implemented). This generates the menu each time you pop it up:

AddToMenu MenuRoot "XDG Menus" Popup FvwmMenu
PipeRead 'fns-menu-desktop'

This is likely to be too slow and is not recommended.

Another possibility is to use DynamicPopupAction, the menu will be built only if you pop up the menu. The following creates a "KDE Menus" menu which contains all Kde menus found on the system which is built only the first time you pop it up:

AddToMenu MenuRoot "KDE Menus" Popup FvwmKde
 ...

AddToMenu FvwmKde
+ DynamicPopupAction PipeRead 'fns-menu-desktop --desktop kde \
                                                  --title FvwmKde \
                                                  --enable-mini-icons \
                                                  [other options]'

The example above generates a menu with the Xdg menus as sub menus. If the sub menus should appear one level higher do this:

AddToMenu MenuRoot "Root Menu" Title
+ PipeRead 'fns-menu-desktop --insert-in-menu MenuRoot'

To generate single menus like preferences:

fns-menu-desktop --desktop kde --menu-type preferences --title FvwmPref \
                   --enable-mini-icons -size 16 --with-titles

This generates a single KDE Preferences menu with top title "FvwmPref", mini icons with a size of 16x16 pixels and titles for each sub menu. But only if a menu with the name preferences exists in the users or system wide Xdg directories. Else it’s empty!

To add the generated menu to the "Utilities" menu for example put the following to your fvwm config file ~/.fvwm/config:

AddToMenu Utilities "Preferences Menu" Popup FvwmPref
PipeRead 'fns-menu-desktop --desktop kde --menu-type preferences \
                             --title FvwmPref [other options]'

If you think that fns-menu-desktop slows down your menu startup too much do not use PipeRead. Instead run fns-menu-desktop and redirect the menu to a file and read that file in your ~/.fvwm/config file.

AddToMenu MenuRoot "XDG Menus" Popup FvwmMenu
 ...

AddToMenu FvwmMenu
+ DynamicPopupAction Function FuncRecreateXdgMenus
 ...

DestroyFunc FuncRecreateXdgMenus
AddToFunc   FuncRecreateXdgMenus
+ I Test (f  $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
+ I TestRC (!Match) PipeRead 'fns-menu-desktop > $[FVWM_USERDIR]/.menu \
                              &&  echo "Read $[FVWM_USERDIR]/.menu"'

or if you want to show the menus directly in a normal "Root" menu use this:

AddToMenu MenuRoot "Root Menu" Title
+ FuncXdgMenusInRoot
 ...

DestroyFunc FuncXdgMenusInRoot
AddToFunc   FuncXdgMenusInRoot
+ I Test (f  $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
+ I TestRC (!Match) PipeRead 'fns-menu-desktop --insert-in-menu MenuRoot \
                              > $[FVWM_USERDIR]/.menu \
                              && echo "Read $[FVWM_USERDIR]/.menu"'

The problem here is, that you have to restart fvwm because items insserted into such a menu cannot be removed. For that BOTH menus must be regenerated:

AddToMenu MenuRoot DynamicPopupAction FuncMenuRoot

DestroyFunc FuncMenuRoot
AddToFunc FuncMenuRoot
+ I DestroyMenu MenuRoot
+ I AddToMenu MenuRoot DynamicPopupAction FuncMenuRoot
+ I AddToMenu MenuRoot "Root Menu" Title
+ I Popup XdgMenus

AddToMenu XdgMenus DynamicPopupAction FuncXdgMenusInRoot

DestroyFunc FuncXdgMenusInRoot
AddToFunc FuncXdgMenusInRoot
+ I AddToMenu XdgMenus DynamicPopupAction FuncXdgMenusInRoot
+ I Test (f  $[FVWM_USERDIR]/.menu) Read $[FVWM_USERDIR]/.menu
+ I TestRC (!Match) PipeRead 'fns-menu-desktop --insert-in-menu MenuRoot \
                              > $[FVWM_USERDIR]/.menu \
                              && echo "Read $[FVWM_USERDIR]/.menu"'

GUI

There’s a Perl-SimpleGtk2 GUI to setup the menu generation manually. It is found in the root of the generated menu called "Regenerate XDG Menu(s)".

Or it can be started from within FvwmConsole with

Module FNS-MenuConfigurator

BUGS

The whole process of creating menus from files is slow. Otherwise report bugs to the fvwmnightshade-workers mailing list <fvwmnightshade-workers@googlegroups.com>.

AUTHORS

This script is based on fvwm-xdg-menu.py written by Piotr Zielinski (http://www.cl.cam.ac.uk/~pz215/) who assigned Licence: GPL 2 Date: 03.12.2005.

The script was reworked to replace the existing fvwm-menu-desktop perl script by the fvwm-workers and it was adapted and renamed to work within Fvwm-Nightshade.

COPYING

The script is distributed by the same terms as Fvwm-Nightshade itself. See GNU General Public License for details.




FNS-FIND-ICON

NAME

fns-find-icon - command line tool to get the iconpath of an application or the icon of an application

SYNOPSIS

fns-find-icon [-h|--help] [--version] [-n NAME] [-i W_ID] [-p EXTEND_PATH] [-s ICON_SIZE] [--svg] [-c CATEGORY] [--notdesk]

DESCRIPTION

fns-find-icon is used to find the correct icon path listed in the desktop file of an application in /usr/share/applications/ or the icon path of an application depending on the used theme in fvwm-menu-desktop-config.fpl. Default theme is gnome.

OPTIONS

These command line options are recognized by fns-find-icon:

-n NAME

Find the appropriate icon path of an application listed in its desktop file. Or if --notdesk is given find the icon in /usr/share/icons/.

Example for .desktop file search:

$ fns-find-icon -n meld

Desktop file of meld:

[Desktop Entry]
Encoding=UTF-8
Name=Meld
GenericName=Diff Viewer
X-GNOME-FullName=Meld Diff Viewer
Comment=Compare and merge your files
Exec=meld
Terminal=false
Type=Application
Icon=meld
StartupNotify=true
Categories=GNOME;Application;Development;

First fns-find-icon tries to find the full path. If only the name is given in the .desktop file it searches for the used theme in $FVWM_USERDIR/.FvwmForm-Desktop-Config. If $FVWM_USERDIR/.FvwmForm-Desktop-Config doesn’t exist it uses the default theme gnome. If the icon not found it searches in $FVWM_USERDIR/.menu lastly. If the search was successfully it converts the icon to the needed size (if the icon found in $FVWM_USERDIR/.menu only).

Example for normal icon search:

$ fns-find-icon -n 'system-log-out' -s 24 -c 'actions' --notdesk

Here fns-find-icon tries to find the icon "system-log-out" with the size of "24x24" in the category "actions". The --notdesk tolds fns-find-icon not to search in the desktop files but in /usr/share/icons/.

First it gets the used theme, then it searches in the category with the stated size. If it find the icon it returns the full path. If not returns nothing.

-i W_ID

It is possible to search for an icon for a specific window with the window id. fns-find-icon uses for this the program xprop. It asks xprop over WM_CLASS for the used name and then makes the same steps as in -n NAME described.

-p EXTEND_PATH

Sometimes it is needed to told fns-find-icon to search in other paths also. The defaults are:

/usr/share/icons/[theme]/[icon-size]/[category]/
/usr/share/icons/[theme]/[category]/[icon-size]/
/usr/share/icons/hicolor/[icon-size]/[category]/
/usr/share/pixmaps/

You can extend the defaults with this option. Different paths are sperated with a ":".

-s ICON_SIZE

The ICON_SIZE defines the the icon size to search for. Default is 48.

--svg

Prefer svg instead of bitmaps and if found add :<size>x<size> at the end of the path.

-c CATEGORY

The CATEGORY defines the category in the theme to search for an icon. Default is apps.

-t THEME

The THEME defines the theme to search for an icon. Default is the theme used in fvwm-menu-desktop-config.

--notdesk

To search for a specific icon not for an icon from a .desktop file use this option.

--version

Shows program’s version number and exit.

-h | --help

Shows short help and exit.

AUTHOR

© 2013 - 2016 Thomas Funk <t.funk@web.de>




fns-find-file

NAME

fns-find-file - command line tool to get the path of a file

SYNOPSIS

fns-find-file [-h | --help] [--version] [-s | --silent] [-p | --path] [-r | --recursive] [FILENAME]

DESCRIPTION

fns-find-file is used to find the correct path of a file depending of the directories specified in a search path. The default search path is $FNS_SOUNDPATH. But other search paths like $PATH can be used.

OPTIONS

These command line options are recognized by fns-find-file:

FILENAME

Find the appropriate path of a file depending of the directories specified in a search path. The default search path is $FNS_SOUNDPATH. But other search paths like $PATH can be used instead with --path.

Example for a file search:

$ fns-find-file alarm.wav
-p | --path OTHER_PATH

Sometimes it is useful to told fns-find-file to search in another search path:

$ fns-find-file --path $PATH gksu
-r | --recursive

Normally fns-find-file searches in the given search path(s). But sometimes it is useful to search recursive:

$ fns-find-file --path $FVWM_USERDIR --recursive 16x16-geany.png
-s | --silent

The silent option is useful if no error output is welcome.

--version

Shows program’s version number and exit.

-h | --help

Shows short help and exit.

AUTHOR

© 2013 - 2016 Thomas Funk <t.funk@web.de>




fns-start-programs

NAME

fns-start-programs - shell script to start applications listed in a file

SYNOPSIS

fns-start-programs [TYPE] [FILE] [-h|--help] [-v|--version]

DESCRIPTION

fns-start-programs is used to start applications listed in a file. It executes them line by line. Before starting the script checks if the application is already running. If so it prints to stderr

[Fvwm-Nightshade][TYPE]: '<app-command>' is already running. Skipping.

else

[Fvwm-Nightshade][TYPE]: '<app-command>' not running. Starting now.

PARAMETERS

Two command line parameter are mandatory:

TYPE (1st one)

Defines the type e.g. "autostart" which will print behind [Fvwm-Nightshade] to show for which service it starts an application.

FILE (2nd one)

The path to a file with the list of applications or commands which wants to execute. The file structure should looks like

skype
xterm -fn 10x20
geany ~/Documents/mytext.txt

Lines are commented out with a #.

OPTIONS

There exist two options also:

-h|--help

Show a short help and exiting.

-v|--version

Show the version and exiting.

AUTHOR

© 2012 - 2016 Thomas Funk <t.funk@web.de>




fns-built-trayapplist

NAME

fns-built-trayapplist - shell script to create application/command list of stalonetray

SYNOPSIS

fns-built-trayapplist [LOGFILE] [APPFILE] [-h|--help] [-v|--version]

DESCRIPTION

fns-built-trayapplist creates a file with the current systemtray applications of stalonetray. This is useful if stalonetray must close, e.g. FvwmButtons which swallows stalonetray has to be restarted. After restarting the apps can be started again with fns-start-programs

PARAMETERS

Two command line parameter are mandatory:

LOGFILE (1st one)

Path of the stalonetray logfile. Stalonetray must started with the parameter --log-level info to create the appropriated information.

APPFILE (2nd one)

Path of the file to write the list of the current running applications which want to be executed after restart of stalonetray.

OPTIONS

There exist two options also:

-h|--help

Show a short help and exiting.

-v|--version

Show the version and exiting.

AUTHOR

© 2012 - 2016 Thomas Funk <t.funk@web.de>




fns-poladd

NAME

fns-poladd - shell script to add or remove programs to/from polkit for gui view.

SYNOPSIS

fns-poladd [-r|--remove] [PROGRAM_NAME] [-l|--verbose] [-h|--help] [-v|--version]

DESCRIPTION

fns-poladd is used to add or remove a program to or from polkit for gui view.

Note This programm needs root rights!

PARAMETERS

PROGRAM_NAME

Add or remove program PROGRAM_NAME to or from policykit.

-r|--remove

remove PROGRAM_NAME from policykit.

-l|--verbose

verbose output. Default is silent.

-h|--help

Show a short help and exiting.

-v|--version

Show the version and exiting.

AUTHOR

© 2014 - 2016 Thomas Funk <t.funk@web.de>




NAME

fns-show-banner - shell script to show a banner while Fvwm-Nightshade’s startup.

SYNOPSIS

fns-show-banner [IMAGE] [TIME] [-h|--help] [-v|--version]

DESCRIPTION

fns-show-banner is used show a banner while startup of Fvwm-Nightshade.

It is based on ImageMagick to support more image formats than FvwmBanner.

PARAMETERS

Two command line parameter are mandatory:

IMAGE (1st one)

The path to the splash image.

TIME (2nd one)

The time how long the image should be shown.

OPTIONS

There are further options, too:

-h|--help

Show a short help and exiting.

-v|--version

Show the version and exiting.

AUTHOR

© 2016 Bernhard Popp <kermit.popp@googlemail.com>




FvwmTransSet

NAME

FvwmTransSet - set true transparency to windows if a composite manager is running.

SYNOPSIS

FvwmTransSet can only be invoked by fvwm. Command line invocation of the FvwmTransSet module will not work.

DESCRIPTION

This module sets the transparency to inactive and opacity to active windows with transset or df-transset if a composite manager like xcompmgr, compton or Cairo Composite manager is running.

INVOCATION

FvwmTransSet can be invoked by inserting the line "Module FvwmTransSet" in the .fvwm2rc file. This should be placed in the StartFunction if FvwmTransSet is to be spawned during fvwm’s initialization.

DestroyFunc StartFunction
AddToFunc StartFunction
+ I Module FvwmTransSet

CONFIGURATION OPTIONS

The following commands are understood by FvwmTransSet:

*FvwmTransSet: Excludes list of WM_CLASS names

On this line one or a comma seperated list of applications or modules with their WM_CLASS names can specified which shall not get transparent.

Example:

*FvwmTransSet: Excludes FvwmButtons, FvwmPager, FvwmIconMan
*FvwmTransSet: Opacity value

Sets the opacity value for the active/focused window and if defined the excluded applications or modules. Default is 1.0.

*FvwmTransSet: Transparency value

Sets the transparency value for all inactive/unfocused windows. Default is 0.7.

*FvwmTransSet: UsedTransset type

Sets the used transset type. Default is transset. Not all transset versions can used. Only those with the -i option. Otherwise transset-df (http://forchheimer.se/transset-df/) should use instead.

DYNAMICAL ACTIONS

A running FvwmTransSet instance may receive some dynamical actions. This is achived using the fvwm command

SendToModule FvwmTransSet <action> <params>

Supported actions:

opac value

Change the opacity for the active/focused window and if defined the excluded applications or modules.

trans value

Change the transparency for all inactive/unfocused windows.

exclude list of WM_CLASS names

Add one or a comma seperated list of applications or modules to the existing exclude list.

stop

Set transparency and opacity to 1.0 and terminate FvwmTransSet.

reset

Resets all FvwmTransSet values to the initials loaded at startup and update all windows.

save

Tells FvwmTransSet to save the current configuration in a file named ".FvwmTransSet" in the users home directory. This same file is read automatically by FvwmTransSet during startup.

BUGS

Bug reports can be sent to fvwmnightshade-workers mailing list at
or submit them under

COPYRIGHTS

FvwmTransSet is based on FvwmPeteTransFocus by Peter Blair.

This program stands under the GPL V2. © 2014 - 2016.

AUTHORS

Thomas Funk <t.funk@web.de>.




FvwmSmartMaximize

NAME

FvwmSmartMaximize - Perl module to smart maximize windows.

SYNOPSIS

FvwmSmartMaximize can only be invoked by fvwm. Command line invocation of the FvwmSmartMaximize module will not work.

DESCRIPTION

This module moves and resizes a current window to the largest free area of the desktop/page. If no place found nothing happens.

INVOCATION

FvwmSmartMaximize can be invoked by inserting the line Module FvwmSmartMaximize in the StartFunction declarations in the .fvwm2rc file.

To call FvwmSmartMaximize it has to be bound to a menu, mouse button, or keystroke.

OPTIONS

Two main options exist needed for calling FvwmSmartMaximize from a menu, mouse button, or keystroke.

All [screen]

All windows on the current page are included in the calculation of the largest free area. If maximized windows are available they will block the smart maximization and nothing will happen.

IgnoreMaxWindows [screen]

All windows on the current page except maximized windows are included in the calculation of the largest free area. This is the preffered option.

For multi display screens there’s an addition to the main options:

[screen]

With this addition FvwmSmartMaximize will only use the current screen for placing. Else the complete display is used.

EXAMPLES

To use FvwmSmartMaximize three parts have to be implemented:

  1. You can copy FvwmSmartMaximize in the lib directory of Fvwm. To get the path type in a terminal

    $ echo $FVWM_MODULEDIR

    Or you can implement your own in your .fvwm2rc file with:

    ModulePath $[FVWM_USERDIR]/lib:+

    Now copy FvwmSmartMaximize into your own module path.

  2. The module initialization in the StartFunction declaration in your .fvwm2rc file:

    DestroyFunc StartFunction
    AddToFunc StartFunction
    + I Module FvwmSmartMaximize
  3. A menu, mouse button, or keystroke binding:

    Mouse 1 4 M SendToModule FvwmSmartMaximize IgnoreMaxWindows screen

    This binds the call to mouse button 1 (left button) + Alt-Key and to the window button 4. So if you hold Alt and click on the window button 4 FvwmSmartMaximize is smart maximizing the active window to the largest free area on the current screen, ignoring maximized windows.

    Key Super_L WTSF N SendToModule FvwmSmartMaximize All

    This binds the call to the left Windows key and smart maximizing the active window to the largest free area on the whole desktop if no maximized window blocks it.

    DestroyMenu MenuWindowMaximize
    AddToMenu   MenuWindowMaximize
    + "Maximize Window" Title
    + "%menu/window-maximize.xpm%Maximize &Smart"   SendToModule FvwmSmartMaximize IgnoreMaxWindows screen

    This creates a menu Maximize Window with an entry Maximize Smart.

BUGS

CAVEATS

If the width/height of the largest free area is smaller than the smallest possible width/height of a program it is only positioning there without resizing.

COPYRIGHTS

This program stands under the GPL V2. © 2014 - 2016.

AUTHORS

Andreas Hoenen <andreas@hoenen-terstappen.de> and Thomas Funk <t.funk@web.de>.