better xclip

This commit is contained in:
Thomas Forgione 2018-06-06 14:42:57 +02:00
parent ebade40b51
commit a45d76673f
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,8 @@ copy() {
if [ $# -eq 0 ]; then
xclip -selection c
else
cat $1 | xclip -selection c
file_type=$(file -b --mime-type "$1")
xclip -selection c -t $file_type < $1
fi
}
@ -125,7 +126,6 @@ if [ -d "$GCLONE_PATH" ]; then
compdef _cdg cdg
alias mcf="music-client file"
fi
# Music things
@ -147,12 +147,14 @@ if [ $? -eq 0 ]; then
if [ $# -eq 1 ]; then
echo "require('music').execute_command(\"$command\")" | awesome-client
else
library_path=$(realpath $2 | rev | cut -d '/' -f -3 | rev)
library_path=$(realpath $2 | cut -d '/' -f 5-)
awesome_command="require('music').execute_command(\"$command\",\"$library_path\")"
echo $awesome_command | awesome-client
fi
}
alias mcf="music-client file"
fi
fi