Skip to content

Instantly share code, notes, and snippets.

View lemming's full-sized avatar
:shipit:

Aleksei Cherevatov lemming

:shipit:
  • 3dEYE
  • Saint Petersburg
View GitHub Profile
#!/bin/bash
RESPONSE="`$HOME/bin/post-picasa "$1" 2>&1`"
if [ $? = 0 ]; then
zenity --entry --entry-text="$RESPONSE" --title="Изображение $1 загружено" --text="Нажмите «OK», чтобы скопировать адрес и закрыть это окно" | xclip -selection clipboard
else
echo $RESPONSE | zenity --text-info --title="Произошла ошибка"
fi
function youtube-play() {
if [ $# -eq 1 ]; then
YOUTUBE_LINK=$1
else
YOUTUBE_LINK=`xclip -o -selection "clipboard" | grep -oE 'http[^&]*' | head -n1`
fi
YOUTUBE_COOKIES=$HOME/.youtube.cookies
if [ ! -e $YOUTUBE_COOKIES ]; then
curl -c $YOUTUBE_COOKIES http://www.youtube.com > /dev/null 2>&1
fi