zsh.li Linux Blog My Memories About ?

Dear My


World clock in awesome

awesome systray
Awesome systray

For displaying multiple clock in awesome with different timezones we need to create new clock widgets, this post is based on awesome 4.2, you will need to create a new widgets in ~./config/awesome with the following code: utc.lua

It has just two differences with the original textclock.lua widget, here the diff output from these two files:

<     format = format or " UTC:  %H:%M || "
>     format = format or " %d local: %H:%M "
<    timezone = timezone or TimeZone.new("Z")
>    timezone = timezone and TimeZone.new(timezone) or TimeZone.new_local()

I'm not a programmer, but I read the programmer Documentation and modified the code accordingly, I only was able to understand that the parameters after the OR operand was true and I don't know why, but my code works.

Its important to notice that you have to specify the timezone name in the format variable in order to show the clock's name, check the bold text in the diff output above.

The most important thing to do is to replace the Z in the TimeZone.new("Z") function, Z is the UTC timezone, in the case of Argentina the timezone would be: TimeZone.new("America/Buenos_Aires")

Then edit your ~/.config/rc.lua file and search for this string:

mytextclock = wibox.widget.textclock()

In order to use the widget we have to pass the function into a variable, so if we have the Argentina and UTC clocks besides the local one, it will look like this:

mytextclock2 = textclock2()
utc= utc()
mytextclock = wibox.widget.textclock()

Finally search for the widgets wibox session and add the declared variables there:

-- Add widgets to the wibox
    s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            layout = wibox.layout.fixed.horizontal,
        s.mytasklist, -- Middle widget
        { -- Right widgets
            layout = wibox.layout.fixed.horizontal,

Slackware and recording an iso image

How to record a DVD in Slackware

Slackware includes the command growisofs by default, however, it cannot be run as root, so you have to be in the cdrom group.

In order to record an iso I run the following command:

growisofs -dvd-compat -Z /dev/dvd=iso.iso

And it started burning the image in a very high speed, 24x, the DVD disk says that 16x, indeed I prefer to use a lower speed like 4x for recording; thus, the when it finished the burning, the file in the disk was corrupt, so I recommend you to specify the speed reasonably while using this command.

For doing that use the parameter speed and specify number that is the x speed


Simple script for looking up words in the Terminal

When I'm reading a book there is a lot of new words that I look up in a dictionary, and it would be great to create a list of the words that I'm learning, so I do both looking up and making that list really using this script I wrote.

I use the wordnet command line utility (wn) for looking up words in English, alternatively you may use sdcv that is another useful command line utility, you only have to modify the code between parenthesis in line 5:

#! /bin/bash
while true; do
read -p "Enter a word " WORD
a=$(wn "$WORD" -over)
echo "$a"
if [ ! -z "$a" ]; then
echo $WORD >> words

This code verifies that the word exist in order to add the word in the list, when the word do not exist is returned a blank output.


Some days ago I learned how to subtitle a Video with hard-subs; even tough I achieved to do it in this way, I think there may exist a more straightforward method. I would have used kdenlive but since I use Gentoo I think a command line method is the correct one because I want to avoid everything related to KDE in my Gentoo.

Step one. Create an mp4 with soft-subs:

The additional step I did was because I needed to specify the encoding for my Spanish subs (ISO-8859-1) , because if you try only the burn the subtitle using only the second step it will ask you to use -sub_charenc parameter.

The maps parameters are important since they mean that the video track plus the subtitle track and the audio track will be all included.

ffmpeg -i mozart.mp4 -sub_charenc ISO-8859-1 -i Desktop/Mozart.And.The.Whale.2005.LiMiTED.DVDRip.XviD-LiNE.srt -map 0:0 -map 0:1 -map 1:0 -vcodec copy line-mozart.mp4

Step two. Create the hard-subs

ffmpeg -i line-mozart.mp4 -filter:v subtitles=line-mozart.mp4 out.mp4

Recording the screen with the terminal.

Today I’m so excited because I learned how to record the screen without installing anything, all you need is ffmpeg, however the best is to use an existing profile of video as the kdenlive in order to get out the best of youtube experience.

I feel like I wasted my time install the gtk screenrecorder

ffmpeg -f x11grab -s 1440:900 -r 30 -i :0.0 -vcodec libx264 -f mpegts /tmp/hola.ts

And also the recording seems too pretty c:

Rss feed of the category