diff --git a/bin/wifi-quality b/bin/wifi-quality new file mode 100755 index 00000000..9cc6bae9 --- /dev/null +++ b/bin/wifi-quality @@ -0,0 +1,25 @@ +#!/bin/sh -e +# +# wifi-quality: display wifi signal quality +# Copyright (C) 2008 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Default is "off" +p="wifi-quality" +grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0 + +interface=`route -n | tail -n 1 | sed "s/^.* //"` +iwconfig "$interface" 2>/dev/null | grep "Link Quality=" | sed "s/^.*Link Quality=//" | sed "s/ .*$//g" | awk '{printf "\005{=b Ck}%.0f\005{-}\005{= Ck}%%)))\005{-} ", $1}' || exit 0 diff --git a/debian/changelog b/debian/changelog index 8a08865b..950b6caa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ screen-profiles (1.43) unreleased; urgency=low * bin/logo: allow users to define their own logo * bin/processes: displace a count of the running processes * bin/network-down, bin/network-up: added network transmit status + * bin/wifi-quality: show wireless signal quality * bin/*, profiles/profile.skel: make all status scripts handle their own colors and trailing whitespace; this should help alleviate the 16-color-change limitation on un-patched screens; it also simplifies @@ -20,7 +21,7 @@ screen-profiles (1.43) unreleased; urgency=low added new status items for battery state, number of users, and system uptime - -- Dustin Kirkland Sat, 04 Apr 2009 22:44:27 -0700 + -- Dustin Kirkland Mon, 06 Apr 2009 13:52:30 -0700 screen-profiles (1.42-0ubuntu1) jaunty; urgency=low diff --git a/debian/install b/debian/install index 5af3cf92..4f797837 100644 --- a/debian/install +++ b/debian/install @@ -11,6 +11,7 @@ windows/common usr/share/screen-profiles/windows screen usr/bin select-screen-profile usr/bin screen-profiles usr/bin +screen-profiles-status usr/bin screen-launcher-install usr/share/screen-profiles screen-launcher-uninstall usr/share/screen-profiles motd+shell usr/bin diff --git a/po/es.po b/po/es.po index 9771da7e..773f2b0b 100644 --- a/po/es.po +++ b/po/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 11:09-0700\n" +"POT-Creation-Date: 2009-04-06 13:50-0700\n" "PO-Revision-Date: 2008-12-22 01:01-0500\n" "Last-Translator: Nicolas Valcarcel \n" "Language-Team: LANGUAGE \n" diff --git a/po/fr.po b/po/fr.po index e4461ef0..907a1eb7 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 11:09-0700\n" +"POT-Creation-Date: 2009-04-06 13:50-0700\n" "PO-Revision-Date: 2008-12-17 23:42+0100\n" "Last-Translator: Nicolas Barcet \n" "Language-Team: LANGUAGE \n" diff --git a/po/screen-profiles.pot b/po/screen-profiles.pot index ad4da472..f8524508 100644 --- a/po/screen-profiles.pot +++ b/po/screen-profiles.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 11:09-0700\n" +"POT-Creation-Date: 2009-04-06 13:50-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/profiles/common b/profiles/common index 2bc017f2..945dc4ba 100644 --- a/profiles/common +++ b/profiles/common @@ -26,26 +26,27 @@ vbell off msgwait 1 # Define status commands -backtick 99 86400 86400 /var/lib/screen-profiles/logo -backtick 100 3600 3600 /var/lib/screen-profiles/release -backtick 101 10 10 /var/lib/screen-profiles/updates-available -backtick 102 2 2 /var/lib/screen-profiles/reboot-required -backtick 103 2 2 /var/lib/screen-profiles/cpu-freq -backtick 104 86400 86400 /var/lib/screen-profiles/cpu-count -backtick 105 86400 86400 /var/lib/screen-profiles/mem-available -backtick 106 2 2 /var/lib/screen-profiles/load-average -backtick 107 2 2 /var/lib/screen-profiles/mem-used -backtick 108 600 600 /var/lib/screen-profiles/ec2-cost -backtick 109 3600 3600 /var/lib/screen-profiles/hostname -backtick 110 86400 86400 /var/lib/screen-profiles/whoami -backtick 111 86400 86400 /var/lib/screen-profiles/menu -backtick 112 86400 86400 /var/lib/screen-profiles/arch -backtick 113 30 30 /var/lib/screen-profiles/battery -backtick 114 10 10 /var/lib/screen-profiles/users -backtick 115 60 60 /var/lib/screen-profiles/uptime -backtick 116 2 2 /var/lib/screen-profiles/processes -backtick 117 2 2 /var/lib/screen-profiles/network-up -backtick 118 2 2 /var/lib/screen-profiles/network-down +backtick 99 86400 86400 screen-profiles-status logo +backtick 100 3600 3600 screen-profiles-status release +backtick 101 10 10 screen-profiles-status updates-available +backtick 102 2 2 screen-profiles-status reboot-required +backtick 103 2 2 screen-profiles-status cpu-freq +backtick 104 86400 86400 screen-profiles-status cpu-count +backtick 105 86400 86400 screen-profiles-status mem-available +backtick 106 2 2 screen-profiles-status load-average +backtick 107 2 2 screen-profiles-status mem-used +backtick 108 600 600 screen-profiles-status ec2-cost +backtick 109 3600 3600 screen-profiles-status hostname +backtick 110 86400 86400 screen-profiles-status whoami +backtick 111 86400 86400 screen-profiles-status menu +backtick 112 86400 86400 screen-profiles-status arch +backtick 113 30 30 screen-profiles-status battery +backtick 114 10 10 screen-profiles-status users +backtick 115 60 60 screen-profiles-status uptime +backtick 116 2 2 screen-profiles-status processes +backtick 117 2 2 screen-profiles-status network-up +backtick 118 2 2 screen-profiles-status network-down +backtick 119 2 2 screen-profiles-status wifi-quality hardstatus alwayslastline diff --git a/profiles/profile.skel b/profiles/profile.skel index 171c338c..9c5fd27f 100644 --- a/profiles/profile.skel +++ b/profiles/profile.skel @@ -26,7 +26,7 @@ source /usr/share/screen-profiles/profiles/common caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{= Wk}%110`%109`%111`" # Status string, last line -hardstatus string '%{= Wk}%99`%{= Wk} %100`%112`%102`%101`%= %115`%114`%108`%113`%117`%118`%116`%106`%104`%103`%105`%107`%Y-%m-%d %0c:%s' +hardstatus string '%{= Wk}%99`%{= Wk} %100`%112`%102`%101`%= %115`%114`%108`%113`%119`%117`%118`%116`%106`%104`%103`%105`%107`%Y-%m-%d %0c:%s' # NOTE: Older version of screen have an arbitrary limit of only being able # to change colors 16 times in this 'hardstatus string'. diff --git a/screen-profiles-export b/screen-profiles-export index 1f3dedf6..3d8d31a4 100755 --- a/screen-profiles-export +++ b/screen-profiles-export @@ -124,9 +124,9 @@ header() { } sources() { - # insert the common profile, replace the /var/lib exe path + # insert the common profile, replace the status exe path echo - cat $SHARE/profiles/common | sed "s:/var/lib/$PROG/:\$HOME/.$PROG/bin/:" + cat $SHARE/profiles/common | sed "s:$PROG-status:\$HOME/.$PROG/$PROG-status:" hr echo cat $SHARE/keybindings/common @@ -161,7 +161,15 @@ done [ -z "$file" ] && usage echo "$file" | grep -qs "\.tar\.gz$" || error "Target file must be a '.tar.gz' archive" -[ -e "$file" ] && error "File exists, please remove before running [$file]" +if [ -e "$file" ]; then + echo `gettext "File exists"` " [$file]" + read -p "`gettext 'Remove file? [y/N] '`" -r remove + if [ "$remove" = "Y" -o "$remove" = "y" ]; then + rm -f "$file" + else + exit 1 + fi +fi # Obtain selections count=1 @@ -195,6 +203,7 @@ mkdir -p "$TMPDIR/.$PROG/bin" # Copy status scripts cp -a /var/lib/$PROG/* "$TMPDIR/.$PROG/bin" +cp -a /usr/bin/$PROG-status "$TMPDIR/.$PROG" # Generate the monolithic profile header > "$PROFILE" diff --git a/screen-profiles-status b/screen-profiles-status index dbb6113c..5e0808fc 100755 --- a/screen-profiles-status +++ b/screen-profiles-status @@ -21,7 +21,14 @@ renice 10 $$ >/dev/null 2>&1 || true ionice -c3 -p $$ >/dev/null 2>&1 || true -DIR="/var/lib/screen-profiles" +if [ -d "/var/lib/screen-profiles" ]; then + DIR="/var/lib/screen-profiles" +elif [ -d "$HOME/.screen-profiles/bin" ]; then + DIR="$HOME/.screen-profiles/bin" +else + exit 1 +fi + P="$1" case "$P" in @@ -30,7 +37,7 @@ case "$P" in grep -qs "^$P=0$" "$HOME/.screen-profiles/status" && exit 0 ;; # default = off, user must override to turn on - arch|battery|ec2-cost|hostname|network-down|network-up|processes|uptime|users|whoami) + arch|battery|ec2-cost|hostname|network-down|network-up|processes|uptime|users|whoami|wifi-quality) grep -qs "^$P=1$" "$HOME/.screen-profiles/status" || exit 0 ;; *)