2 Commits bad6bd4665 ... 00cfed4ae3

Author SHA1 Message Date
  Samuel W. Flint 00cfed4ae3 Update screenshotter script 1 year ago
  Samuel W. Flint 84eb310b77 Add a "tmosh" script 1 year ago
2 changed files with 29 additions and 7 deletions
  1. 16 7
      screenshot
  2. 13 0
      tmosh

+ 16 - 7
screenshot

@@ -13,7 +13,7 @@ done
 
 TYPE=root
 
-while getopts rwf:? opt
+while getopts rwsf:? opt
 do
     case "$opt" in
         r)
@@ -22,18 +22,27 @@ do
         w)
             TYPE=window
             ;;
+        s)
+            TYPE=select
+            ;;
         f)
             FILENAME="$OPTARG"
             ;;
         [?])
-            echo "screenshot [ -? ] [ -r | -w ] [ -f filename.png ]" >&2
+            echo "screenshot [ -? ] [ -r | -w | -s ] [ -f filename.png ]" >&2
             exit 1
             ;;
     esac
 done
 
-if [[ $TYPE == "root" ]] ; then
-    import -window root "${FILENAME}"
-else
-    import "${FILENAME}"
-fi
+case $TYPE in
+    root)
+        scrot "${FILENAME}"
+    ;;
+    window)
+        scrot -b -u "${FILENAME}"
+    ;;
+    select)
+	scrot -s "${FILENAME}"
+    ;;
+esac

+ 13 - 0
tmosh

@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+PROG_NAME=$(basename "$0")
+
+if [[ $# -ne 2 ]] ; then
+    echo "${PROG_NAME} HOST SESSION" >&2
+    exit 1
+fi
+
+HOST=$1
+SESSION=$2
+
+mosh "${HOST}" -- tmux new-session -A -s "${SESSION}"