Page 1 of 1

wmstickynotes

Posted: Tue 12 May 2020, 15:36
by fabrice_035
Hello, I found a nice program but it lacks some small features and I don't have the knowledge to modify it. Of course I'm looking as always, but maybe if an expert can help me.

https://www.dockapps.net/wmstickynotes

Since the source code is in C
- I wish I could change the font.
- that it's in the systray instead of the taskbar.

Nothing else! I saw that the source code isn't very long.

so far I've found some tricks with "wmctrl" command . but it's not ideal

Thanks!
ps: I've contacted the author by email, maybe he'll give me an answer.

Posted: Thu 14 May 2020, 05:51
by fredx181
Hello fabrice,

A workaround to change the font can be running wmstickynotes with a gtkrc file, for example:

Code: Select all

#!/bin/bash

# change font name and size below as preferred
echo 'style "font" { font_name= "DejaVu Sans Mono Bold 13" } class "GtkWidget" style "font"' > /tmp/gtkrc_wmsticky
GTK2_RC_FILES=/tmp/gtkrc_wmsticky wmstickynotes
EDIT: added #!/bin/bash on top

Fred

Posted: Thu 14 May 2020, 10:30
by fabrice_035
thank you for this good idea but I don't know what to change in the source code to implement this idea.

Posted: Thu 14 May 2020, 10:42
by fredx181
fabrice_035 wrote:thank you for this good idea but I don't know what to change in the source code to implement this idea.
I have no idea how to implement in the source, above code is meant to run as a wrapper script (bash), not to implement in the source, that's why I called it a workaround.
I think wmstickynotes uses the system wide gtk2 setting by default for font name and size (as set in ~/.gtkrc-2.0), but you can set it only for wmstickynotes by calling it with the GTK2_RC_FILES= env variable.

Fred

Posted: Thu 14 May 2020, 16:36
by fabrice_035
I just figured it out and yeah, it's working great. Your tip, thank you!

My code (in startup dir)

Code: Select all

#!/bin/sh


echo 'style "font" { font_name= "DejaVu Sans Mono Bold 13" } class "GtkWidget" style "font"' > /tmp/gtkrc_wmsticky 
GTK2_RC_FILES=/tmp/gtkrc_wmsticky  wmstickynotes &
pid="$!"
echo "$pid"
sleep 1
window=$(wmctrl -lp | grep -m1 "$pid" | awk -F" " '{print $1}')
echo "$window"
sleep 1
wmctrl -ir "$window" -b toggle,skip_taskbar
wmctrl -ir "$window" -b add,hidden
sleep 1
window=$(wmctrl -lp | grep "$pid" | awk -F" " '{print $1}' | tail -1)
wmctrl -ir "$window" -b toggle,skip_taskbar
Beware you already need a note with text to test because with this code the main application is hidden.
Or create a file named 1 in ./wmstickynotes

Image

:)[/img]