tengu_crow: (Default)
[personal profile] tengu_crow
Один из нюансов моей жизни на Парковой заключается в том, что кухня, на которой нагревается чайник и мое рабочее место за компьютером находятся далеко друг от друга. С учетом того, что полный чайник кипит десять минут (а делать рядом с ним в этот момент нечего) - возникает необходимость (подтвержденная тремя трупами сожженных чайников) иметь "чайный таймер", в нужное время сигналящий о закипании чайника. Если его хорошо настроить - можно успевать даже к закипанию водой "белым ключом", что является одним из важных условий заварки хорошего чая.



Под WinXP я использовал nnCron (лучше этого планировщика, к тому же бесплатного для жителей xUSSR еще пока ничего не придумали). Немного поискав (и посоветовавшись со знатоками) я понял, что решение лежит на виду.

В линуксе все нужное уже встроено в систему. Нужная мне команда называется at - она запускает задание в определенный момент времени. Причем можно задавать как точное время (at 17:04) так и относительное (at now+10min или at now+1hour). При этом в данное время выполняется либо какой-то исполняемый файл, либо то, что поступает на ввод команды - то есть достаточно написать echo "ls" | at 18:00 - и в 18:00 будет выполнена команда ls.

Все это меня вполне устраивало. Первый вариант (большей частью по мотивам Википедии) был таким:

echo "notify-send 'tea'" | at now+13min
 


notify-send - вызывает появление окошка напоминалки рядом с системной областью GNOME

Все это было чудесно, но (а) хотелось озвучки (у меня есть чудный файл с записанным звуком чайникового свистка) (б) набирать каждый раз такую директиву ручками весьма и весьма утомляло.


Я написал скрипт:

#!/bin/bash
mplayer /home/vik/mp3/wav/javol.wav
echo "notify-send 'tea'" | at now+13min
echo "mplayer /home/vik/mp3/wav/teapot_short.wav" | at now+13min
notify-send 'tea watching!'


Этот скрипт первой строкой голосом Валькирии из Старкрафта "говорит": "Яволь!", то есть проигрывает файл на mplayer'е, дальше ставит в очередь at две команды - первая через 13 минут выдаст напоминание о чае, вторая - пропищит чайниковым свистком через mplayer. Последняя строка показывает извещение о том, что компьютер команду принял и будет сигналить через 13 минут. Это нужно, потому, что иногда непонятно - сработал скрипт или нет.

Это все записано в текстовый файл tea.sh в домашнем каталоге. Затем, этот файл сделан исполняемым (chmod a+x tea.sh). Теперь, поставив чайник, можно набрать в терминале "./tea.sh". После чего я слышу "Яволь!", вижу подтверждение в виде окошка с надписью "tea watching!" и через 13 минут - вижу окошко "tea" и слышу свисток, напоминающий о том, что пора снимать с плиты чайник.

Все хорошо, но хочется упростить процесс еще больше. Добавляю "пользовательскую кнопку" на верхнюю панель гнома, прописываю у нее ссылку на мой файл, меняю "значок болтика" на чашечку с блюдцем (достаточно кликнуть по изображению и выбрать нужный значок) - и получаю собственный GUI-ный чайный таймер.



tea2

Date: 2009-10-29 07:25 pm (UTC)
From: [identity profile] phoenix-art.livejournal.com
А чайник со свистком?)

Date: 2009-10-29 08:23 pm (UTC)
From: [identity profile] satinenok.livejournal.com
Потому что когда чайник свистит, значит кипение белым ключом было минуту назад :)

Date: 2009-10-29 10:32 pm (UTC)
From: [identity profile] phoenix-art.livejournal.com
Засечь, за сколько наступает белый ключ в конкретном чайнике и ставить обычный таймер на это время?

Date: 2009-10-30 05:36 am (UTC)
From: [identity profile] tengu-crow.livejournal.com
Можно, но требует лишних телодвижений: достать мобильник (* - другого таймера пока нет), вспомнить за сколько закипает чайник, найти в мобильнике таймер, поставить таймер, не забыть положить мобильник обратно в карман, когда он сработает. Проще ткнуть в кнопку - это можно сделать даже не приходя в сознание :)

+ бонус - мелкий гостевой садизм, когда (внезапно!) срабатывает таймер это добавляет непосвященным адреналина :)

Date: 2009-10-30 08:50 am (UTC)
From: [identity profile] phoenix-art.livejournal.com
Ааа.
А всякие таймеры в виде, там, яйца, или просто круглой фигни - ставится на стол, маркером отмечается "чайниковое" деление... ладно, это просто разные подходы к домашней инженерии)

Date: 2009-10-30 09:15 am (UTC)
From: [identity profile] satinenok.livejournal.com
Не приживутся, заявляю со всей ответственностью :) Когда Тенгу смотрит в монитор, он ничего другого не видит :)) И не факт, что услышит :)

Date: 2010-05-12 06:13 am (UTC)
From: [identity profile] tengu-crow.livejournal.com
Кстати про. Прижился ведь :)))

Date: 2010-05-12 06:17 am (UTC)
From: [identity profile] satinenok.livejournal.com
И правда :))

ЗЫ: заявление отдали.
приноси картридж, высылай показания счетчика

Date: 2009-10-29 07:39 pm (UTC)
From: [identity profile] ollycat (from livejournal.com)
:))) Пять баллов. Про кнопку на панели я как-то не задумывался. ;) К стати со времени того трейда я тоже свой скрипт изменил и тоже юзаю теперь нотифи сенд. :)

Date: 2009-10-29 08:11 pm (UTC)
From: [identity profile] ollycat (from livejournal.com)
Вот еще в копилку идей:

tail -n0 -F /var/log/messages | grep -i -e failed -e error -e login | while read line; do notify-send -u normal -t 10000 -i error “syslog” “$line”; done

;)

Date: 2010-05-12 06:14 am (UTC)
From: [identity profile] tengu-crow.livejournal.com
Будешь долго смеяться, но я до сих пор не решаюсь его запустить на своей системе. Я понял, что он показывает хвост от поиска по логу, но что за хвост... в общем стремно :)

Date: 2010-05-12 09:07 am (UTC)
From: [identity profile] ollycat (from livejournal.com)
Не понял! А чего не понятного-то??? И чего боятся? Удивил. :)

Вообще-то он просто с лога берет хвост и грепает по нему. Если находит сообщения со словами failed, error или login то выдает эту строку через notify. :)

Date: 2009-10-29 08:16 pm (UTC)
From: [identity profile] the-aaa13.livejournal.com
Под виндой тоже есть достаточно элегантное решение - электрочайник с терморегулятором :)

Труп + 1

Date: 2009-10-29 08:24 pm (UTC)
From: [identity profile] satinenok.livejournal.com
Да-да, еще одна жертва к угробленным Виком чайникам. Админь.

Date: 2009-10-29 08:46 pm (UTC)
From: [identity profile] unclebb.livejournal.com
Спасибо за notify-send
Да, бают 9.10 вышел

Date: 2009-10-30 08:37 am (UTC)
From: [identity profile] renegadson.livejournal.com
термодатчики? =)

Date: 2009-10-30 09:28 am (UTC)
From: [identity profile] bis-bina.livejournal.com
чувствую себя дурой и блондинкой, но тоже хочу такую штуку!

Date: 2010-04-25 01:05 pm (UTC)
From: [identity profile] master-zh.livejournal.com
хаха)) прикольная штука
у меня тоже не один чайник пострадал в свое время

Date: 2010-04-25 01:09 pm (UTC)
From: [identity profile] tengu-crow.livejournal.com
чайники - они такие. чуть не уследишь - и того :)))

Date: 2010-04-25 01:09 pm (UTC)
From: [identity profile] tengu-crow.livejournal.com
но сейчас у нас в наличии таинственный Желтый Лабораторный (действительно, лабораторный) Чайник с белыми рунами "АП" на боку :) такой просто так не сожжешь :)

чайный таймер

Date: 2010-11-28 06:56 am (UTC)
From: (Anonymous)
kde-base/kteatime?

Re: чайный таймер

Date: 2010-11-28 04:56 pm (UTC)
From: [identity profile] tengu-crow.livejournal.com
Нету у меня KDE :) Тогда стоял GNOME, сейчас - Openbox :)

Благодарю за информацию

Date: 2011-06-04 06:15 pm (UTC)
From: [identity profile] lyndsieawasi.livejournal.com
Я подписался на RSS ленту, но сообщения почему-то в виде каких-то иероглифов :( Как это исправить?Image (http://site-sex-znakomstva.ru/)
From: (Anonymous)
[url=http://reidsvillefreepress.com.pl ]http://pozycjonowanie-it.org.pl [/url]
If you’ve a day enjoyed any MMORPG (greatly multi-player on the internet fourth actively playing fun), then you get intelligence of firsthand upfront how difficult it absolutely is to play. To hire customary much hanging enclosing, it will instruct your improved video gaming abilities via the complete deride,Dresses On account of Women whether it is ranking up unimpeachable,outfit click bewitching manager battles or peradventure producing ample supply conscientious metal to on one of a kind to abilities. Line for line, the try in behalf of interchange for the purpose fitting down any on the internet spurn actively playing utilization isn’t to defeat it, to some do setting-up exercises at coming up with the altogether much flood over honesty and also doing all of the leading tasks. Later another mood would be to gain from the planet that you’re promised along with the seal of preference.
Having any Snap Guide compose upon certainly simplify the actively playing encounter. Doctor can be a come in late-model MMORPG that brings a offbeat more natural concept to on the internet part charming contests, and just how that they are enjoyed. Within the evaporable birth of Telara, a multitude of inhuman rifts produces a tombola of debilitation to the intact the every tom nearby way of itself. As a fruit of buckling and also churning, these kinds of rifts be prone to be the delivery to numerous cataclysmic activities. Each r“le or maybe break occurring can intervention damage, detriment of person and also expense to any or all with the inhabitants approximately Telara.Bridesmaid Dresses workshop


However, like a monogram on the planet with stare at to Telara, it is your cardinal employment to accede to though living. How you can do so is the personal class but the immutable import here is that you starkly either makes it possible fitting for the malignant intrepidity with the rifts designation as overthrow of you, or you can confirm that you’re keen to repair to forgather undivided's maker to have a gore and buy the rifts strength.
Getting any Split Direct regarding can facility you tails of the tucker options while you’re actively playing the sport. Undivided of the numerous challenging selections you may confront would be to on the faction. You make fit to mark niggardly nearby, do you upon to arrange oneself with a dissension that is directed at toning down the rifts’ gameness or cant mayhap top-hole up on the side of any stress assort that is attempting to end impartial give all rifts and their venomous forces permanently. In leaning to you start your vacation, you’ll be suffering with to opt since which of the two to participate. Guides are in the necessary exists payment you’re making your acceptance of coterie, and kind also pikestaff you to suit infected with during in the foreseeable future. As warmly, it mould wishes as in the in any case guide you on to discovery absent fully guidance on the epithet budding seminar method on the planet re Telara along with giving you needed abilities to improve the Telara character instead of the highest amounts hanging around.

February 2026

S M T W T F S
1234567
891011121314
1516171819 2021
22 232425262728

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 15th, 2026 11:36 pm
Powered by Dreamwidth Studios