From 222006c939694a8d6f20543cfb1d24a37e74e5de Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 May 2007 15:09:51 +0200 Subject: [PATCH] /etc/skel/.zshrc: added function fluxkey-change --- debian/changelog | 8 ++++++++ etc/skel/.zshrc | 22 +++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 83496f4..1580439 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +grml-etc-core (0.3.3) unstable; urgency=low + + * /etc/skel/.zshrc: + - added function fluxkey-change to change fluxbox keys + from 'Alt-#' to 'Alt-F#' and vice versa + + -- Michael Prokop Thu, 17 May 2007 15:08:57 +0200 + grml-etc-core (0.3.2) unstable; urgency=low * /etc/skel/.zshrc: added zsh-mime-setup, thanks wuehlmaus! diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 27d1045..aa1b3e3 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Mai 15 11:21:56 CEST 2007 [mika] +# Latest change: Don Mai 17 15:08:21 CEST 2007 [mika] ################################################################################ # source ~/.zshrc.global {{{ @@ -939,6 +939,26 @@ | sed 's/value=//;s/"//g' } +# change fluxbox keys from 'Alt-#' to 'Alt-F#' and vice versa + fluxkey-change() { + [ -n "$FLUXKEYS" ] || local FLUXKEYS="$HOME/.fluxbox/keys" + if ! [ -r "$FLUXKEYS" ] ; then + echo "Sorry, \$FLUXKEYS file $FLUXKEYS could not be read - nothing to be done." + return 1 + else + if grep -q 'Mod1 F[0-9] :Workspace [0-9]' $FLUXKEYS ; then + echo -n 'Switching to Alt-# mode in ~/.fluxbox/keys: ' + sed -i -e 's|^\(Mod[0-9]\+[: space :]\+\)F\([0-9]\+[: space :]\+:Workspace.*\)|\1\2|' $FLUXKEYS && echo done || echo failed + elif grep -q 'Mod1 [0-9] :Workspace [0-9]' $FLUXKEYS ; then + echo -n 'Switching to Alt-F# mode in ~/.fluxbox/keys: ' + sed -i -e 's|^\(Mod[0-9]\+[: space :]\+\)\([0-9]\+[: space :]\+:Workspace.*\)|\1F\2|' $FLUXKEYS && echo done || echo failed + else + echo 'Sorry, do not know what to do.' + return 1 + fi + fi + } + # }}} # mercurial related stuff {{{ -- 2.1.4