Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Customized alarm/timer with your favorite music from Linux terminal

  • CommandLine Craft
  • 2024-08-24
  • 17
Customized alarm/timer with your favorite music from Linux terminal
  • ok logo

Скачать Customized alarm/timer with your favorite music from Linux terminal бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Customized alarm/timer with your favorite music from Linux terminal или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Customized alarm/timer with your favorite music from Linux terminal бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Customized alarm/timer with your favorite music from Linux terminal

Timer with custom song alert in bash terminal Linux
---------------------------------------------------------------------------------------
#!/bin/bash

total_minutes=$1

while [ $total_minutes -gt 1 ]; do
sleep 1m
total_minutes=$(( $total_minutes - 1 ))
done

if [ $total_minutes -eq 1 ]; then
sleep 1m
$(nvlc /absolute/path/to/your/music/file)
else
echo "Only numbers greater than or equal to one minute is allowed."
fi
-----------------------------------------------------------------------
Hello viewers today I am going to show you a bash script that can be used as a timer that plays a song of your choice. For this you need to have a media player that can be evoked from the bash. If you have vlc player installed it should be enough. To make sure just type
nvlc path/to/your/music_file
If the music plays you are good to go.
I would also recommend saving the bash script in a separate place where you only save scripts so that it doesn’t get mixed with other files. A dedicated folder would be a good idea.
Let’s use this script to set timer for 1-minute. The script accepts input that is more than or equal to one minute. There is no upper limit and the input is always in minutes.
First we need to set up our Linux machine to execute this script, there are some ways.
I am going to use
chmod +x /path/to/script
This will give the script execute permissions. To run the script just use /absolute/path/to/script minutes
The syntax is the path to script followed by a space and the minutes value for alarm.
I use absolute path to minimize errors. This is a simple script, and I hope this gets you intrigued about bash-scripting.
Now let’s see how the script works:
The script uses the "sleep" function and a "while" loop and and an "if" conditional statement.
The variable “total_minutes” stores the minutes value. The while loop iterates reducing one minute at a time as long as the value of “total_minutes” is greater than one.
When the “total_minutes” value becomes equal to one, then the if condition takes over and sleeps for a minute and finally the “nvlc” command plays your favorite song. The else statement catches wrong input for example input lesser than 1.
There are many things you can do using bash. And I will post more of such scripts.
-----------------------------------------------------------------------------------------------------------------------------------------------------
Thank you for watching and if you found the content useful consider hitting the like button and subscribe.
-----------------------------------------------------------------------------------------------------------------------------------------------------

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]