Browse Source

Added clipia aliases and scripts

George Jones 3 months ago
parent
commit
e2886e6b9c
2 changed files with 24 additions and 0 deletions
  1. 19 0
      bin/clipia.sh
  2. 5 0
      rc.local/clipia_aliases.sh

+ 19 - 0
bin/clipia.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+# Wrapper for clipea that logs
+
+command="/home/gmj/bin/clipea"
+temp_logfile="/home/gmj/var/log/clipea.log.tmp"
+logfile="/home/gmj/var/log/clipea-`date +%Y-%m`.log"
+# Store the command line arguments
+args="$@"
+
+# Run the 'clipea' command with logging
+script -q -f -e -c "$command $args" "$temp_logfile"
+
+# Remove escape sequences and append to log
+cat "$temp_logfile" | \
+    sed -r \ 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g;s/\x0D//g' \
+        >> $logfile
+
+# Clean up
+rm $temp_logfile

+ 5 - 0
rc.local/clipia_aliases.sh

@@ -0,0 +1,5 @@
+# enable clipia
+
+# Need to find way to make this a binary w/o having to activate
+source /home/gmj/public/github/clipea/bin/bin/activate
+alias ??=~/bin/clipia.sh