wmstickynotes

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

wmstickynotes

#1 Post 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.
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#2 Post 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
Last edited by fredx181 on Thu 14 May 2020, 11:19, edited 1 time in total.

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#3 Post 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.
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#4 Post 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

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#5 Post 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]
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

Post Reply