Thank you for visiting!
My little window on internet allowing me to share several of my passions
Categories:
- OpenBSD
- vdcron
- My Sysupgrade
- FreeBSD
- Nas
- DragonflyBSD
- fapws
- Alpine Linux
- Openbox
- Desktop
- Security
- nvim
- yabitrot
- nmctl
- Tint2
- Firewall
- VPN
- Project Management
- Hifi
- Alarm
Most Popular Articles:
Last Articles:
My calendar to schedule meetings
Posted on 2018-08-11 19:17:00 from Vincent in OpenBSD Desktop Tint2
As you know, I'm using Openbox + Tint2 on OpenBSD. Tint2 is a very nice panel bar which has lot of flexibility. On this page I'm presenting my calendar application which allow you to copy/paste the selected dates.
I do no know if this will be useful, but it was fun for me to develop it. I spent only few hours to have it. And it's rare to mention, it runs on windows too.
Introduction
On Windows machines, you click on the clock and a calendar pops up.
This is a very small feature, but, it's when you don't have it, that you see how frequently you use it.
So, Today, I've decided to write a simple calendar with tkinter and configure it into my Tint2 config file.
Why did I build a calendar application ? Simply because, I'm very lazy and want that this tool allow me to copy/paste selected dates.
For one of the rare case, this application runs on OpenBSD and Windows.
I've tested it on OpenBSD 6.3, but it should run on any Posix machines. And I've tested it on Windows 10 too.
What is specific with my calendar ?
This small application allow you to select any dates.
Then you can click on "Ctrl-c".
This action copy the selected date in your clipboard.
You just have to hit "Ctrl-v" in your document, email, ... to paste the selected dates in a text format.
Samples
Here after some samples to show what this ctrl-C does:
The paste command will produce this text: "between Wednesday 15 and Friday 17 of August".
The paste command will produce this text: "between Tuesday 07 and Thursday 09, between Wednesday 22 and Friday 24 of August"
The paste command will produce this text: "on Tuesday 07, on Thursday 09, on Tuesday 21, on Thursday 23 of August"
The paste command will produce this text: "between Tuesday 07 and Thursday 09, on Tuesday 21, on Thursday 23 of August"
For sure depending on the context, you should add a "or" or "and" in the final text.
Install
Pre-requisites
You need to have Python3.6 with tkinter.
On OpenBSD, you just have to type:
pkg_add python python-tkinter xclip
On Linux machines, I refer you to your package manager to install those packages
Please make sure that xclip is in your PATH.
On Windows, install the Python3.6 package.
Install
You can have the source code here
On OpenBSD (or other linux machines), you just have to type:
tar -xzvf mycalendar.tgz
cd mycalendar
doas make install
On Windows, I let you imagine how to do it. On my case, I just did an unzip and click on mycalendar.py (because .py is associated to Python.exe)
In short, you unzip and click on mycalendar.py
How it work ?
The tool use xclip on Posix machines and the command clip on Windows machines to transfer the selected dates into the clipboard.
Without those commands, it will not work.
How to integrate it on Tint2
To integrate it in tint2, you just just have to add it in the configuration file.
Either you use tint2conf and look for "clock" tab. Then add "mycalendar" in "Left click command".
Either, you adapt the following line in your tint2rc file:
clock_lclick_command = mycalendar
Simple. No ?