You are not logged in.

#1 2016-10-28 11:53:01

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

[SOLVED] Swatch Internet Time

I've recently been interested in Swatch Internet Time (or .beat time) and looking in the package manager, I was happy to find a few small applications which display internet time. Thing is, what I'd really like is to have the currant .beat time displayed next to the normal time provided by the time/calendar display which come with BunsenLabs, up in the top right corner of the screen. How (If I can) can I do this?

Alternatively, if I could display it in a conky that would be good too but I'm not sure how to go about doing that either.

(Also, I thought I had posted this before but I must have closed the tab before posting because it's not showing up in my History. I'm sorry if I have indeed posted this twice)

Last edited by Davy (2016-12-31 01:30:46)

Offline

#2 2016-10-28 12:06:56

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: [SOLVED] Swatch Internet Time

I'd probably start with finding some math to convert epoch (which is time-zone independent I guess) time to swatch. And the results should be easily usable at least in conky.
edit: or from UTC https://en.wikipedia.org/wiki/Swatch_In … om_UTC.2B1

Last edited by brontosaurusrex (2016-10-28 12:32:14)

Online

#3 2016-10-28 12:39:40

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

Ok. I've found where I would be putting any changes. In the Tint2rc file, there is this:

# Clock
time1_format = %H:%M
time1_font = Sans bold 11
#time2_format = %A %d %B
#time2_font = Sans 6
clock_font_color = #b5b5b5 100
clock_padding = 12 4
clock_background_id = 0
clock_lclick_command = gsimplecal
clock_rclick_command = gsimplecal

So I suppose I just need to do what you said in this file. I'll come back if I figure that out.

Offline

#4 2016-10-28 13:13:02

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

It would seem that all I have to do is Convert the time to .beats and then display it there, but I'm at a loss as to how to do it in this file. Is Tint2rc an xml file? If I knew what language it is I could learn about it, but as it is I'm a little confused

Offline

#5 2016-10-28 13:50:35

photonucleon
Thursday
From: out of that impossible sky
Registered: 2015-09-29
Posts: 299

Re: [SOLVED] Swatch Internet Time

Davy wrote:

It would seem that all I have to do is Convert the time to .beats and then display it there, but I'm at a loss as to how to do it in this file. Is Tint2rc an xml file? If I knew what language it is I could learn about it, but as it is I'm a little confused

I don't think you can have two clocks in the tint2 bar, so I think you'd have to choose what clock you wanted, or put one of them in the conky. As for tint2rc, it's a config file, not really a script so it isn't really in a 'language' like python, etc. Think of it as a list of options. You have a list of settings on the left of the equals sign and then the value for that setting on the right. Here's an example:

# Clock
time1_format = %H:%M

Here, the first line, beginning with "#", is not a setting, just a note to say that the following settings relate to the clock item in the tint2 bar. Next we have "time1_format", which is the setting for what to display in the clock item. "%H" stands for hours, and "%M" stands for minutes. Also, between them, we have ":", so the clock will display hours and minutes separated by ":". To change things, change what is on the right hand side of the equals sign.

More info: https://gitlab.com/o9000/tint2/blob/master/doc/tint2.md

Back up your tint2rc file before changing it in case something breaks wink I find that trial and error works well to begin with when learning configuring tint2, just because the options are so great! The config file for conky works in a sort of similar way, info here: https://github.com/brndnmtthws/conky/wi … n-Settings

Last edited by photonucleon (2016-10-28 13:53:19)


The servant lifted off a kind of ottoman a long peacock-blue drapery, rather of the nature of a domino, on the front of which was emblazoned a large golden sun, and which was splashed here and there with flaming stars and crescents. “You’re to be dressed as Thursday, sir,” said the valet somewhat affably.

Offline

#6 2016-10-28 14:21:10

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: [SOLVED] Swatch Internet Time

For tint2 you can proably use executor tag, see tint2 docs. You will need latest tint2 for that.

Last edited by brontosaurusrex (2016-10-28 19:51:20)

Online

#7 2016-10-28 14:31:54

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Swatch Internet Time

Some people also run a second tint2 for specific display formats for launcher, clock, battery monitor etc.

Also included in the tint2 package is the gui config tool, tint2config (IIRC that will make an automatic backup). Anyway, you can have as many *.tint2rc's as you like, and multiple configs can be run at the same time.

Menu -> Help -> Tint2

Last edited by damo (2016-10-28 16:45:48)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#8 2016-10-28 16:01:10

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

photonucleon wrote:

As for tint2rc, it's a config file, not really a script so it isn't really in a 'language' like python, etc. Think of it as a list of options.

Does this mean I can't have any logic or calculations in it? For converting the time from UTC to beat

Offline

#9 2016-10-28 16:44:57

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Swatch Internet Time

Yes. You can set the time format only, as you can see from @photonucleon's link to the Tint2 wiki (which is also in the Menu -> Help -> Tint2 item)

The recent Tint2 has an "exec" feature which may do what you need, but i haven't investigated that yet.

The easiest option might be a small conky window to just display the time in the format you need.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#10 2016-10-28 21:41:40

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: [SOLVED] Swatch Internet Time

I just had to do a little beats bash script, which has to return the same as this page.

Last edited by brontosaurusrex (2016-10-28 21:50:48)

Online

#11 2016-10-29 03:04:46

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [SOLVED] Swatch Internet Time

^ Which I used to make:
Screenshot_2016-10-29_03-58-31.th.jpg

This is using Conky v1.10, but the relevant code is the same

${execi 1 ~/.config/conky/scripts/beats.sh}

The conky window sizes are not set, so it resizes to the content.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#12 2016-11-02 08:40:12

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: [SOLVED] Swatch Internet Time

And tint2 integration.

Last edited by brontosaurusrex (2016-11-02 10:38:52)

Online

#13 2016-12-27 15:37:07

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

ah, great. I'll mess around with that script

Offline

#14 2016-12-28 03:09:30

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: [SOLVED] Swatch Internet Time

Alright - who put this thread in hide mode?

@ Davy - Nice topic!

@ brontosaurusrex - your script ROCKS!!!  I added the "@beats" in it so it ends with:

echo "@$beats.beats"

@ damo - new "clock.calendar @beats

----------------
${time %H.%d%n%M.%m%n%S.%y} ${execi 1 /media/5/Conky/scripts/swatch.sh}
----------------
------------------------------
${time @%x @%T} ${execi 1 /media/5/Conky/scripts/swatch.sh}
------------------------------

... just for fun cool
2016-12-28_000036_Scrot11.jpg


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#15 2016-12-30 21:44:55

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

I've been messing around trying to call brontosaurus' lovely script from the tint2rc file but when I try use execp it doesn't like it. Said it's not a valid option.

tint2 : invalid option "execp",
  upgrade tint2 or correct your config file
tint2 : invalid option "execp_command",
  upgrade tint2 or correct your config file
tint2 : invalid option "execp_interval",
  upgrade tint2 or correct your config file

Tried re-installing tint2 through the package manager, no joy.
Any idea why it's doing this? My first thought is that since the version of tint2 is so new, it's not in the package manager yet. If so: how can I install it?

Offline

#16 2016-12-30 22:18:19

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: [SOLVED] Swatch Internet Time

Davy wrote:

Any idea why it's doing this? My first thought is that since the version of tint2 is so new, it's not in the package manager yet.

Yes, that is correct.

If so: how can I install it?

The current author of tint2 is a forum member here and started a thread introducing the new version:

https://forums.bunsenlabs.org/viewtopic.php?id=1151

To install it, use:

sudo apt install git cmake build-essential libcairo2-dev libpango1.0-dev libglib2.0-dev libimlib2-dev libgtk2.0-dev libxinerama-dev libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxrandr-dev librsvg2-dev libstartup-notification0-dev
mkdir ~/builds/ && cd ~/builds
git clone https://gitlab.com/o9000/tint2.git && cd tint2
git checkout 0.12.12
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
make
sudo make install

The `cmake` line ensures that the new tint2 binary is placed at /usr/local/bin/tint2 -- this will keep the stock tint2 binary intact but will be loaded in preference thanks to the $PATH setting.

Last edited by Head_on_a_Stick (2016-12-30 22:29:22)

Offline

#17 2016-12-30 23:29:33

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

Amazing! I'm over the moon. All set up, just in time for the 999th beat!

screenshot-301216-225956.php

I popped this

execp = new
execp_command = bash ~/.config/tint2/beat.sh
execp_interval = 1
execp_font = Sans bold 11
execp_font_color = #b5b5b5 100

in the tint2rc file.

One interesting development is that now that it's ticked over past 1000 it just keeps counting. Running the script from the terminal does the same. Right now it's at 1013. I'll leave it for a while and see what happens. I'd be especially interested to see what happens when it approaches 1000 again.

Offline

#18 2016-12-30 23:53:44

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: [SOLVED] Swatch Internet Time

@Davy: I'm really sorry but I completely forgot that the newer version of tint2 is available in our own backports repositories  :8

https://www.bunsenlabs.org/repoidx.html … orts-tint2

It can be installed from there by first adding the repository:

sudo tee /etc/apt/sources.list.d/bunsen-backports.list <<< "deb http://pkg.bunsenlabs.org/debian jessie-backports main"

Then update the package database and install with backports targeted:

sudo apt update
sudo apt install tint2/jessie-backports

However, you will have to remove the custom binary for the newly installed version to be loaded:

sudo xargs rm < ~/builds/tint2/build/install_manifest.txt

Once more, sorry about the misinformation.

EDIT: be sure to run the `sudo xargs rm` command *before* installing the new version from the BunsenLabs repoositories as the command will delete the package's man pages and suchlike otherwise.

If you have run the `xargs` command after installing the official tint2 backport then simply use `sudo aptitude reinstall tint2` to get the proper files back.

As an aside, this does illustrate rather well why the package manager should always be preferred whenever possible big_smile

Last edited by Head_on_a_Stick (2016-12-31 01:13:16)

Offline

#19 2016-12-31 01:29:38

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: [SOLVED] Swatch Internet Time

No worries. I've done that and it's working grand. It's currently displaying @92 beats: I think the problem with the @beats going over 1000 was to do with daylight saving hours, because during the winter, 0 beats != 12:00 midnight. I'm just guessing this because it fixed itself when it went past one o'clock. I'll try figure out Brontosaurus' script and come up with a fix later, but it doesn't matter too much, because it only affects one hour after midnight and even then (theoretically) only for half the year.

Also, as a side note, thank you very much @Head_on_a_Stick for your help. Looking through my posted threads, you've posted a very helpful response on nearly all of them! I appreciate it.

Offline

#20 2016-12-31 09:34:51

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: [SOLVED] Swatch Internet Time

UTC shouldn't be affected with DST.  Some other bug must be present.
edit: Check the new (hopefully fixed) version, same link.

Last edited by brontosaurusrex (2016-12-31 17:17:56)

Online

Board footer

Powered by FluxBB