From 274975a2400f8301d2d0b94e8ce580aa9003e321 Mon Sep 17 00:00:00 2001 From: Greenpete Date: Sun, 8 Jan 2023 15:32:30 +0000 Subject: [PATCH] Add desktop menu and edit README.md --- README.md | 8 ++------ install.sh | 10 +++++++++- menu.desktop | 7 +++++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 menu.desktop diff --git a/README.md b/README.md index a2722c7..85a0891 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,13 @@ I hope to update and improve this code as well as maybe adding a [Zenity](https: You don't need to install youtube-dl-wrapper, but as part of ensuring and enabling it works as expected, installing helps. To install, run the installation script in the main directory - ~/YT-DL/Yt-DL.sh. This will check to see if you have youtube-dl installed and if you don't, it will install it. -It installs to /home/{user}/bin/YT-DL and does not as yet create a menu entry, so you need to do that manually for the time being. +It installs to /home/{user}/bin/YT-DL I have chosen to download youtube-dl directly from their release page (https://github.com/ytdl-org/youtube-dl), in order to get the latest version, but you can install it from your distro's repo' before installing this script if you'd rather. Note that this script does keep youtube-dl up to date by periodically checking the main repo for updates and applying them if needed. ### Run -Execute the following command in the terminal... -```` bash -~/bin/YT-DL/YT-DL.sh -```` -Or create a link in your menu to this file for convenience. +You should find a menu entry under 'Other'. Your video will be downloaded to your Desktop. diff --git a/install.sh b/install.sh index 3eb585b..da597a7 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Determine where we are... +pwd=$(pwd) + # Environment check. Checking for youtube-dl. If not found, install. echo " Checking that youtube-dl is installed..." @@ -8,7 +11,11 @@ if [ -f /usr/local/bin/youtube-dl ] else echo "youtube-dl is not present - installing..." && sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+rx /usr/local/bin/youtube-dl && echo "1" > ./dbytdl.txt fi -# End environment check. +# Edit desktop menu file. +# First the Execution path... +sed -i "s|Exec=/path/|Exec=/$HOME/bin/Youtube-dl-wrapper/YT-DL.sh|" $pwd/menu.desktop +# Now icon path... +sed -i "s|Icon=/path/|Icon=$pwd/YouTube-DL.svg" $pwd/menu.desktop # Check for needed directories... if [ -d ~/bin ]; @@ -27,6 +34,7 @@ cp YouTube-DL.svg ~/bin/YT-DL cp YT-DL.sh ~/bin/YT-DL cp LICENSE ~/bin/YT-DL cp README.md ~/bin/YT-DL +cp menu.desktop ~/bin/YT-DL # Check for the python symlink... if [ -f /usr/bin/python ]; diff --git a/menu.desktop b/menu.desktop new file mode 100644 index 0000000..34152a4 --- /dev/null +++ b/menu.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Youtube Download Wrapper +Exec=/path/ +Comment=A script to make using youtube-dl easier. +Terminal=true +Icon=/path/ +Type=Application \ No newline at end of file