Module menubar.utils

Utility module for menubar

Info:

  • Copyright: 2009, 2011-2012 Antonio Terceiro, Alexander Yakushev
  • Author: Antonio Terceiro

Functions

rtrim (s) Remove CR newline from the end of the string.
unescape (s) Unescape strings read from desktop files.
parse_list (s) Separate semi-colon separated lists.
lookup_icon_uncached (icon_file) Lookup an icon in different folders of the filesystem.
lookup_icon (icon) Lookup an icon in different folders of the filesystem (cached).
parse_desktop_file (file) Parse a .desktop file.
parse_dir (dir_path, callback) Parse a directory with .desktop files recursively.
compute_text_width (text, s) Compute text width.

Fields

terminal Terminal which applications that need terminal would open in.
wm_name Name of the WM for the OnlyShownIn entry in the .desktop file.


Functions

Methods
rtrim (s)
Remove CR newline from the end of the string.
  • s string to trim
unescape (s)
Unescape strings read from desktop files. Possible sequences are \n, \r, \s, \t, \, which have the usual meanings.

Returns:

    string The unescaped string
parse_list (s)
Separate semi-colon separated lists. Semi-colons in lists are escaped as ‘\;’.

Returns:

    table A table containing the separated strings. Each element is unescaped by utils.unescape().
lookup_icon_uncached (icon_file)
Lookup an icon in different folders of the filesystem.
  • icon_file string Short or full name of the icon.

Returns:

    string or boolean Full name of the icon, or false on failure.
lookup_icon (icon)
Lookup an icon in different folders of the filesystem (cached).
  • icon Short or full name of the icon.

Returns:

    full name of the icon.
parse_desktop_file (file)
Parse a .desktop file.
  • file The .desktop file.

Returns:

    A table with file entries.
parse_dir (dir_path, callback)
Parse a directory with .desktop files recursively.
  • dir_path string The directory path.
  • callback Will be fired when all the files were parsed with the resulting list of menu entries as argument.
    • programs table Paths of found .desktop files.
compute_text_width (text, s)
Compute text width.
  • text str Text.
  • s number or screen Screen

Returns:

    int Text width.

Fields

terminal
Terminal which applications that need terminal would open in.
wm_name
Name of the WM for the OnlyShownIn entry in the .desktop file.
generated by LDoc 1.4.6 Last updated 2017-10-14 16:34:30