]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
move contrib files to subdirectories
authorStefan Tomanek <stefan.tomanek@wertarbyte.de>
Sun, 12 Feb 2012 22:14:22 +0000 (23:14 +0100)
committerStefan Tomanek <stefan.tomanek@wertarbyte.de>
Mon, 13 Feb 2012 20:58:17 +0000 (21:58 +0100)
00autorandr_pm-utils [deleted file]
bash_completion [deleted file]
bash_completion/autorandr [new file with mode: 0644]
pm-utils/90autorandr [new file with mode: 0755]

diff --git a/00autorandr_pm-utils b/00autorandr_pm-utils
deleted file mode 100755 (executable)
index 1637445..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# 90autorandr: Change autorand profile on thaw/resume
-
-AUTORANDR="autorandr -c"
-
-detect_display()
-{
-       for x in /tmp/.X11-unix/*; do
-               displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
-               user=$(who|awk '$5 ~ regexp {print $1}' regexp="\\\(:$displaynum\\\)")
-               if [ x"$user" = x"" ]; then
-                       user=$(who|awk '$2 ~ regexp {print $1}' regexp=":$displaynum")
-               fi
-               if [ x"$user" != x"" ]; then
-                       export DISPLAY=":$displaynum"
-                       /bin/su -c "${AUTORANDR}" "$user"
-                       return 0
-               fi
-       done
-}
-
-case "$1" in
-       thaw|resume)
-               detect_display
-               ;;
-esac
diff --git a/bash_completion b/bash_completion
deleted file mode 100644 (file)
index b009994..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# autorandr/auto-disper completion by Maciej 'macieks' Sitarz <macieks@freesco.pl>
-
-_autorandr ()
-{
-       local cur prev opts lopts prfls
-
-       COMPREPLY=()
-       cur="${COMP_WORDS[COMP_CWORD]}"
-       prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-       opts="-h -c -s -l -d"
-       lopts="--help --change --save --load --default --force --fingerprint"
-       prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`"
-
-       case "${cur}" in
-               --*)
-                       COMPREPLY=( $( compgen -W "${lopts}" -- $cur ) )
-                       return 0
-                       ;;
-               -*)
-                       COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
-                       return 0
-                       ;;
-               *)
-                       if [ $COMP_CWORD -eq 1 ]; then
-                               COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
-                       fi
-                       ;;
-               esac
-
-       case "${prev}" in
-               -l|--load|-d|--default)
-                       COMPREPLY=( $( compgen -W "${prfls}" ) )
-                       return 0
-                       ;;
-               *)
-                       ;;
-       esac
-
-       return 0
-}
-complete -F _autorandr autorandr
-complete -F _autorandr auto-disper
-
diff --git a/bash_completion/autorandr b/bash_completion/autorandr
new file mode 100644 (file)
index 0000000..b009994
--- /dev/null
@@ -0,0 +1,44 @@
+# autorandr/auto-disper completion by Maciej 'macieks' Sitarz <macieks@freesco.pl>
+
+_autorandr ()
+{
+       local cur prev opts lopts prfls
+
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+       opts="-h -c -s -l -d"
+       lopts="--help --change --save --load --default --force --fingerprint"
+       prfls="`find ~/.autorandr/* -maxdepth 1 -type d -printf '%f\n'`"
+
+       case "${cur}" in
+               --*)
+                       COMPREPLY=( $( compgen -W "${lopts}" -- $cur ) )
+                       return 0
+                       ;;
+               -*)
+                       COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
+                       return 0
+                       ;;
+               *)
+                       if [ $COMP_CWORD -eq 1 ]; then
+                               COMPREPLY=( $( compgen -W "${opts} ${lopts}" -- $cur ) )
+                       fi
+                       ;;
+               esac
+
+       case "${prev}" in
+               -l|--load|-d|--default)
+                       COMPREPLY=( $( compgen -W "${prfls}" ) )
+                       return 0
+                       ;;
+               *)
+                       ;;
+       esac
+
+       return 0
+}
+complete -F _autorandr autorandr
+complete -F _autorandr auto-disper
+
diff --git a/pm-utils/90autorandr b/pm-utils/90autorandr
new file mode 100755 (executable)
index 0000000..1637445
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# 90autorandr: Change autorand profile on thaw/resume
+
+AUTORANDR="autorandr -c"
+
+detect_display()
+{
+       for x in /tmp/.X11-unix/*; do
+               displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+               user=$(who|awk '$5 ~ regexp {print $1}' regexp="\\\(:$displaynum\\\)")
+               if [ x"$user" = x"" ]; then
+                       user=$(who|awk '$2 ~ regexp {print $1}' regexp=":$displaynum")
+               fi
+               if [ x"$user" != x"" ]; then
+                       export DISPLAY=":$displaynum"
+                       /bin/su -c "${AUTORANDR}" "$user"
+                       return 0
+               fi
+       done
+}
+
+case "$1" in
+       thaw|resume)
+               detect_display
+               ;;
+esac