Important:
•Not interested in anything illegal, politics, drugs, racial discussion, harassment.
The above disclaimers address frequent incorrect assumptions about me that are important to distinguish.
Technology (Tutorials, Opinions, & More) Technology Repair Log Download Ashley-ware today! I'm making some desktop widgets for Linux systems. These are made as practice and experience for trying out different scripting languages and programs. More coming in the future. Animated Christmas Tree Desktop Widget A simple widget that functions using Conky. Click and drag the tree anywhere on your desktop. Click here to download I made a tutorial for this project. Click here to read about how you can make your own click-and-drag desktop widget for Linux. It can be as easy as using my .config file. Blue Christmas | Linux GTK3 Theme
Click here to download Conky Animated Christmas Tree Countdown
My experience behind creating this: Here is my very first Conky creation. I read in numerious places that Conky is intimidating, hard to install, and hard to wrap your mind around. From my experience, it was very easy to install and to tinker with. I installed Conky using the terminal (I'm using Arch), using: yay -S conky. You may need to use pacman to install your packages, but I use Yay to install from the Arch User Repositories. After installing, I tried running Conky in the terminal with simply "conky". From this command, I was informed that Conky was looking for a config file to run. I created a text file in my home directory called ".conkyrc". Within that config text file, I input the text to display my ascii Christmas tree, along with some other system information, such as the date and time. Since this was my first ever Conky creation, I had no prior knowledge on how to create *anything* in Conky, which uses lua as it's scripting language. Understanding what and how to write in the Conky config in order to display system information is very easy. You can read the manual pages for Conky, or find a tutorial online which will give you a basic grasp on how things are done. I prefer to look at another person's creation and tinkering with it, as it's personally how I learn best -- hands on. I highly recommend this tutorial: https://forums.tomshardware.com/faq/how-to-write-a-conky-config-file.1564963/ After tinkering with the original config file and reading the tutorial, I had a pretty good grasp on how things were done. At this point, I could refer to the manual page to search for the other inputs; such as what you should type into your config file to have a certain output. While it was pretty smooth sailing, I wanted a count down displayed under the tree. I wanted to calculate and input how many days from today until Christmas. Conky can display the output of scripts, and scripting is not something I had learned much about. Even setting up my website and installing Peertube, I didn't have to write any scripts myself. I followed tutorials, and most everything I had to do was one liners at the terminal prompt, which is very easy and I do all the time. For a while I wanted to have a purpose to start learning scripting; and I was glad to finally have a reason to learn. I found that either perl or bash scripts would best fit the countdown timer. I decided to go with bash scripting, as I think it could be used more frequently in certain other scenarios (at least in my case). Don't make fun of me for not learning bash scripting sooner; we all have to start somewhere. Anyways, I searched up countdown timers for bash. I found a guide on how to do exactly what I was looking for. This is the guide: https://www.networkworld.com/article/3487712/counting-down-the-days-using-bash.html. I first made a text file in my home directory called "countdown.sh". I input the script from the tutorial into this script, then I had to made the script executable in order to function. To do this, I ran the command "chmod +x countdown.sh" to make it executable. Now that I had the countdown script, I had to tell Conky that I wanted it to reference the bash script. I had to write "${exec ~/countdown.sh}" into Conky for it to understand we want to read the bash script. After I saved my config file, the countdown was working at intended. After I confirmed it worked, I then went to the step-by-step tutorial to understand exactly what was going on in the script, understanding the "whys and hows". I didn't want to simply input a srcript and call it good; I wanted to understand exactly what was happening and why. I understood it pretty well, though I think I would need more practice with similar time-based projects to understand it even better. My last hurdle was trying to get the Christmas tree animated. I thought writing a bash script would be best to accomplish this. I wrote a bash script which would run a while loop (ex. "while this is true, do X"). Basically, I wanted it to say: display this first file, which is the first version of the ascii tree. Then after this, display the second version of the ascii tree. While I could get this to function when running the bash script in my terminal, I couldn't get it to run in Conky. I looked and found someone running into this exact same issue online. Read here: https://crunchbang.org/forums/viewtopic.php?id=33343 This thread offered the solution I was looking for; and it was a lot simpler than what I was doing to begin with. I didn't need a bash script at all to animate the tree. I ended up with a slightly altered version of what is mentioned in the thread for my Conky config. Here's what I did: ${if_updatenr 01} I did not reference a text file, as I couldn't get the color to display in Conky when writing a text file. Conky was displaying exactly what was written in the text file; so ANSI color codes became, well, just plain text. Colors would not display. You can input regular text after the "if" statement in the Conky config and the colors will work. Sometimes things are simpler than you make them out to be. I needed to configure how fast/often the Christmas tree's lights were animating. I made the update interval once every second with "update_interval 1.0", and since this made the window flash between refreshing, I had to add "double_buffer yes" to negate the flickering between refreshes. Everything works as intended. So, there is the story of my very first endeavor into creating my very first desktop widget. Overall, I learned a lot and had a good time creating this Christmas tree. Yes, it looks very simple, but I very much enjoy text-based applications. They are simple, easy on the eyes, and remind me of a simpler computing time, the 90's and early 2000's. I understand this is probably child's play to some of you, but none of us come out of the womb knowing how to do this. I also wanted to write my experience from a beginner's perspective, because it may help others realize that customizing such things are not difficult; even if everyone online is saying it is. If you run into an issue, do not give up. Search online for the errors you may be getting, reference the Arch wiki even if you don't use Arch, search for forum posts, as there are likely people asking the same questions you are. This is how we learn. Here's the great thing about Linux: regardless of the distro you use, you can still find valuable information from users using other distros. A lot of the Conky information I discovered was from Ubuntu users, but the information was still valid for an Arch user. Don't be afraid to visit websites dedicated to other distros, since they are using software made for Linux, they usually can work similarly between distros. I also found various forum posts well over a decade old that were still helpful to me today. Open source is fantastic because it allows us to easily learn and share with others. I have plans to use Conky for more things in the future, such as a clock or calendar. I would also like to learn how to create a GTK3 theme; but from a curosry glance it seems pretty invovled, so that may be set aside for another month.
|