sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 1771eed85a7b3bc1e518d8307f64c4481b455128
parent 0eef8d701b98d8aa37206a34b25fe89e22948f64
Author: Aaron Marcher <me@drkhsh.at>
Date:   Fri, 18 May 2018 11:09:53 +0200

Move scripts to status section

Diffstat:
dwm.suckless.org/scripts/basic_collection/index.md | 9---------
dwm.suckless.org/scripts/email_notifier_script/index.md | 62--------------------------------------------------------------
dwm.suckless.org/scripts/simple_monitors/index.md | 46----------------------------------------------
dwm.suckless.org/status/scripts/basic_collection/index.md | 9+++++++++
dwm.suckless.org/status/scripts/email_notifier_script/index.md | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dwm.suckless.org/status/scripts/simple_monitors/index.md | 46++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/dwm.suckless.org/scripts/basic_collection/index.md b/dwm.suckless.org/scripts/basic_collection/index.md @@ -1,9 +0,0 @@ -Scripts collection -================== - -Description ------------ - -A basic collection of simple, fully POSIX sh compliant scripts to get various -system information among other useful things can be found at kl3's [scripts](https://notabug.org/kl3/scripts) -repository. Feel free to copy, adapt and/or improve them. diff --git a/dwm.suckless.org/scripts/email_notifier_script/index.md b/dwm.suckless.org/scripts/email_notifier_script/index.md @@ -1,62 +0,0 @@ -email notifier script -===================== - -Description ------------ - -This init script is based on some ideas taken from the dwm ML. It adds email -notification using `fetchmail`. It also adds the functionality of showing the -content of the file `$HOME/.message` when it exists. This can be used for -displaying info by other programs writing to this file. - -When a new email arrives a flashing text message is shown on the dwm's -status bar. - -Config .fetchmailrc -------------------- -This config works with GMail over IMAP with the IDLE extension for low bandwidth usage: - - poll imap.gmail.com port 993 proto IMAP user "<your_user>@gmail.com" - there with password "<your_pass>" keep ssl idle - -Init script ------------ - -The notification is flashing during 60 seconds, then it is removed. Lines -written to `.message` are displayed during a second in the status bar. If -`.message` is deleted, the normal status message (date and uptime) returns. - -A pipe must be used with `fetchmail` when using IDLE extension because this way -it waits for updates from the inbox not doing polling. -If the `.message` file exists with some content, it is preserved and no email -notification is shown. - - fetchmail --check 2>/dev/null | while read line; do - new=`echo $line | sed 's/(//' | awk '{print $1-$3}'` - if [ $new != 0 ] && [ ! -e ~/.message ]; then - echo "New mail($new)" > ~/.message - echo "!!! !!! !!!" >> ~/.message - sleep 60 - if grep '^New mail' ~/.message >/dev/null 2>/dev/null; then - rm -f ~/.message - fi - fi - done & - while true; do - if [ -r ~/.message ]; then - while read line; do - xsetroot -name "$line" - sleep 1 - done < ~/.message - else - xsetroot -name "`date` `uptime | sed 's/.*,//'`" - sleep 1 - fi - done & - exec dwm - rm -f ~/.message - -Author ------- - -- Ricardo Catalinas Jiménez <[jimenezrick@gmail.com](mailto:jimenezrick@gmail.com)> diff --git a/dwm.suckless.org/scripts/simple_monitors/index.md b/dwm.suckless.org/scripts/simple_monitors/index.md @@ -1,46 +0,0 @@ -Simple Monitors -=== - -Description ---- - -These are just very simple monitors for the dwm status bar. - -Battery ---- - -Your battery may be called something different, so check /proc/acpi for its name. Also, change 89000 to whatever the capacity is for your battery. -This returns the remaining battery power as a percentage. - - $(echo $(awk '/rem/ { print $3/89000 }' /proc/acpi/battery/BAT0/state| hoc| cut -c3,4)% - -hoc comes from plan9port or 9base. - -Depending on your system, you can also use - - cat /sys/class/power_supply/BAT0/capacity - -to get your battery status in percentage. - -Ram used ---- - -Return the amount of ram used, in megabytes. - - $(free -m |awk '/cache:/ { print $3"M" }') - -Temperature ---- - -Returns the temperature of the cpu, in celcius. - - $(awk '{ print $2 }' /proc/acpi/thermal_zone/THM0/temperature)C - -Volume ---- - - amixer get Front | tail -n1 | awk '{ print $5 }' | tr -d [] - -Change "Front" to your audio device - -I told you they were simple. diff --git a/dwm.suckless.org/status/scripts/basic_collection/index.md b/dwm.suckless.org/status/scripts/basic_collection/index.md @@ -0,0 +1,9 @@ +Scripts collection +================== + +Description +----------- + +A basic collection of simple, fully POSIX sh compliant scripts to get various +system information among other useful things can be found at kl3's [scripts](https://notabug.org/kl3/scripts) +repository. Feel free to copy, adapt and/or improve them. diff --git a/dwm.suckless.org/status/scripts/email_notifier_script/index.md b/dwm.suckless.org/status/scripts/email_notifier_script/index.md @@ -0,0 +1,62 @@ +email notifier script +===================== + +Description +----------- + +This init script is based on some ideas taken from the dwm ML. It adds email +notification using `fetchmail`. It also adds the functionality of showing the +content of the file `$HOME/.message` when it exists. This can be used for +displaying info by other programs writing to this file. + +When a new email arrives a flashing text message is shown on the dwm's +status bar. + +Config .fetchmailrc +------------------- +This config works with GMail over IMAP with the IDLE extension for low bandwidth usage: + + poll imap.gmail.com port 993 proto IMAP user "<your_user>@gmail.com" + there with password "<your_pass>" keep ssl idle + +Init script +----------- + +The notification is flashing during 60 seconds, then it is removed. Lines +written to `.message` are displayed during a second in the status bar. If +`.message` is deleted, the normal status message (date and uptime) returns. + +A pipe must be used with `fetchmail` when using IDLE extension because this way +it waits for updates from the inbox not doing polling. +If the `.message` file exists with some content, it is preserved and no email +notification is shown. + + fetchmail --check 2>/dev/null | while read line; do + new=`echo $line | sed 's/(//' | awk '{print $1-$3}'` + if [ $new != 0 ] && [ ! -e ~/.message ]; then + echo "New mail($new)" > ~/.message + echo "!!! !!! !!!" >> ~/.message + sleep 60 + if grep '^New mail' ~/.message >/dev/null 2>/dev/null; then + rm -f ~/.message + fi + fi + done & + while true; do + if [ -r ~/.message ]; then + while read line; do + xsetroot -name "$line" + sleep 1 + done < ~/.message + else + xsetroot -name "`date` `uptime | sed 's/.*,//'`" + sleep 1 + fi + done & + exec dwm + rm -f ~/.message + +Author +------ + +- Ricardo Catalinas Jiménez <[jimenezrick@gmail.com](mailto:jimenezrick@gmail.com)> diff --git a/dwm.suckless.org/status/scripts/simple_monitors/index.md b/dwm.suckless.org/status/scripts/simple_monitors/index.md @@ -0,0 +1,46 @@ +Simple Monitors +=== + +Description +--- + +These are just very simple monitors for the dwm status bar. + +Battery +--- + +Your battery may be called something different, so check /proc/acpi for its name. Also, change 89000 to whatever the capacity is for your battery. +This returns the remaining battery power as a percentage. + + $(echo $(awk '/rem/ { print $3/89000 }' /proc/acpi/battery/BAT0/state| hoc| cut -c3,4)% + +hoc comes from plan9port or 9base. + +Depending on your system, you can also use + + cat /sys/class/power_supply/BAT0/capacity + +to get your battery status in percentage. + +Ram used +--- + +Return the amount of ram used, in megabytes. + + $(free -m |awk '/cache:/ { print $3"M" }') + +Temperature +--- + +Returns the temperature of the cpu, in celcius. + + $(awk '{ print $2 }' /proc/acpi/thermal_zone/THM0/temperature)C + +Volume +--- + + amixer get Front | tail -n1 | awk '{ print $5 }' | tr -d [] + +Change "Front" to your audio device + +I told you they were simple.