Hey,
My panels are minimized which is why I would rather use a keyboard shortcut to display the time on the screen, ideally the time would be presented for a couple of seconds and then disappear. The app can run from the command line which would mean that I would have to create a keyboard shortcut myself.
Anyone heard about something like that? Any alternatives? I could not find anything, many thanks.
Clock app that shows time when a keyboard shortcut is used
-
- Posts: 4
- Joined: Sun Aug 10, 2014 1:54 pm
Re: Clock app that shows time when a keyboard shortcut is us
Install dclock and then add a keybind in ~/.config/openbox/rc.xml like the following:
I used the key combo "super+o", since it was one of the few that I still had available and o=oclock . You could, of course, use anything not already used and works. You can even use dclock to set-off a pleasant alarm.
Code: Select all
<keybind key="W-o">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>time</name>
</startupnotify>
<command>dclock -date "%A %x"</command>
</action>
</keybind>
Re: Clock app that shows time when a keyboard shortcut is us
Code: Select all
snip
<command>urxvt -fn -*-terminus-bold-r-*-*-32-*-*-*-*-*-*-* -g 5x2+200+200 -e sh -c 'date "+%R" ; sleep 3'</command>
snip
-
- Posts: 4
- Joined: Sun Aug 10, 2014 1:54 pm
Re: Clock app that shows time when a keyboard shortcut is us
Thanks seppalta and drooly,
On my main fedora system I could not find dclock in the repository, but I run into xclock which works ok. However, on my laptop, on arch it was easy to add dclock so I use it on the laptop.
I would like to display only for a fraction of a second, and then kill it. However, I cannot seem to be able to do this with openbox and xbindkeys.
The closes I came was with xbindkeys, the following creates the test files as expected
`dclock -date '%A %x' &` && sleep 0.5 && touch ~/test
However, the final version does not work
`dclock -date '%A %x' &` && sleep 0.5 && kill `pidof dclock`
I might tinker with it later a bit.
On my main fedora system I could not find dclock in the repository, but I run into xclock which works ok. However, on my laptop, on arch it was easy to add dclock so I use it on the laptop.
I would like to display only for a fraction of a second, and then kill it. However, I cannot seem to be able to do this with openbox and xbindkeys.
The closes I came was with xbindkeys, the following creates the test files as expected
`dclock -date '%A %x' &` && sleep 0.5 && touch ~/test
However, the final version does not work
`dclock -date '%A %x' &` && sleep 0.5 && kill `pidof dclock`
I might tinker with it later a bit.
Re: Clock app that shows time when a keyboard shortcut is us
Code: Select all
<keybind key="F8">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>time</name>
</startupnotify>
<command>dclock -date "%A %x"</command>
</action>
</keybind>
<keybind key="F9">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>kill time</name>
</startupnotify>
<command>killall dclock</command>
</action>
</keybind>
Re: Clock app that shows time when a keyboard shortcut is us
Or, make up 3 shell scripts as follows:
Put them in ~/bin/, and use for command in your keybinding ~/bin/dclock3.sh. You can probabily replace "killall" with "pkill" if more convenient.
Code: Select all
dclock1.sh
#!/bin/bash
dclock -date "%A %x" &
exit
Code: Select all
dclock2.sh
#!/bin/bash
killall dclock &
exit
Code: Select all
dclock3.sh
#!/bin/bash
~/bin/dclock.sh &&
sleep 1 &&
~/bin/dclock1.sh &&
exit
Re: Clock app that shows time when a keyboard shortcut is us
Code: Select all
snip
<command>urxvt -g 5x2+200+200 -e sh -c 'date "+%R" ; read -n1'</command>
snip
i removed the x-font to make the command more generic; i guess you could use it with almost any terminal now.
you can even remove the blinking cursor, at least with urxvt, reducing the output to 1 line.