# Module: `menubar.utils`

Utility functions for the menubar module.

### Info:

- Copyright: 2009, 2011-2012 Antonio Terceiro, Alexander Yakushev
- Originally authored by: Antonio Terceiro
  (Full contributors list available on our github project)

## Static module functions

menubar.utils.rtrim (s) -> string | Remove CR newline from the end of the string. |
menubar.utils.lookup_icon_uncached (icon_file) -> string or boolean | Lookup an icon in different folders of the filesystem. |
menubar.utils.lookup_icon (icon) -> () | Lookup an icon in different folders of the filesystem (cached). |
menubar.utils.parse_desktop_file (file) -> () | Parse a .desktop file. |
menubar.utils.parse_dir (dir_path, callback) | Parse a directory with .desktop files recursively. |

## Fields

menubar.utils.terminal | string | Terminal which applications that need terminal would open in. |
menubar.utils.wm_name | string | Name of the WM for the OnlyShowIn entry in the .desktop file. |

## Static module functions

🔗 menubar.utils.rtrim (s) -> string
  Remove CR newline from the end of the string.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  s |  | string | The string to trim

  ### Returns:

  string The trimmed string.
🔗 menubar.utils.lookup_icon_uncached (icon_file) -> string or boolean
  Lookup an icon in different folders of the filesystem.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  icon_file |  | string | Short or full name of the icon.

  ### Returns:

  string or boolean Full name of the icon, or false on failure.
🔗 menubar.utils.lookup_icon (icon) -> ()
  Lookup an icon in different folders of the filesystem (cached).

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  icon |  |  | Short or full name of the icon.

  ### Returns:

  full name of the icon.
🔗 menubar.utils.parse_desktop_file (file) -> ()
  Parse a .desktop file.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  file |  |  | The .desktop file.

  ### Returns:

  A table with file entries.
🔗 menubar.utils.parse_dir (dir_path, callback)
  Parse a directory with .desktop files recursively.

  ### Parameters:

  Name |  | Type(s) | Description
  --- | --- | --- | ---
  dir_path |  | string | The directory path.
  callback |  | table | 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.

## Fields

🔗 menubar.utils.terminal string
  Terminal which applications that need terminal would open in.
🔗 menubar.utils.wm_name string
  Name of the WM for the OnlyShowIn entry in the .desktop file.

generated by LDoc 1.5.0