Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
panel-plugins:xfce4-genmon-plugin [2020/04/12 02:19] – [Usage] tozpanel-plugins:xfce4-genmon-plugin [2021/01/13 07:09] – added rss feed for latest release kevinbowen
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-====== Genmon ======+====== xfce4-genmon-plugin - Genmon ======
 This plugin cyclically spawns the indicated script/program, captures its output (stdout) and displays the resulting string into the panel. This plugin cyclically spawns the indicated script/program, captures its output (stdout) and displays the resulting string into the panel.
  
Line 25: Line 25:
   * ''<click>The command to be executed when clicking on the image</click>''   * ''<click>The command to be executed when clicking on the image</click>''
   * ''<txtclick>The command to be executed when clicking on the text</txtclick>''   * ''<txtclick>The command to be executed when clicking on the text</txtclick>''
 +  * ''<icon>Themed icon to be displayed</icon>''
 +  * ''<iconclick>The command to be executed when clicking on the icon</click>''
 +
 +The <icon> tag allows the following functionality:
 +  * image changes with the icon theme
 +  * supports panel's Adjust Icon Size Automatically functionality
 +  * supports light/dark symbolic icon auto-colour changes
  
 If None of the tags are detected in the result of the command, the plugin returns to its original behaviour (displaying the result of the command). If None of the tags are detected in the result of the command, the plugin returns to its original behaviour (displaying the result of the command).
  
-**Example Script**+**Example Script (cpu temperature)**
  
 Here's a simple example of a plugin displaying the Temp of the CPU in the panel Here's a simple example of a plugin displaying the Temp of the CPU in the panel
 (with an icon) and the Freq in a Tooltip: (with an icon) and the Freq in a Tooltip:
- +<file sh cuptemp.sh> 
-  #!/bin/bash +#!/bin/bash 
-  echo "<img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>" +echo "<img>/usr/share/icons/Bluecurve/16x16/apps/gnome-monitor.png</img>" 
-  declare -i cpuFreq +declare -i cpuFreq 
-  cpuFreq=$(cat /proc/cpuinfo | grep "cpu MHz" | sed 's/\ \ */ /g' | cut -f3 -d" " | cut -f1 -d"."+cpuFreq=$(cat /proc/cpuinfo | grep "cpu MHz" | sed 's/\ \ */ /g' | cut -f3 -d" " | cut -f1 -d"."
-  if [ $cpuFreq -ge 1000 ] +if [ $cpuFreq -ge 1000 ] 
-  then +then 
-    cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz +  cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz 
-  else +else 
-    cpu=${cpuFreq}MHz +  cpu=${cpuFreq}MHz 
-  fi +fi 
-  echo "<txt>"$(cat /proc/acpi/thermal_zone/THM/temperature | sed 's/\ \ */ /g' | cut -f2 -d" ")" C</txt>" +echo "<txt>"$(cat /proc/acpi/thermal_zone/THM/temperature | sed 's/\ \ */ /g' | cut -f2 -d" ")" C</txt>" 
-  echo "<tool>Freq: "$cpu"</tool>"+echo "<tool>Freq: "$cpu"</tool>" 
 +</file>
  
 PS: Depending on your configuration, you should change the image path. PS: Depending on your configuration, you should change the image path.
 +
 +**Another Example Script (keyboard leds)**
 +
 +Here's a another simple example of a plugin displaying the keyboard LED states of the caps, num and scroll lock keys:
 +<file sh kbdleds.sh>
 +#!/bin/bash
 +# genmon script to display status of keyboard LEDS
 +# genmon properties:
 +#   Command = path to this script
 +#   Label = optional Label preceeding output
 +#   Period = how often to check the status - the lower the number the quicker the response
 +#   Font = the font to use - monospace fonts keep the widget from resizing
 +
 +# configuration
 +FG="white" # foreground colour
 +OBC="red" # background colour of cell text if active
 +
 +# code
 +STATE=($(xset q | grep Caps\ Lock | awk '{print $4" "$8" "$12}'))
 +CAPS=$([[ ${STATE[0]} == "on" ]] && echo "<span foreground='$FG' background='$OBC'>C</span>" || echo "<span foreground='$FG'>c</span>")
 +NUM=$([[ ${STATE[1]} == "on" ]] && echo "<span foreground='$FG' background='$OBC'>N</span>" || echo "<span foreground='$FG'>n</span>")
 +SCROLL=$([[ ${STATE[2]} == "on" ]] && echo "<span foreground='$FG' background='$OBC'>S</span>" || echo "<span foreground='$FG'>s</span>"   
 +
 +# genmon    
 +echo "<txt>$CAPS$NUM$SCROLL</txt>"
 +echo "<tool>CAPS = ${STATE[0]}"
 +echo "NUM = ${STATE[1]}"
 +echo "SCROLL = ${STATE[2]}</tool>"
 +
 +exit 0
 +</file>
  
 More scripts are available at: [[http://git.xfce.org/panel-plugins/xfce4-genmon-plugin/tree/scripts]]. More scripts are available at: [[http://git.xfce.org/panel-plugins/xfce4-genmon-plugin/tree/scripts]].
Line 52: Line 91:
 **Pango Markups in the <txt> tag** **Pango Markups in the <txt> tag**
  
-Both the <txt> and <tool> tags support Pango Markups. See: [[https://developer.gnome.org/pango/stable/PangoMarkupFormat.html]]. With Pango markups, you can change text attributes like font colour, weight, size, etc, in your output string. To do so, use the <span></span> tag within the <txt></txt> or <tool></tool> tags. For example, to display the output in bold red, you could use something like:+Both the <txt> and <tool> tags support Pango Markups. See: [[https://developer.gnome.org/pygtk/stable/pango-markup-language.html]]. With Pango markups, you can change text attributes like font colour, weight, size, etc, in your output string. To do so, use the <span></span> tag within the <txt></txt> or <tool></tool> tags. For example, to display the output in bold red, you could use something like:
  
   echo "<txt><span weight='Bold' fgcolor='Red'>Test</span></txt>"   echo "<txt><span weight='Bold' fgcolor='Red'>Test</span></txt>"
Line 73: Line 112:
  
 //**(*dev-only)**// functionality is currently only available in the git tree and has not yet been officially released //**(*dev-only)**// functionality is currently only available in the git tree and has not yet been officially released
-  * Configuration window layout was slightly updated 
-  * Close button was renamed to Save. Clicking Save now saves the configuration changes. Closing the window using the X in the window titlebar exists the configuration dialog with no changes made 
-  * Added support for the new libxfce4ui API (CSD) 
-  * Enabled panel multi-row support. If panel exceeds 1 row, the plugin will only occupy one row. 
-  * Added <icon> and <iconclick> elements. They operate in the same manner as <img> and <click> but use an icon from the icon theme instead of an image. (ex. echo "<icon>gtk-edit</icon>"). This adds the new following functionality: 
-  *   * image changes with the icon theme 
-  *   * supports panel's Adjust Icon Size Automatically functionality 
-  *   * supports light/dark symbolic icon auto-colour changes 
  
  
Line 141: Line 172:
  
 ===== Latest Release ===== ===== Latest Release =====
-==== 4.0.2 (2019/08/11) ==== +{{rss>https://archive.xfce.org/feeds/project/xfce4-genmon-plugin 1 date description 2h}}
-[[http://archive.xfce.org/src/panel-plugins/xfce4-genmon-plugin/4.0/xfce4-genmon-plugin-4.0.2.tar.bz2|xfce4-genmon-plugin-4.0.2.tar.bz2]]+
  
-**SHA-256 Hash**: 256c22526f61aabf43b91b903b976c13e56198657667df443cdb06b31fbf23aa \\ +  * **[[https://archive.xfce.org/src/panel-plugins/xfce4-genmon-plugin/|Previous Releases]]**
-**SHA-1 Hash**: cffc57ae3bce3ac0b3d5a6a055ef533907bb398c \\ +
-**MD5 Hash**: d808fe77a438c95b97ec6feda6162d22+
  
----- +[[|Back to Top]]
-===== Release History ===== +
-==== 4.0.1 (2017/10/29) ==== +
-  * Allow pango markup in tooltip as well +
-  * Added some extra sample scripts (twit, google calendar, sysstat) +
-  * Enhanced CSS styling capabilites (see 'CSS Styling.txt' doc) +
-  * Fix progressbar wrong direction +
- +
-==== 4.0.0 (2017/02/25) ==== +
-  * Fix PangoFontDescription not being able to display initial default string +
- +
-==== 3.99 (2016/11/02) ==== +
-  * Port to Gtk3 +
-  * Fix font styling to work with Gtk 3.22 +
-  * Add support for "genmon" in 'xfce4-panel --plugin-event' (Bug #10734) +
-  * Fix default tooltip does not work (bug #11284) +
-  * Add <txtclick> functionality (Bug #3437) +
- +
-==== 3.4 (2012/05/12) ==== +
-  * Port from libxfcegui4 to libxfce4ui +
-  * Install as a shared library rather than an executable +
-  * No longer uses troublesome fixed-length text buffers +
-  * Bug fixes +
- +
-===== Recent Changes ===== +
-{{rss>http://git.xfce.org/panel-plugins/xfce4-genmon-plugin/atom/ 5 date}} +
- +
-===== Getting it ===== +
-The normal (and best) way to get this plugin is to use the package manager or port system of your operating system. +
- +
-If it isn't available there, or if you want a different version, you can download it in source form from [[http://archive.xfce.org/src/panel-plugins/xfce4-genmon-plugin/]].+
  
 ---- ----
 ===== Source code repository ===== ===== Source code repository =====
-[[http://git.xfce.org/panel-plugins/xfce4-genmon-plugin/]]+[[https://gitlab.xfce.org/panel-plugins/xfce4-genmon-plugin]]
 ---- ----
 ===== Reporting Bugs ===== ===== Reporting Bugs =====
-If you encounter a bug in ''Genmon'', please submit a bug report to the [[https://bugzilla.xfce.org/|Xfce Bugzilla]]. Please note that to do this you will need to have / create an account on Bugzilla. +  * **[[:panel-plugins:xfce4-genmon-plugin:bugs|Reporting Bugs]]** -- Open bug reports and how to report new bugs
- +
-<note important>Before reporting a new bug, please try your best to check if it has already been reported (see the latest reports below). [[https://bugzilla.xfce.org/buglist.cgi?list_id=14522&product=xfce4-genmon-plugin&resolution=---|Click here for a full list of bug reports]].</note>  +
- +
-**[[http://bugzilla.xfce.org/enter_bug.cgi?product=xfce4-genmon-plugin|File a new bug or enhancement request]]** +
- +
-==== Open Bugs ==== +
-{{rss>https://bugzilla.xfce.org/buglist.cgi?product=xfce4-genmon-plugin;query_format=advanced;ctype=atom 20 1d date}}+
  
 [[|Back To Top]] [[|Back To Top]]
 ---- ----
 [[ :xfce:xfce4-panel:start:|Return to Main Xfce4-panel page]] [[ :xfce:xfce4-panel:start:|Return to Main Xfce4-panel page]]