commit 6f114df63e073d358acf5f3d372bb06ec08a9978 Author: Dustin Kirkland Date: Sun Dec 14 16:04:29 2008 -0600 initial checkin of screen-profiles diff --git a/README b/README new file mode 100644 index 00000000..b15c36db --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +For more information about this package, please see: + * https://launchpad.net/screen-profiles diff --git a/bin/cpu-freq b/bin/cpu-freq new file mode 100755 index 00000000..d777282c --- /dev/null +++ b/bin/cpu-freq @@ -0,0 +1,3 @@ +#!/bin/sh + +grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$/ MHz/" diff --git a/bin/reboot-required b/bin/reboot-required new file mode 100755 index 00000000..fb79d1aa --- /dev/null +++ b/bin/reboot-required @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ -e /var/run/reboot-required ]; then + echo "(@)" +fi diff --git a/bin/release b/bin/release new file mode 100755 index 00000000..56257ada --- /dev/null +++ b/bin/release @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/lsb_release -d -s diff --git a/bin/updates-available b/bin/updates-available new file mode 100755 index 00000000..d9655ce2 --- /dev/null +++ b/bin/updates-available @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$/\!/" diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..398c1deb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +screen-profiles (1.0) jaunty; urgency=low + + * Initial upload + + -- Dustin Kirkland Sun, 14 Dec 2008 13:12:12 -0600 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..1e8b3149 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +6 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..7dcf3c00 --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: screen-profiles +Section: misc +Priority: optional +Maintainer: Dustin Kirkland +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 6.0) +Homepage: http://launchpad.net/screen-profiles +Vcs-Bzr: http://bazaar.launchpad.net/~kirkland/screen-profiles/main + +Package: screen-profiles +Architecture: all +Depends: debconf (>= 0.5) | debconf-2.0, screen +Description: a set of useful profiles and a profile-switcher for GNU screen + screen-profiles includes a set of profiles for the GNU screen window manager. + These profiles are quite useful on server machines which are not running + a graphical desktop. The 'screen' command provides a number of advanced + features are not necessarily exposed in the default profile. These profiles + provide features such as status bars, clocks, notifiers (reboot-required, + updates-available), etc. The profile-switcher allows users to quickly switch + their .screenrc to any of the available profiles. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..c925ec16 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,35 @@ +This package was debianized by Dustin Kirkland +Sun, 14 Dec 2008 13:11:37 -0600 + +It was downloaded from: http://launchpad.net/screen-profiles + +Upstream Authors: Dustin Kirkland + +Copyright: + Copyright (C) 2002-2008 Dustin Kirkland + All rights reserved. + +License: + + 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 . + + On Debian systems, the complete text of the GNU General Public + License, version 3, can be found in /usr/share/common-licenses/GPL-3. + + The icons are licensed under the Creative Commons Attribution 2.5 license, + . In accordance with CCA2.5, + the icons are available at . + +The Ubuntu packaging: + Copyright (C) 2008 by Dustin Kirkland + released under the GPL-3. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 00000000..ad8fdeb2 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,4 @@ +usr/bin +usr/share/screen-profiles +usr/share/screen-profiles/bin +usr/share/screen-profiles/profiles diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..e845566c --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/install b/debian/install new file mode 100644 index 00000000..89658eed --- /dev/null +++ b/debian/install @@ -0,0 +1,9 @@ +bin/cpu-freq usr/share/screen-profiles/bin +bin/reboot-required usr/share/screen-profiles/bin +bin/release usr/share/screen-profiles/bin +bin/updates-available usr/share/screen-profiles/bin +profiles/debian.screenrc usr/share/screen-profiles/profiles +profiles/fedora.screenrc usr/share/screen-profiles/profiles +profiles/redhat.screenrc usr/share/screen-profiles/profiles +profiles/ubuntu.screenrc usr/share/screen-profiles/profiles +select-screen-profile usr/bin diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..4d4a87e7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,45 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. +# +# debian/rules makefile for musica + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +PACKAGE=screen-profiles + +build: + +clean: + rm -rf debian/${PACKAGE} debian/files debian/${PACKAGE}.debhelper.log + +install:build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -X.bzr + dh_install -X.bzr + +# Everything else is handled by dh_install + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs -X.bzr + dh_installman select-screen-profile.1 + dh_installchangelogs README + dh_installdebconf + dh_compress + dh_fixperms + dh_link /etc/screenrc usr/share/${PACKAGE}/profiles/default.screenrc + dh_installdeb + dh_gencontrol + dh_builddeb + +binary: binary-indep +.PHONY: build clean binary-indep binary install + +binary-arch: diff --git a/profiles/debian.screenrc b/profiles/debian.screenrc new file mode 100644 index 00000000..111f4e55 --- /dev/null +++ b/profiles/debian.screenrc @@ -0,0 +1,34 @@ +############################################################################### +# GNU Screen Profile for Debian +# This configuration profile is intended to roughly approximate a Debian +# Desktop within 'screen'. +# +# Copyright (C) 2008 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +############################################################################### + +startup_message off +msgwait 1 + +backtick 100 3600 3600 /usr/share/screen-profiles/bin/release +backtick 101 3600 3600 /usr/share/screen-profiles/bin/updates-available +backtick 102 10 10 /usr/share/screen-profiles/bin/reboot-required +backtick 103 5 5 /usr/share/screen-profiles/bin/cpu-freq + +hardstatus alwayslastline +caption always '%{= Wk}%{= Wk}%?%-Lw%?%{= yk}%n %t%{= Wk} %?%+Lw%?%?%= %{= Wk}' +hardstatus string '%{= wk} %{+b Wr} @ %{+b wk} %100` %{= Wk}|%= |%{+B bW}%102`%{= Wk}|%{+b rW}%101`%{= Wk}|%{+b gW}%103`%{= Wk}|%{= wb}%Y-%m-%d %c:%s%{k}' + +# Keybindings diff --git a/profiles/fedora.screenrc b/profiles/fedora.screenrc new file mode 100644 index 00000000..98f1d322 --- /dev/null +++ b/profiles/fedora.screenrc @@ -0,0 +1,32 @@ +############################################################################### +# GNU Screen Profile for Debian +# This configuration profile is intended to roughly approximate a Fedora +# Desktop within 'screen'. +# +# Copyright (C) 2008 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +############################################################################### + +startup_message off +msgwait 1 + +backtick 100 3600 3600 /usr/share/screen-profiles/bin/release +backtick 103 5 5 /usr/share/screen-profiles/bin/cpu-freq + +hardstatus alwayslastline +caption always '%{= Wk}%{= Wk}%?%-Lw%?%{= yk}%n %t%{= Wk} %?%+Lw%?%?%= %{= Wk}' +hardstatus string '%{= wk} %{+b Bw} f %{+b wk} %100` %{= Wk}|%= |%{+b gW}%103`%{= Wk}|%{= wb}%Y-%m-%d %c:%s%{k}' + +# Keybindings diff --git a/profiles/redhat.screenrc b/profiles/redhat.screenrc new file mode 100644 index 00000000..495375ce --- /dev/null +++ b/profiles/redhat.screenrc @@ -0,0 +1,32 @@ +############################################################################### +# GNU Screen Profile for Debian +# This configuration profile is intended to roughly approximate a Red Hat +# Desktop within 'screen'. +# +# Copyright (C) 2008 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +############################################################################### + +startup_message off +msgwait 1 + +backtick 100 3600 3600 /usr/share/screen-profiles/bin/release +backtick 103 5 5 /usr/share/screen-profiles/bin/cpu-freq + +hardstatus alwayslastline +caption always '%{= Wk}%{= Wk}%?%-Lw%?%{= yk}%n %t%{= Wk} %?%+Lw%?%?%= %{= Wk}' +hardstatus string '%{= wk} %{+b RK} RH %{+b wk} %100` %{= Wk}|%= |%{+b gW}%103`%{= Wk}|%{= wb}%Y-%m-%d %c:%s%{k}' + +# Keybindings diff --git a/profiles/ubuntu.screenrc b/profiles/ubuntu.screenrc new file mode 100644 index 00000000..9b12e84a --- /dev/null +++ b/profiles/ubuntu.screenrc @@ -0,0 +1,34 @@ +############################################################################### +# GNU Screen Profile for the Ubuntu Server +# This configuration profile is intended to roughly approximate the Ubuntu +# Gnome Desktop within 'screen'. +# +# Copyright (C) 2008 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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +############################################################################### + +startup_message off +msgwait 1 + +backtick 100 3600 3600 /usr/share/screen-profiles/bin/release +backtick 101 3600 3600 /usr/share/screen-profiles/bin/updates-available +backtick 102 10 10 /usr/share/screen-profiles/bin/reboot-required +backtick 103 5 5 /usr/share/screen-profiles/bin/cpu-freq + +hardstatus alwayslastline +caption always '%{= Wk}%{= Wk}%?%-Lw%?%{= yk}%n %t%{= Wk} %?%+Lw%?%?%= %{= Wk}' +hardstatus string '%{= wk} %{+b r}\%{= y}o%{=b Y}/%{+b wk} %100` %{= Wk}|%= |%{+B bW}%102`%{= Wk}|%{+b rW}%101`%{= Wk}|%{+b gW}%103`%{= Wk}|%{= wb}%Y-%m-%d %c:%s%{k}' + +# Keybindings diff --git a/select-screen-profile b/select-screen-profile new file mode 100755 index 00000000..28676b5b --- /dev/null +++ b/select-screen-profile @@ -0,0 +1,47 @@ +#!/bin/sh + +PROFILE_DIR="/usr/share/screen-profiles/profiles" + +if [ -e "$HOME/.screenrc" ]; then + if [ ! -L "$HOME/.screenrc" ]; then + echo `gettext 'Error:'` $HOME/.screenrc `gettext 'exists, but is not a symlink'` + exit 1 + fi +fi + +echo +echo "Select a screen profile: " +i=0 +profiles=$(ls $PROFILE_DIR) +for x in $profiles; do + i=$(expr $i + 1) + desc=" " + if [ $x = "ubuntu.screenrc" ]; then + desc="<---- ` gettext 'recommended'`" + simple=$i + fi + echo " $i. $x\t\t$desc" +done +echo +selected=x +while /bin/true; do + if [ -z "$selected" -a ! -z "$simple" ]; then + selected="$simple" + elif ! test $selected -gt 0 2>/dev/null; then + read -p "`gettext 'Choose'` 1-$i [$simple]: " -r selected + elif ! test $selected -le $i 2>/dev/null; then + read -p "`gettext 'Choose'` 1-$i [$simple]: " -r selected + else + break + fi +done + +i=0 +for x in $profiles; do + i=`expr $i + 1` + if [ $i -eq $selected ]; then + rm -f "$HOME/.screenrc" && ln -s "$PROFILE_DIR/$x" "$HOME/.screenrc" + fi +done + +exit 0 diff --git a/select-screen-profile.1 b/select-screen-profile.1 new file mode 100644 index 00000000..d0ed8b36 --- /dev/null +++ b/select-screen-profile.1 @@ -0,0 +1,22 @@ +.TH select\-screen\-profile 1 "14 Dec 2008" screen-profiles "screen-profiles" +.SH NAME +select\-screen\-profile \- Screen Profile Selector + +.SH DESCRIPTION +\fBselect\-screen\-profile\fP is an application lists the available screen profiles on a system and prompts the user to select one. + +The selected profile will be symbolically linked into the current user's ~/.screenrc file, if that file does not yet exist, or is currently a symbolic link. + +.SH "SEE ALSO" +.PD 0 +.TP +\fBscreen\fP(1) + +.TP +\fIhttp://launchpad.net/screen-profiles\fP +.PD + +.SH AUTHOR +This manpage and the \fBselect\-screen\-profile\fP utility was written by Dustin Kirkland for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or any later version published by the Free Software Foundation. + +On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.