Skip to content

Commit 46749cd

Browse files
committed
feat: change curl dependency to wget
This commit changes the dependency on curl to wget since this is installed by default on most linux systems. Additionally documentationw was added to explain that wget is needed for the telegram feature.
1 parent fd7bac7 commit 46749cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Put both `set -g @tnotify-telegram-bot-id 'your telegram bot id'` and `set -g @t
7474

7575
- `prefix + ctrl + alt + M`: Start monitoring a pane, return it in focus and notify in bash and telegram when it finishes.
7676

77+
> **Warning**
78+
> This feature requires [wget](https://www.gnu.org/software/wget/) to be installed on your system.
79+
7780
> **Note**
7881
> You can get your telegram bot id by creating a bot using [BotFather](https://core.telegram.org/bots#6-botfather) and your channel id by sending your channel invite link to the `@username_to_id_bot` bot.
7982

scripts/helpers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ telegram_available() {
5151
# Send telegram message
5252
# Usage: send_telegram_message <bot_id> <chat_id> <message>
5353
send_telegram_message() {
54-
curl "https://api.telegram.org/bot$1/sendMessage?chat_id=$2&text=$3" &> /dev/null
54+
wget --spider "https://api.telegram.org/bot$1/sendMessage?chat_id=$2&text=${3// /%20}" &> /dev/null
5555
}
5656

5757
# Send notification
@@ -71,7 +71,7 @@ notify() {
7171
if telegram_available && (telegram_all_enabled || [ "$2" == "true" ]); then
7272
telegram_bot_id="$(get_tmux_option "$tmux_notify_telegram_bot_id" "$tmux_notify_telegram_bot_id_default")"
7373
telegram_chat_id="$(get_tmux_option "$tmux_notify_telegram_channel_id" "$tmux_notify_telegram_channel_id_default")"
74-
send_telegram_message $telegram_bot_id $telegram_chat_id "$1" &> /dev/null
74+
send_telegram_message $telegram_bot_id $telegram_chat_id "$1"
7575
fi
7676

7777
# trigger visual bell

0 commit comments

Comments
 (0)