summaryrefslogtreecommitdiff
path: root/.config/bash/functions.sh
diff options
context:
space:
mode:
authorben <benjaminfranzke@gmail.com>2010-03-02 19:03:59 +0100
committerben <benjaminfranzke@gmail.com>2010-03-02 19:03:59 +0100
commit10a816eaef1a827313d8fcfe3afdae77502fffeb (patch)
treea9e120afd5a53cb1e5d73d1326fbcb89a9fc5c67 /.config/bash/functions.sh
parent380843b13e8dedc090ea56692940c225f7e264b6 (diff)
downloaddotfiles-10a816eaef1a827313d8fcfe3afdae77502fffeb.tar.gz
dotfiles-10a816eaef1a827313d8fcfe3afdae77502fffeb.tar.bz2
dotfiles-10a816eaef1a827313d8fcfe3afdae77502fffeb.zip
bash/{alias,functions}.sh: improve term resizing
sync with alias used one dell-notebook for shrinking window (alias s="..") write a more generic resizing() function
Diffstat (limited to '.config/bash/functions.sh')
-rw-r--r--.config/bash/functions.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/.config/bash/functions.sh b/.config/bash/functions.sh
index 34bd71b..9e8ac83 100644
--- a/.config/bash/functions.sh
+++ b/.config/bash/functions.sh
@@ -1,5 +1,10 @@
max() { [[ $# -eq 2 ]] && ( [[ $1 -ge $2 ]] && echo $1 || echo $2 ) }
+# param: width = $1, height = $2
+resize() {
+ printf "\e[8;%d;%dt" $2 $1
+}
+
resize_to_min() {
# eval $(resize -s $(max $LINES $2) $(max $COLUMNS $1))
printf "\e[8;%d;%dt" $(max $LINES $2) $(max $COLUMNS $1)