A World Clock Plugin for XFCE Written in Python
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
GTK Theme: Orchis-dark, Icon Theme: Colloid
After switching to XFCE I was amazed at the speed of everything. But one thing that I really miss from KDE or GNOME is the World Clock. I have never worked with GTK or any such Toolkit ever. So with my very very minimal knowledge of GTK I made a fix for it using the AppIndicator. But That was taking up precious space in my vertical panel. So I decided to make a plugin from it. But making an XFCE Planel Plugin using Python (My Speciality) is very poorly if not at all documented. But finally I found a project on gitlab and used that as a Base. Much thanks to the creator of that project.
To get a local copy up and running follow these simple example steps.
I am on EndeavourOS and most of the required libraries were preinstalled. I had to install pip, meson and ninja
sudo pacman -Sy python-pip meson ninja
If you are on Ubuntu or an Ubuntu Based Distro then you can install the dependencies with this
sudo apt-get libxfce4panel-2.0
sudo apt-get install python-gi-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install meson ninja
Then install the required the Python Packages.
pip3 install -r requirements.txt
Then You can test it by running this command from the project directory.
python3 run.py
If you see it working when you run python3 run.py
then you can install it by doing
bash install.sh
Updating is pretty simple. You just need to go to the project directory and do
git pull
This will sync the changes from the github repo to your local machine. It is recommended that you run
python3 run.py
Just to make sure everything is working. Then you run the install script
bash install.sh
This will update the plugin. Sometimes it might require restarting the panel (xfce4-panel -r
) to see the changes take effect.
Running it first time will automatically create the config files at
~/.config/world_clock_plugin@hanzala123/
You can open the configuration window for this the same way as other plugins.
This is the format in which the time will be shown in the panel. The convention is the one used for formating string in Python's DateTime Module. More about that here.
This the the format in which the date will be displayed on the world clocks. The same convention is used here as well.
This is the place where the calendar/world clock window will appear. By default it set to auto
. Which shows the Calendar next to the plugin when clicked. It can also be set to show at a specific location on the screen. The value should be comma separated X and Y coordinates of the place the calendar will appear. Something like this 0, 0
will show the calendar in the top left corner of the screen (or as close as possible to that).
Here all the currently configured timezones will appear. To delete a timezone click on the timezone and once it is selected click on the 'Delete' button.
You can use this section to add new timezones. To do so first select the area from the left most dropdown selector. Then select the region from the second left most dropdown selector. Finally click on the 'Add' button to add the selected timezone.
PS: YOU MUST CLICK ON THE 'Apply' BUTTON FOR THE CHANGES TO BE APPLIED AND SAVED.
After Following the previous steps it's pretty simple to use it like any other panel plugin.
- Make GUI for Configuration.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPLv3 License. See LICENSE
for more information.
Project Link: https://github.com/hanzala123/world-clock-xfce-plugin