1
0

2 Commity a4a34eb94c ... 22f240b469

Autor SHA1 Správa Dátum
  George Jones 22f240b469 Merge branch 'master' of git.galthub.com:gmj/home.public.bin 3 mesiacov pred
  George Jones e2886e6b9c Added clipia aliases and scripts 3 mesiacov pred
2 zmenil súbory, kde vykonal 24 pridanie a 0 odobranie
  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