]> git.armaanb.net Git - charsel.git/commitdiff
changed from .cache directory to /tmp
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 16 Sep 2020 15:48:31 +0000 (11:48 -0400)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 16 Sep 2020 15:48:31 +0000 (11:48 -0400)
INSTALL.sh
charsel

index cd7c956ea7dda930d346e6cc4cc0a76d68f6bbf6..da2911b30fde0a48f3f76aabcf4f9ffbfe808e7e 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/env sh
 
-mkdir ~/.cache/charsel/
+mkdir /tmp/charsel/
+chmod 777 /tmp/charsel/
 chmod +x charsel
 
 if [ `whoami` == root ]; then
diff --git a/charsel b/charsel
index 01f1d3f4d7f18fc8e9ea1999bcdb8331ea6eafec..dc2564f54921231b4803486ff72d168389fc5650 100755 (executable)
--- a/charsel
+++ b/charsel
@@ -1,9 +1,9 @@
 #!/usr/bin/env sh
 
 # Merge both global and local charfiles
-cp /usr/share/charsel/* ~/.cache/charsel/
-cp ~/.local/share/charsel/* ~/.cache/charsel/
-CHARDIR=~/.cache/charsel
+CHARDIR=/tmp/charsel
+cp /usr/share/charsel/* $CHARDIR
+cp ~/.local/share/charsel/* $CHARDIR
 
 # Check if user provided a charfile
 [ -z "$1" ] && echo "No argument supplied"  && exit 1
@@ -16,7 +16,7 @@ do
   
   # Put charfile into table
   column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator ' | '
-  read INPUT
+  read -n 1 INPUT
   
   # Navigate to the right characther
   OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
@@ -24,7 +24,6 @@ do
   # Clear screen
   clear
 
-  # Print output, and copy to clipboard
-  echo $OUTPUT
+  # Copy output to clipboard
   echo $OUTPUT | xclip -selection clipboard
 done