From 1acd5c621883143c6ae8d47bfb95937f4850844b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 12 Mar 2019 21:20:17 -0400 Subject: [PATCH] mimeapps cleanup; rss added --- .local/share/applications/feh.desktop | 4 ---- .local/share/applications/gif.desktop | 4 ---- .local/share/applications/{sxiv.desktop => img.desktop} | 2 +- .local/share/applications/{mutt.desktop => mail.desktop} | 2 +- .../share/applications/{zathura.desktop => pdf.desktop} | 2 +- .local/share/applications/rss.desktop | 4 ++++ .local/share/applications/{vim.desktop => text.desktop} | 2 +- .../{transmission-remote.desktop => torrent.desktop} | 2 +- .scripts/tools/rssadd | 9 +++++++++ 9 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 .local/share/applications/feh.desktop delete mode 100644 .local/share/applications/gif.desktop rename .local/share/applications/{sxiv.desktop => img.desktop} (71%) rename .local/share/applications/{mutt.desktop => mail.desktop} (79%) rename .local/share/applications/{zathura.desktop => pdf.desktop} (70%) create mode 100644 .local/share/applications/rss.desktop rename .local/share/applications/{vim.desktop => text.desktop} (79%) rename .local/share/applications/{transmission-remote.desktop => torrent.desktop} (70%) create mode 100755 .scripts/tools/rssadd diff --git a/.local/share/applications/feh.desktop b/.local/share/applications/feh.desktop deleted file mode 100644 index be3de36..0000000 --- a/.local/share/applications/feh.desktop +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Type=Application -Name=feh image viewer -Exec=/usr/bin/feh %u diff --git a/.local/share/applications/gif.desktop b/.local/share/applications/gif.desktop deleted file mode 100644 index 366fd94..0000000 --- a/.local/share/applications/gif.desktop +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Animated gif handler -Exec=/usr/bin/mpv --loop %u diff --git a/.local/share/applications/sxiv.desktop b/.local/share/applications/img.desktop similarity index 71% rename from .local/share/applications/sxiv.desktop rename to .local/share/applications/img.desktop index a9ae0b6..d1582a5 100644 --- a/.local/share/applications/sxiv.desktop +++ b/.local/share/applications/img.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application -Name=sxiv image viewer +Name=Image viewer Exec=/usr/bin/sxiv -a %u diff --git a/.local/share/applications/mutt.desktop b/.local/share/applications/mail.desktop similarity index 79% rename from .local/share/applications/mutt.desktop rename to .local/share/applications/mail.desktop index b30466e..d24aea2 100644 --- a/.local/share/applications/mutt.desktop +++ b/.local/share/applications/mail.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application -Name=Neomutt Mail +Name=Mail Exec=/usr/local/bin/st -e neomutt %u diff --git a/.local/share/applications/zathura.desktop b/.local/share/applications/pdf.desktop similarity index 70% rename from .local/share/applications/zathura.desktop rename to .local/share/applications/pdf.desktop index 21e8c2b..8c38677 100644 --- a/.local/share/applications/zathura.desktop +++ b/.local/share/applications/pdf.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application -Name=Zathura PDF reader +Name=PDF reader Exec=/usr/bin/zathura %u diff --git a/.local/share/applications/rss.desktop b/.local/share/applications/rss.desktop new file mode 100644 index 0000000..6fafc4f --- /dev/null +++ b/.local/share/applications/rss.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=RSS feed addition +Exec=/usr/bin/env rssadd %U diff --git a/.local/share/applications/vim.desktop b/.local/share/applications/text.desktop similarity index 79% rename from .local/share/applications/vim.desktop rename to .local/share/applications/text.desktop index aa2284e..41ee05f 100644 --- a/.local/share/applications/vim.desktop +++ b/.local/share/applications/text.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application -Name=Neovim +Name=Text editor Exec=/usr/local/bin/st -e nvim %u diff --git a/.local/share/applications/transmission-remote.desktop b/.local/share/applications/torrent.desktop similarity index 70% rename from .local/share/applications/transmission-remote.desktop rename to .local/share/applications/torrent.desktop index b48e73b..f6d28d9 100644 --- a/.local/share/applications/transmission-remote.desktop +++ b/.local/share/applications/torrent.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application -Name=Transmission Addition +Name=Torrent Exec=/usr/bin/env transadd %U diff --git a/.scripts/tools/rssadd b/.scripts/tools/rssadd new file mode 100755 index 0000000..e90dcf2 --- /dev/null +++ b/.scripts/tools/rssadd @@ -0,0 +1,9 @@ +#!/bin/sh +! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && + notify-send -i "$PIX/rss.svg" "That doesn't look like a full URL." && exit +RSSFILE="$HOME/.config/newsboat/urls" +if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then + notify-send -i "$PIX/rss.svg" "You already have this RSS feed." +else + echo "$1" >> "$RSSFILE" && notify-send -i "$PIX/rss.svg" "RSS feed added." +fi