📜 ⬆️ ⬇️

Pleasant trifle for habracheloveka

If it so happened that I began my existence on Habré from the topic of how to create a plasmoid, it would be rather strange if I ended up not writing this as a logical development of that article. And finally, everything turned out. And not something, but Habraplasmoid, reflecting the karma and rating of the selected user! :)

image


')
Further instructions for those who want to try it.

1. Download and unpack the source file habraplasmoid.tar.gz .
2. Before collecting, make sure that the system has kdesdk, kdebase-devel, kdelibs-devel, cmake, curl-devel, expat-devel.
3. Go to the folder 'habraplasmoid' and collect:

cmake -G"Unix Makefiles"
make


4. Copy the files:

sudo cp -v habraplasmoid.desktop /usr/share/kde4/services/
sudo cp -v lib/plasma_applet_habraplasmoid.so /usr/lib/kde4/


For users of 64-bit distributions, the last line will look different:

sudo cp -v lib/plasma_applet_habraplasmoid.so /usr/lib64/kde4/


5. We inform the Plasma about yourself:

kbuildsycoca4


In some cases, you have to restart the plasma.

6. Add a plasmoid to the desktop:

image

After that we will see something like this:

image

7. Perform customization:

image

8. Done.

By the way, in the process of debugging interaction with the Habr API, the console utility (compiled automatically) of habrainfo turned out, allowing you to display information about the user to the console:

[phantomazz@phantomazz habraplasmoid]$ ./habrainfo phantomazz
login:phantomazz
karma:10
rating:24.25
position:2145


It can be used in bash-scripts. For example, you can get karma:

KARMA=`./habrainfo phantomazz | grep karma | cut -d":" -f1`


I think, the real habragolik will find an application to this tool. :)

Source: https://habr.com/ru/post/77386/


All Articles