new scripts!
This commit is contained in:
parent
f8a8234639
commit
9cd707c0f9
18
typeshare.sh
18
typeshare.sh
|
@ -5,12 +5,12 @@
|
|||
. $HOME/.config/wms/wms_var
|
||||
|
||||
# a simple menu
|
||||
MENU=$(echo "documentos\nimágenes\nmúsica\nvídeos" | $XMENU)
|
||||
MENU=$(echo "documentos\nimágenes\nmúsica\nscripts\nvídeos" | $XMENU)
|
||||
|
||||
# define filters
|
||||
case $MENU in
|
||||
documentos)
|
||||
filter=".pdf"
|
||||
filter=".pdf|.txt"
|
||||
;;
|
||||
imágenes)
|
||||
filter=".png|.jpg|.jpeg"
|
||||
|
@ -18,6 +18,9 @@ case $MENU in
|
|||
música)
|
||||
filter=".mp3|.flac|.wav|.ogg|.webm"
|
||||
;;
|
||||
scripts)
|
||||
filter=".pl|.py|.sh|.bash"
|
||||
;;
|
||||
vídeos)
|
||||
filter=".mp4|.avi|.mkv"
|
||||
;;
|
||||
|
@ -28,9 +31,12 @@ if [ -n "$filter" ]; then
|
|||
filepath=$(find $HOME -type f | grep -E "$filter" | $XMENU_XL) # path to file
|
||||
filename=$(basename $filepath) # file name
|
||||
|
||||
# upload file and save stdout to paste in a terminal
|
||||
curl --upload-file "$filepath" https://transfer.sh/"$filename" | xclip
|
||||
if [ -n "$filepath" ]; then # if filepath, upload and save
|
||||
curl --upload-file "$filepath" https://transfer.sh/"$filename" | xclip
|
||||
|
||||
# To paste somewhere else other than terminal
|
||||
xclip -o | xclip -sel c
|
||||
# To paste somewhere else other than terminal
|
||||
xclip -o | xclip -sel c
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
## quick web browsing ##
|
||||
|
||||
. $HOME/.config/wms/wms_var
|
||||
|
||||
COLORS="-menu-background-color 0x000000 \
|
||||
-menu-foreground-color 0x$AC \
|
||||
-scroll-bar-bar-color 0x$AC \
|
||||
-scroll-bar-frame-color 0x$IC"
|
||||
|
||||
BROWSER="links2 -g $COLORS"
|
||||
XSEL=$(atomx CUT_BUFFER0 $(lsw -r))
|
||||
|
||||
echo $XSEL | grep -Eq "^https://|^http://" && $BROWSER $XSEL \
|
||||
|| $BROWSER "https://duckduckgo.com/?q=$XSEL"
|
||||
|
||||
## xselection ##
|
||||
# under xprop: XSEL=$(xprop -root | awk -F "=" '/CUT_BUFFER0/ {gsub("\"","",$2); print $2}')
|
||||
# under wmutils: XSEL=$(atomx CUT_BUFFER0 $(lsw -r))
|
Loading…
Reference in New Issue