Update rofi to full width

master
Alex Selimov 2 months ago
parent 0cb0877306
commit 2b079d8512

@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
#This script wraps various pub commands into a dmenu menu #This script wraps various pub commands into a dmenu menu
function fail { function fail {
printf '%s\n' "$1" >&2 printf '%s\n' "$1" >&2
exit "${2-1}" exit "${2-1}"
} }
dmenu="dmenu" dmenu="dmenu -theme-str 'window {width: 100%;}' -i"
citekey=$(pubs list | $dmenu | cut -d ' ' -f 1 | tr -d '[]\n' ) citekey=$(pubs list | eval "$dmenu" | cut -d ' ' -f 1 | tr -d '[]\n' )
if [ "$citekey" = "" ]; then if [ "$citekey" = "" ]; then
exit 1 exit 1
fi fi
if [ "$1" = "open" ]; then if [ "$1" = "open" ]; then
pubs doc open "$citekey" pubs doc open "$citekey"
elif [ "$1" = "tag" ]; then elif [ "$1" = "tag" ]; then
echo $citekey| tr -d '\n'| xclip echo $citekey| tr -d '\n'| xclip
xdotool type "$citekey" xdotool type "$citekey"
elif [ "$1" = "url" ]; then elif [ "$1" = "url" ]; then
url=$(grep "url =" $HOME/.pubs/bib/$citekey.bib | cut -d "{" -f 2 | tr -d "{ },") url=$(grep "url =" $HOME/.pubs/bib/$citekey.bib | cut -d "{" -f 2 | tr -d "{ },")
echo $url| tr -d '\n'| xclip echo $url| tr -d '\n'| xclip
xdotool type "$url" xdotool type "$url"
fi fi

Loading…
Cancel
Save