#!/bin/bash case $1 in start) # deamon=`yandex-disk start` notify-send -i "$HOME//yandex-disk/icon.png" "$deamon" ;; stop) # deamon=`yandex-disk stop` notify-send -i "$HOME//yandex-disk/icon.png" "$deamon" ;; *) # deamon=`yandex-disk status` if [[ "$deamon" == ": " ]] # - . then deamon=`yandex-disk start` notify-send -i "$HOME//yandex-disk/icon.png" "$deamon" else # status=`yandex-disk status | grep -o '^ : .*$' | grep -o ': .*$'` all=`yandex-disk status | grep -o ':.*'` nfree=`yandex-disk status | grep -o ':.*'` free=`yandex-disk status | grep -o ':.*'` maxfile=`yandex-disk status | grep -o ' :.*'` trash=`yandex-disk status | grep -o ' :.*'` if [[ "$status" == ": " ]] # then SUNC=`yandex-disk status | grep -o ' : .*' | grep -o '[^:]*$'` notify-send -i "$HOME//yandex-disk/icon.png" "" ":$SUNC\n$all\n$nfree\n$free\n$maxfile\n$trash" elif [[ "$status" == ": " ]]; then # notify-send -i "$HOME//yandex-disk/icon.png" "$status" else # notify-send -i "$HOME//yandex-disk/icon.png" "$status" "$all\n$nfree\n$free\n$maxfile\n$trash" fi fi ;; esac # case. exit 0
cd /usr/share/applications/
sudo gedit ya-disk.desktop
[Desktop Entry] Version=1.0 Type=Application Name=. Comment= , . Exec=/home/alex//yandex-disk/ya-disk.sh Terminal=false Icon=/home/alex//yandex-disk/icon.png StartupNotify=true Actions=Window;Document; [Desktop Action Window] Name= Exec=/home/alex//yandex-disk/ya-disk.sh start OnlyShowIn=Unity; [Desktop Action Document] Name= Exec=/home/alex//yandex-disk/ya-disk.sh stop OnlyShowIn=Unity;
/home/alex//yandex-disk/icon.png
Source: https://habr.com/ru/post/249267/
All Articles