Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function set_win_on_top() {
- pid=$1
- sleep 0.2
- win_id=`wmctrl -l -p | grep ${pid} | awk '{print $1}'`
- wmctrl -i -r ${win_id} -b add,above 2>/dev/null
- }
- function audacious_copy_song() {
- curent_song_loc=$(audtool current-song-filename)
- file_name="${curent_song_loc##*/}"
- file_extension="${file_name##*.}"
- file="${file_name%.*}"
- dest_song_loc=$(echo ~/Music/$file_name)
- if [ -f "$dest_song_loc" ]; then
- unique_file_name=$file"_"$(date +%s%N)"."$file_extension
- unique_dest_song_loc=$(echo ~/Music/$(echo $unique_file_name))
- cp "$(echo $curent_song_loc)" "$(echo $unique_dest_song_loc)"
- zenity --notification --text "file copied:\r\n$unique_file_name"
- else
- cp "$(echo $curent_song_loc)" "$(echo ~/Music)"
- zenity --notification --text "file copied:\r\n$file_name"
- fi
- }
- audacious_copy_song & set_win_on_top $!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement