Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| panel-plugins:xfce4-genmon-plugin:start [2023/04/19 15:31] – [Usage] toz | panel-plugins:xfce4-genmon-plugin:start [2025/01/03 04:17] (current) – update screenshot kevinbowen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| - | ====== xfce4-genmon-plugin - Genmon | + | ====== xfce4-genmon-plugin - Generic Monitor Plugin |
| This plugin cyclically spawns the indicated script/ | This plugin cyclically spawns the indicated script/ | ||
| The string can also contain markup to displayed an formatted text, image/icon, a bar, a button, and a personalized tooltip. | The string can also contain markup to displayed an formatted text, image/icon, a bar, a button, and a personalized tooltip. | ||
| - | * **[[# | ||
| - | * **[[# | ||
| * **[[# | * **[[# | ||
| + | * **[[# | ||
| + | * XML Tags | ||
| + | * Example Script | ||
| + | * **[[# | ||
| + | * Pango Text Markup Support | ||
| + | * Refreshing the plugin | ||
| + | * Enhanced Gtk3 CSS Styling Capabilities | ||
| * **[[#Latest Release|Latest Release]]** | * **[[#Latest Release|Latest Release]]** | ||
| * **[[#Source Code Repository|Source Code Repository]]** | * **[[#Source Code Repository|Source Code Repository]]** | ||
| Line 14: | Line 19: | ||
| ===== Important Note about version 4.2.0 ===== | ===== Important Note about version 4.2.0 ===== | ||
| + | |||
| <note important> | <note important> | ||
| + | |||
| + | |||
| + | ===== Screenshots ===== | ||
| + | |||
| + | <figure " | ||
| + | {{: | ||
| + | </ | ||
| + | |||
| + | [[|Back To Top]] | ||
| + | ---- | ||
| ===== Usage ===== | ===== Usage ===== | ||
| + | |||
| + | |||
| + | - [[: | ||
| + | - Right-click on the added plugin, select **Properties** to open the settings window. | ||
| + | |||
| If you want the plugin to display only text (original version), enter the command in the //Command// field of the // | If you want the plugin to display only text (original version), enter the command in the //Command// field of the // | ||
| Line 27: | Line 48: | ||
| * Displays the "Text to display" | * Displays the "Text to display" | ||
| * eg. '' | * eg. '' | ||
| - | * Result: {{: | + | * Result: |
| * **< | * **< | ||
| * If displaying text, this tag will allow for a program/ | * If displaying text, this tag will allow for a program/ | ||
| Line 34: | Line 55: | ||
| * Display an image on the plugin using the complete path and name to the image file. | * Display an image on the plugin using the complete path and name to the image file. | ||
| * eg. '' | * eg. '' | ||
| - | * Result: {{: | + | * Result: |
| * **< | * **< | ||
| * If using an image, this tag will allow for a program/ | * If using an image, this tag will allow for a program/ | ||
| Line 41: | Line 62: | ||
| * Display an icon from the current icon theme using only the icon name. | * Display an icon from the current icon theme using only the icon name. | ||
| * eg. '' | * eg. '' | ||
| - | * Result: {{: | + | * Result: |
| * Note: the < | * Note: the < | ||
| * image changes with the icon theme | * image changes with the icon theme | ||
| - | * supports panel' | + | * supports panel' |
| * supports light/dark symbolic icon auto-colour changes | * supports light/dark symbolic icon auto-colour changes | ||
| * **< | * **< | ||
| Line 52: | Line 73: | ||
| * Display specific content in a tooltip. | * Display specific content in a tooltip. | ||
| * eg. '' | * eg. '' | ||
| - | * Result: {{: | + | * Result: |
| * Note: | * Note: | ||
| * To hide the tooltip bubble, use an empty tool tag, eg: '' | * To hide the tooltip bubble, use an empty tool tag, eg: '' | ||
| + | * The tooltip will not display with a cycle of less than 0.5 (see: [[https:// | ||
| * **< | * **< | ||
| * Display a value-based progress bar on the plugin. | * Display a value-based progress bar on the plugin. | ||
| * eg. '' | * eg. '' | ||
| - | * Result: {{: | + | * Result: |
| * **< | * **< | ||
| * This tag will allow the embedding of css tweaks directly into the plugin. | * This tag will allow the embedding of css tweaks directly into the plugin. | ||
| - | * eg. '' | + | * eg. '' |
| - | * Result: {{: | + | * Result: |
| * More information on css and css tweaking of the plugin in the **Advanced Features** section below. | * More information on css and css tweaking of the plugin in the **Advanced Features** section below. | ||
| If None of the tags are detected in the result of the command, the plugin reverts to its original behavior (displaying the result of the command). | If None of the tags are detected in the result of the command, the plugin reverts to its original behavior (displaying the result of the command). | ||
| - | **Example Script (cpu temperature)** | + | **Example Script (system stats)** |
| - | Here's a simple | + | Here is an example of a genmon |
| - | (with an icon) and the Freq in a Tooltip: | + | <file sh systemstats.sh> |
| - | <file sh cuptemp.sh> | + | #!/bin/sh |
| - | # | + | |
| - | echo "< | + | |
| - | declare -i cpuFreq | + | |
| - | cpuFreq=$(cat / | + | |
| - | if [ $cpuFreq -ge 1000 ] | + | |
| - | then | + | |
| - | cpu=$(echo $cpuFreq | cut -c1).$(echo $cpuFreq | cut -c2)GHz | + | |
| - | else | + | |
| - | cpu=${cpuFreq}MHz | + | |
| - | fi | + | |
| - | echo "<txt>"$(cat / | + | |
| - | echo "< | + | |
| - | </file> | + | |
| - | PS: Depending on your configuration, | + | ICON=utilities-system-monitor |
| + | PARTITION=sda2 | ||
| - | **Another Example Script | + | # get CPU info |
| + | CPU=$(cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS="" | ||
| + | CPULOAD=$(uptime | tr -s " " | cut -d' ' -f9-) | ||
| + | TOPCPU=$(ps aux --no-headers | awk ' | ||
| - | Here's a another simple example of a plugin displaying the keyboard LED states of the caps, num and scroll lock keys: | + | # get memory info |
| - | <file sh kbdleds.sh> | + | MEMTOT=$(cat / |
| - | #!/bin/bash | + | MEMAVA=$(cat / |
| - | # genmon script to display status of keyboard LEDS | + | MEMUSAGE=$(free | grep Mem | awk ' |
| - | # genmon properties: | + | MEMUSAGE2=$(echo " |
| - | # | + | MEMUSED=$(echo " |
| - | # Label = optional Label preceeding output | + | TOPMEM=$(ps aux --no-headers | awk ' |
| - | # | + | |
| - | # | + | # get hard drive usage info |
| + | HD=$(df -hl / | ||
| + | HDUSED=$(df -hl / | ||
| + | HDSIZE=$(df -hl / | ||
| + | TOPHD=$(df -hl / | ||
| - | # configuration | + | # do the genmon |
| - | FG="white" | + | echo "< |
| - | OBC="red" | + | echo "<txt> $CPU | $MEMUSAGE | $HD </ |
| + | echo "< | ||
| + | $TOPCPU | ||
| - | # code | + | -=MEM: $MEMUSED of $MEMUSAGE2=- |
| - | STATE=($(xset q | grep Caps\ Lock | awk ' | + | $TOPMEM |
| - | CAPS=$([[ ${STATE[0]} == " | + | |
| - | NUM=$([[ ${STATE[1]} == " | + | |
| - | SCROLL=$([[ ${STATE[2]} == " | + | |
| - | # genmon | + | -=HD usage: |
| - | echo "< | + | $TOPHD</ |
| - | echo "< | + | |
| - | echo "NUM = ${STATE[1]}" | + | |
| - | echo " | + | |
| exit 0 | exit 0 | ||
| </ | </ | ||
| + | |||
| + | <figure " | ||
| + | {{: | ||
| + | </ | ||
| < | < | ||
| + | |||
| + | Additional genmon scripts can be found in the following online repositories (special thanks to the individual developers for creating them): | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| [[|Back To Top]] | [[|Back To Top]] | ||
| Line 127: | Line 151: | ||
| **Pango Text Markup Support** | **Pango Text Markup Support** | ||
| - | Both the <txt> and < | + | Both the <txt> and < |
| + | |||
| + | echo "< | ||
| + | |||
| + | Result: | ||
| - | echo "<txt><span weight=' | + | <figure " |
| + | {{: | ||
| + | </figure> | ||
| Refer to the previous link for information on all of the properties that can be set. | Refer to the previous link for information on all of the properties that can be set. | ||
| Line 135: | Line 165: | ||
| **Refreshing the plugin** | **Refreshing the plugin** | ||
| - | The xfce4-genmon-plugin supports xfce4-panel plugin-event functionality to remotely force the plugin to refresh. To refresh the plugin, issue the command: | + | As of version 3.99, the xfce4-genmon-plugin supports xfce4-panel plugin-event functionality to remotely force the plugin to refresh. To refresh the plugin, issue the command: |
| xfce4-panel --plugin-event=genmon-X: | xfce4-panel --plugin-event=genmon-X: | ||
| where " | where " | ||
| - | As of version 4.2.0, | + | As of version 4.2.0, an " |
| + | |||
| + | <figure " | ||
| + | {{: | ||
| + | </ | ||
| **Enhanced Gtk3 CSS Styling Capabilities** | **Enhanced Gtk3 CSS Styling Capabilities** | ||
| - | CSS styling capabilities have been enhanced by providing style classes for all elements of the plugin that can be styled via themes or individual overrides (~/ | + | As of version 4.0.1, |
| - | As of version 4.2.0, this plugin also supports CSS tags (special thanks to @stergem) that allow you to tweak the plugin css directly from within the command/ | + | And as of version 4.2.0, this plugin also supports CSS tags (special thanks to @stergem) that allow you to tweak the plugin css directly from within the command/ |
| <file genmonTest.sh> | <file genmonTest.sh> | ||
| #!/bin/bash | #!/bin/bash | ||
| - | echo "< | + | # set Label = Hello |
| + | echo "< | ||
| echo "< | echo "< | ||
| echo "< | echo "< | ||
| echo "< | echo "< | ||
| </ | </ | ||
| + | |||
| + | Result: \\ {{: | ||
| Line 159: | Line 196: | ||
| ---- | ---- | ||
| - | ===== Screenshots | + | ===== Latest Release |
| - | {{: | + | |
| - | In ^this^ example, the plugin is used to (from left to right): | + | {{rss> |
| - | - display the date | + | |
| - | - mount/unmount an USB disk with 1 click | + | |
| - | | + | |
| - | | + | |
| - | - display the state of the 2 batteries of my laptop | + | |
| - | - display the WIFI quality | + | |
| + | [[https:// | ||
| + | * **[[https:// | ||
| - | {{: | + | [[|Back to Top]] |
| - | + | ||
| - | In ^this^ example, we see the gmail checker script in action: | + | |
| - | - plugin display shows icon indicating state of new emails available | + | |
| - | - tooltip shows number of new messages, sender/ | + | |
| - | - clicking on the icon launches your email program | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | {{: | + | |
| - | + | ||
| - | In ^this^ example, we see the sysstat script in action: | + | |
| - | - plugin display shows optional icon and 3 readings (cpu, memory, hard drive usage) | + | |
| - | - tooltip shows top 5 cpu and memory uses and hard drive space usage | + | |
| - | - clicking on the text output launches xfce4-taskmanager (//ver. 3.99 or greater// | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | {{: | + | |
| - | + | ||
| - | In ^this^ example, we see the google calendar checker script in action: | + | |
| - | - plugin display shows icon indicating state of new upcoming appointments | + | |
| - | - tooltip shows a listing of upcoming appointments | + | |
| - | - clicking on the icon opens google calendar in your browser | + | |
| + | ---- | ||
| + | ===== Source code repository ===== | ||
| - | Most of the scripts are available in the plugin archive. | + | [[https:// |
| - | [[|Back To Top]] | ||
| ---- | ---- | ||
| - | ===== Latest Release | + | ===== Reporting Bugs ===== |
| - | {{rss> | + | |
| - | | + | * **[[: |
| - | + | ||
| - | [[|Back to Top]] | + | |
| - | + | ||
| - | ---- | + | |
| - | ===== Source code repository ===== | + | |
| - | [[https:// | + | |
| - | ---- | + | |
| - | ===== Reporting Bugs ===== | + | |
| - | | + | |
| [[|Back To Top]] | [[|Back To Top]] | ||
| ---- | ---- | ||
| - | [[ : | + | [[: |