diff --git a/bin/cpu-count b/bin/cpu-count index 84e1b370..61424998 100755 --- a/bin/cpu-count +++ b/bin/cpu-count @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is "on" +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 count=`grep -c "^processor.*:" /proc/cpuinfo` [ "$count" = "1" ] || echo $count"x" diff --git a/bin/cpu-freq b/bin/cpu-freq index 6d2ee558..6c4f5218 100755 --- a/bin/cpu-freq +++ b/bin/cpu-freq @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is "on" +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | awk -F"[:.]" '{print $2}'` if [ $mhz -ge 1000 ]; then diff --git a/bin/ec2-cost b/bin/ec2-cost index 2042d8f4..4c91274e 100755 --- a/bin/ec2-cost +++ b/bin/ec2-cost @@ -20,6 +20,12 @@ FORCE=0 DETAIL=0 + +# Default is "off" +p=`basename $0` +grep -qs "^$p=1$" "$HOME/.screen-profiles/status" && FORCE=1 +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && FORCE=0 + for arg in $@; do case "$arg" in -f|--force) diff --git a/bin/hostname b/bin/hostname index 3ee573f0..b95d192b 100755 --- a/bin/hostname +++ b/bin/hostname @@ -17,4 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -hostname -s +# Default is "off" +p=`basename $0` +grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0 + +echo "@"`hostname -s` diff --git a/bin/load-average b/bin/load-average index 0e3d933e..5c743c3a 100755 --- a/bin/load-average +++ b/bin/load-average @@ -17,5 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is "on" +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 cat /proc/loadavg | cut -d " " -f -1 diff --git a/bin/mem-available b/bin/mem-available index 62c2ee2c..92831e7c 100755 --- a/bin/mem-available +++ b/bin/mem-available @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is on +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'` if [ $mem -ge 1048576 ]; then diff --git a/bin/mem-used b/bin/mem-used index f0be431a..269952a9 100755 --- a/bin/mem-used +++ b/bin/mem-used @@ -17,5 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is on +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 -free | awk '/buffers\/cache:/ {printf "%.0f%%\n", 100*$3/($3 + $4)}' +free | awk '/buffers\/cache:/ {printf ",%.0f%%\n", 100*$3/($3 + $4)}' diff --git a/bin/reboot-required b/bin/reboot-required index 731ca859..811ca6da 100755 --- a/bin/reboot-required +++ b/bin/reboot-required @@ -17,5 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is on +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 [ -e /var/run/reboot-required ] && echo "(@)" diff --git a/bin/release b/bin/release index 7b335e72..d57a8775 100755 --- a/bin/release +++ b/bin/release @@ -17,4 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is on +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 + echo $(/usr/bin/lsb_release -s -i) $(/usr/bin/lsb_release -s -r) diff --git a/bin/updates-available b/bin/updates-available index 2935adcb..8b39167d 100755 --- a/bin/updates-available +++ b/bin/updates-available @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is on +p=`basename $0` +grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 # expire the cache in X seconds; 1 hour by default EXPIRATION=3600 diff --git a/bin/whoami b/bin/whoami index 214323c1..3f8242b6 100755 --- a/bin/whoami +++ b/bin/whoami @@ -17,4 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Default is "off" +p=`basename $0` +grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0 + whoami diff --git a/debian/changelog b/debian/changelog index e218deed..75daa39b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ screen-profiles (1.37) unreleased; urgency=low - * + * bin/menu: make internationalizable menu prompt + * debian/rules: get-po from menu + * bin/*: test if enabled/disabled before executing, LP: #341557 - -- Dustin Kirkland Tue, 10 Mar 2009 16:45:09 -0500 + -- Dustin Kirkland Thu, 12 Mar 2009 02:08:32 -0500 screen-profiles (1.36-0ubuntu1) jaunty; urgency=low diff --git a/debian/install b/debian/install index 1bfe1110..7c5ad2f6 100644 --- a/debian/install +++ b/debian/install @@ -1,14 +1,4 @@ -bin/cpu-count var/lib/screen-profiles -bin/cpu-freq var/lib/screen-profiles -bin/ec2-cost var/lib/screen-profiles -bin/hostname var/lib/screen-profiles -bin/load-average var/lib/screen-profiles -bin/mem-available var/lib/screen-profiles -bin/mem-used var/lib/screen-profiles -bin/reboot-required var/lib/screen-profiles -bin/release var/lib/screen-profiles -bin/updates-available var/lib/screen-profiles -bin/whoami var/lib/screen-profiles +bin/* var/lib/screen-profiles profiles/common usr/share/screen-profiles/profiles profiles/plain usr/share/screen-profiles/profiles profiles/ubuntu-* usr/share/screen-profiles/profiles diff --git a/debian/rules b/debian/rules index 03a669df..718d9391 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ get-orig-source: get-po: xgettext -o po/screen-profiles.pot -L Python -d screen-profiles screen-profiles - xgettext -j -o po/screen-profiles.pot -L Shell -d screen-profiles select-screen-profile + xgettext -j -o po/screen-profiles.pot -L Shell -d screen-profiles select-screen-profile bin/menu prebuild: diff --git a/po/screen-profiles.pot b/po/screen-profiles.pot index 7853841e..1fe544ba 100644 --- a/po/screen-profiles.pot +++ b/po/screen-profiles.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-07 08:47-0600\n" +"POT-Creation-Date: 2009-03-12 02:08-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -170,3 +170,7 @@ msgstr "" #: select-screen-profile:137 msgid "Run \"screen\" to activate" msgstr "" + +#: bin/menu:24 +msgid "Menu:" +msgstr "" diff --git a/profiles/common b/profiles/common index ef702fca..468e9834 100644 --- a/profiles/common +++ b/profiles/common @@ -36,6 +36,7 @@ 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 3600 3600 /var/lib/screen-profiles/whoami +backtick 111 3600 3600 /var/lib/screen-profiles/menu hardstatus alwayslastline diff --git a/profiles/profile.skel b/profiles/profile.skel index 53adc780..7ba0438b 100644 --- a/profiles/profile.skel +++ b/profiles/profile.skel @@ -22,10 +22,10 @@ source /usr/share/screen-profiles/profiles/common # Window tabs, second to last line -caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{=b kW}Menu:" +caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{=b Wk}%110`%109` %{=b kW}%111`" # Status string, last line -hardstatus string '__LOGO__%{=b Wk} %100` %{= Wk} %= %{=b bW}%102`%{= Wk} %{=b rW}%101`%{= Wk} %{= Wg}%108`%{= Wk} %{= Yk}%106`%{= Wk} %{= Wk}%104`%{=b cW}%103`%{= Wk} %{=b gW}%105`,%107`%{= Wk} %Y-%m-%d %0c:%s' +hardstatus string '__LOGO__%{=b Wk} %100` %{= Wk} %= %{=b bW}%102`%{= Wk} %{=b rW}%101`%{= Wk} %{= Wg}%108`%{= Wk} %{= Yk}%106`%{= Wk} %{= Wk}%104`%{=b cW}%103`%{= Wk} %{=b gW}%105`%107`%{= Wk} %Y-%m-%d %0c:%s' # NOTE: There is an arbitrary limit of being able to change colors 16 times # in this 'hardstatus string'.