Tips and Tricks | Trucs et Astuces
Royohboy, Thursday 08 October 2009 à 15:21
|
|
Subscription date : 14 September 2009
Messages : 24
|
Dear all,
I have always liked the OSX-like calendar-icon that looks like a calendar-page, and I thought it would be cool to always have it display the current day and month. Thanks to SVG this isn't too hard to implement.
Here is the bitmap-rendition of an SVG-icon I made in Inkscape (not very original, I admit):
I made a script that will write the above SVG-icon (today.svg), containing the current day and month, to your ~/.icons directory; you'll find the code below. Save it as update-calendar-icon.sh and make it executable.
The trickiest part was to get Cron to update the calendar-icon each time I start my computer, and every day at midnight, and reboot Cairo-Dock in order to show the new date. Open a terminal and type . Insert the following lines (modified to suit your system):
# Update calendar icon at each boot-up
@reboot /<full path to your script>/update-calendar-icon.sh
#
# Update calendar icon at midnight and reboot dock
0 0 * * * /<full path to your script>/update-calendar-icon.sh && DISPLAY=:0 dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.Reboot
#
Save and exit the editor. Now go to your dock, right-click on your calendar-launcher and modify it to use "today" as its icon. Run the command you put into your crontab file in a terminal once, and you should see your calendar-icon changing into a neat little calendar-page showing the current date
Note 1: You can put the script anywhere in your userspace. I have a directory called "scripts" in my $HOME directory; you might as well call it ".scripts" if you prefer to have it hidden from view. Just make sure you adjust the path in the crontab file accordingly (see above).
Note 2: Use the full path in your crontab-file, and not an abbreviated path like "~/". Apparently the latter is othen the reason for scripts not running properly as a Cron-job.
Copy the following script and save it as "update-calendar-icon.sh" somehwere in your userspace. Remember to make it executable.
#!/bin/sh
# save as update-calendar-icon.sh and make it executable
# get current day and month
MONTH=$(date +%b)
DAY=$(date +%d)
# generate calendar-icon showing current day and month
printf "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg=\"http://www.w3.org/2000/svg\"
xmlns=\"http://www.w3.org/2000/svg\"
xmlns:xlink=\"http://www.w3.org/1999/xlink\"
version=\"1.0\"
width=\"128\"
height=\"128\"
id=\"svg2\">
<defs
id=\"defs4\">
<linearGradient
id=\"linearGradient3999\">
<stop
id=\"stop4001\"
style=\"stop-color:#626262;stop-opacity:1\"
offset=\"0\" />
<stop
id=\"stop4003\"
style=\"stop-color:#6c6865;stop-opacity:1\"
offset=\"0.71532845\" />
<stop
id=\"stop4005\"
style=\"stop-color:#5a5858;stop-opacity:1\"
offset=\"0.81714529\" />
<stop
id=\"stop4007\"
style=\"stop-color:#262626;stop-opacity:1\"
offset=\"1\" />
</linearGradient>
<linearGradient
id=\"linearGradient3973\">
<stop
id=\"stop3975\"
style=\"stop-color:#b30000;stop-opacity:1\"
offset=\"0\" />
<stop
id=\"stop3977\"
style=\"stop-color:#ee3c3c;stop-opacity:1\"
offset=\"0.71532845\" />
<stop
id=\"stop3979\"
style=\"stop-color:#e66767;stop-opacity:1\"
offset=\"0.81714529\" />
<stop
id=\"stop3981\"
style=\"stop-color:#ff7171;stop-opacity:1\"
offset=\"1\" />
</linearGradient>
<linearGradient
id=\"linearGradient3955\">
<stop
id=\"stop3957\"
style=\"stop-color:#1f1f1f;stop-opacity:1\"
offset=\"0\" />
<stop
id=\"stop3959\"
style=\"stop-color:#8f8b88;stop-opacity:1\"
offset=\"0.71532845\" />
<stop
id=\"stop3961\"
style=\"stop-color:#a7a5a5;stop-opacity:1\"
offset=\"0.81714529\" />
<stop
id=\"stop3963\"
style=\"stop-color:#c9c9c9;stop-opacity:1\"
offset=\"1\" />
</linearGradient>
<linearGradient
id=\"linearGradient3410\">
<stop
id=\"stop3412\"
style=\"stop-color:#ffffff;stop-opacity:1\"
offset=\"0\" />
<stop
id=\"stop3420\"
style=\"stop-color:#d1cfce;stop-opacity:1\"
offset=\"0.71532845\" />
<stop
id=\"stop3422\"
style=\"stop-color:#a7a5a5;stop-opacity:1\"
offset=\"0.89402735\" />
<stop
id=\"stop3414\"
style=\"stop-color:#696969;stop-opacity:1\"
offset=\"1\" />
</linearGradient>
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient3416\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient3935\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient3943\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"164.1438\"
y1=\"837.71381\"
x2=\"262.08289\"
y2=\"837.71381\"
id=\"linearGradient3951\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"288.1875\"
y1=\"767.53125\"
x2=\"382.15625\"
y2=\"767.53125\"
id=\"linearGradient3971\"
xlink:href=\"#linearGradient3973\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"298.21402\"
y1=\"843.86743\"
x2=\"401.52759\"
y2=\"843.86743\"
id=\"linearGradient3997\"
xlink:href=\"#linearGradient3999\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"translate(0,-0.3181177)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient4027\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,9.129394e-2,1.6818823)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient4031\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,-0.4536475,3.3637646)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4035\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4050\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4052\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4054\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4056\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient4079\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,-0.4536475,3.3637646)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient4081\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,9.129394e-2,1.6818823)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient4083\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"164.1438\"
y1=\"837.71381\"
x2=\"262.08289\"
y2=\"837.71381\"
id=\"linearGradient4085\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"288.1875\"
y1=\"767.53125\"
x2=\"382.15625\"
y2=\"767.53125\"
id=\"linearGradient4087\"
xlink:href=\"#linearGradient3973\"
gradientUnits=\"userSpaceOnUse\" />
<linearGradient
x1=\"298.21402\"
y1=\"843.86743\"
x2=\"401.52759\"
y2=\"843.86743\"
id=\"linearGradient4089\"
xlink:href=\"#linearGradient3999\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"translate(0,-0.3181177)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4091\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4093\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4095\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient4097\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient2476\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient2478\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient2480\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<radialGradient
cx=\"302.849\"
cy=\"753.43823\"
r=\"4.0006304\"
fx=\"302.849\"
fy=\"753.43823\"
id=\"radialGradient2482\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(1,0,0,2.9350391,0,-1457.9325)\" />
<linearGradient
x1=\"298.21402\"
y1=\"843.86743\"
x2=\"401.52759\"
y2=\"843.86743\"
id=\"linearGradient2493\"
xlink:href=\"#linearGradient3999\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"translate(-279.19683,-729.67545)\" />
<linearGradient
x1=\"288.1875\"
y1=\"767.53125\"
x2=\"382.15625\"
y2=\"767.53125\"
id=\"linearGradient2500\"
xlink:href=\"#linearGradient3973\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"translate(-279.19683,-729.35733)\" />
<linearGradient
x1=\"164.1438\"
y1=\"837.71381\"
x2=\"262.08289\"
y2=\"837.71381\"
id=\"linearGradient2503\"
xlink:href=\"#linearGradient3410\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9873932,-0.1582869,0.1582869,0.9873932,-279.19683,-729.35733)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient2506\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,-279.19683,-729.35733)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient2509\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,-279.10554,-727.67545)\" />
<linearGradient
x1=\"154.15988\"
y1=\"851.48376\"
x2=\"249.32434\"
y2=\"851.48376\"
id=\"linearGradient2512\"
xlink:href=\"#linearGradient3955\"
gradientUnits=\"userSpaceOnUse\"
gradientTransform=\"matrix(0.9853821,-0.170359,0.170359,0.9853821,-279.65048,-725.99357)\" />
</defs>
<path
d=\"M 5.6692384,34.821242 L 100.61614,19.015668 L 122.29976,103.02618 L 18.769049,122.26528 L 5.6692384,34.821242 z\"
id=\"rect3379\"
style=\"fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1\" />
<path
d=\"M 13.60118,58.37304 L 99.70868,43.28563 L 115.50468,99.05508 L 22.71671,115.09685 L 13.60118,58.37304 z\"
id=\"path4029\"
style=\"fill:url(#linearGradient2512);fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1\" />
<path
d=\"M 14.14612,56.69116 L 100.25362,41.60375 L 116.04962,97.3732 L 23.26165,113.41497 L 14.14612,56.69116 z\"
id=\"path4025\"
style=\"fill:url(#linearGradient2509);fill-opacity:1;stroke:#1a1a1a;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1\" />
<path
d=\"M 14.054826,55.009283 L 100.16233,39.921869 L 115.95833,95.691324 L 23.170357,111.73309 L 14.054826,55.009283 z\"
id=\"rect3391\"
style=\"fill:url(#linearGradient2506);fill-opacity:1;stroke:#333333;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1\" />
<path
d=\"M 9.4772803,31.230194 L 95.89434,17.010764 C 101.84451,42.988204 110.19816,74.459282 116.49168,86.359252 C 92.930711,94.418142 53.292256,104.88049 22.520865,112.59603 L 9.4772803,31.230194 z\"
id=\"rect2606\"
style=\"fill:url(#linearGradient2503);fill-opacity:1;stroke:#000000;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<path
d=\"M 95.469118,17.160271 L 9.6332705,31.521621 L 14.394005,59.229336 L 102.03162,43.513718 C 99.686648,34.585548 97.446918,25.794991 95.469118,17.160271 z\"
id=\"path3382\"
style=\"fill:url(#linearGradient2500);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<text
x=\"12.788574\"
y=\"57.323757\"
transform=\"matrix(0.9877179,-0.156248,0.156248,0.9877179,0,0)\"
id=\"text2602\"
xml:space=\"preserve\"
style=\"font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:condensed;text-align:start;line-height:125%%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Nimbus Sans L;-inkscape-font-specification:Nimbus Sans L Bold Condensed\"><tspan
x=\"12.788574\"
y=\"57.323757\"
id=\"tspan2604\">$MONTH</tspan></text>
<text
x=\"48.404499\"
y=\"101.66183\"
transform=\"matrix(0.9853867,-0.1703323,0.1703323,0.9853867,0,0)\"
id=\"text2598\"
xml:space=\"preserve\"
style=\"font-size:48px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:center;line-height:125%%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Nimbus Sans L;-inkscape-font-specification:Nimbus Sans L Bold\"><tspan
x=\"48.404499\"
y=\"101.66183\"
id=\"tspan2600\"
style=\"font-size:48px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:center;line-height:125%%;writing-mode:lr-tb;text-anchor:middle;font-family:Nimbus Sans L;-inkscape-font-specification:Nimbus Sans L Bold\">$DAY</tspan></text>
<path
d=\"M 18.86917,122.25144 L 122.33076,102.71524 L 122.1116,106.50708 L 19.39588,125.71812 L 18.86917,122.25144 z\"
id=\"rect3388\"
style=\"fill:url(#linearGradient2493);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1\" />
<g
transform=\"translate(-279.19683,-729.35733)\"
id=\"g4037\">
<path
d=\"M 311.75531,764.14758 C 311.75703,765.39866 310.90855,766.55528 309.52988,767.18121 C 308.15121,767.80714 306.45212,767.80714 305.07345,767.18121 C 303.69478,766.55528 302.8463,765.39866 302.84802,764.14758 C 302.8463,762.8965 303.69478,761.73988 305.07345,761.11395 C 306.45212,760.48802 308.15121,760.48802 309.52988,761.11395 C 310.90855,761.73988 311.75703,762.8965 311.75531,764.14758 L 311.75531,764.14758 z\"
transform=\"matrix(0.9005081,0,0,0.9642831,31.051186,27.452039)\"
id=\"path3394\"
style=\"fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<path
d=\"M 299.36,755.25543 C 299.22202,749.33101 300.35118,743.93902 302.02321,742.53808 C 303.69524,741.13714 305.41401,744.14293 306.07704,749.62743 C 306.74007,755.11193 306.15063,761.44779 304.6868,764.57096\"
transform=\"matrix(0.7921082,-0.1723206,0.1261344,1.0821514,-28.999117,-9.1242685)\"
id=\"path3398\"
style=\"fill:none;fill-opacity:1;stroke:url(#radialGradient2476);stroke-width:3.86078405;stroke-linecap:round;marker-start:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<path
d=\"M 299.36,755.25543 C 299.22202,749.33101 300.35118,743.93902 302.02321,742.53808 C 303.69524,741.13714 305.41401,744.14293 306.07704,749.62743 C 306.74007,755.11193 306.15063,761.44779 304.6868,764.57096\"
transform=\"matrix(0.7921082,-0.1723206,0.1261344,1.0821514,-30.209688,-9.1242685)\"
id=\"path4033\"
style=\"fill:none;fill-opacity:1;stroke:url(#radialGradient2478);stroke-width:3.86078405;stroke-linecap:round;marker-start:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
</g>
<g
transform=\"translate(-228.77569,-737.75204)\"
id=\"g4042\">
<path
d=\"M 311.75531,764.14758 C 311.75703,765.39866 310.90855,766.55528 309.52988,767.18121 C 308.15121,767.80714 306.45212,767.80714 305.07345,767.18121 C 303.69478,766.55528 302.8463,765.39866 302.84802,764.14758 C 302.8463,762.8965 303.69478,761.73988 305.07345,761.11395 C 306.45212,760.48802 308.15121,760.48802 309.52988,761.11395 C 310.90855,761.73988 311.75703,762.8965 311.75531,764.14758 L 311.75531,764.14758 z\"
transform=\"matrix(0.9005081,0,0,0.9642831,31.051186,27.452039)\"
id=\"path4044\"
style=\"fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<path
d=\"M 299.36,755.25543 C 299.22202,749.33101 300.35118,743.93902 302.02321,742.53808 C 303.69524,741.13714 305.41401,744.14293 306.07704,749.62743 C 306.74007,755.11193 306.15063,761.44779 304.6868,764.57096\"
transform=\"matrix(0.7921082,-0.1723206,0.1261344,1.0821514,-28.999117,-9.1242685)\"
id=\"path4046\"
style=\"fill:none;fill-opacity:1;stroke:url(#radialGradient2480);stroke-width:3.86078405;stroke-linecap:round;marker-start:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
<path
d=\"M 299.36,755.25543 C 299.22202,749.33101 300.35118,743.93902 302.02321,742.53808 C 303.69524,741.13714 305.41401,744.14293 306.07704,749.62743 C 306.74007,755.11193 306.15063,761.44779 304.6868,764.57096\"
transform=\"matrix(0.7921082,-0.1723206,0.1261344,1.0821514,-30.209688,-9.1242685)\"
id=\"path4048\"
style=\"fill:none;fill-opacity:1;stroke:url(#radialGradient2482);stroke-width:3.86078405;stroke-linecap:round;marker-start:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1\" />
</g>
</svg>" > ~/.icons/today.svg
exit 0 |
ppmt, Thursday 08 October 2009 à 15:33
|
|
Subscription date : 29 November 2007
Messages : 3520
|
That's a neat idea.
I will try it tonight. |
Royohboy, Thursday 08 October 2009 à 19:56
|
|
Subscription date : 14 September 2009
Messages : 24
|
By the way, you absolutely need Cairo-Dock 2.1 or newer because of the DBus-functionality. |
nochka85, Thursday 08 October 2009 à 20:51
|
|
Subscription date : 29 November 2007
Messages : 7408
|
You can probably do an external applet with that ... ... and without any cron -> http://www.glx-dock.org/ww_page.php?p=Control_your_dock_with_DBus&lang=en
And you have 2 demos in the sources ( <- For Fabounet : It could be easier with the demos automaticaly installed IN the /usr/share/cairo-dock ... even if it was installed with the repository ) in the cairo-dock-plug-ins/Dbus/demos folder |
Royohboy, Thursday 08 October 2009 à 21:18
|
|
Subscription date : 14 September 2009
Messages : 24
|
You can probably do an external applet with that
That would indeed be much more elegant than having users mess around with installing scripts and crontabs. Feel free to use my icon  |
nochka85, Thursday 08 October 2009 à 21:45
|
|
Subscription date : 29 November 2007
Messages : 7408
|
You don't want to try it by yourself ? <- We are looking for devs ... and especially for external applets |
lylambda, Thursday 08 October 2009 à 21:48
|
|
Subscription date : 06 September 2009
Messages : 1635
|
So nice idea ! We want an applet .
Fab, maybe that can be use for obtain a dynamic icon in calendar's clock ? |
Royohboy, Friday 09 October 2009 à 00:36
|
|
Subscription date : 14 September 2009
Messages : 24
|
"Nochka" : You don't want to try it by yourself?
Hmm, as in writing a C++-programme? <shudder> A simple shell-script like mine is no problem, but anything really complicated...
I'll download the sources and look at applet-programming and see if I understand it at all.
"lylambda" : Fab, maybe that can be use for obtain a dynamic icon in calendar's clock ?
Wow, now that little calendar is nice Haven't seen it before, and yes, a dynamic date-icon is a must. You'd have to either copy today.svg to /usr/share/cairo-dock/plug-ins/clock/dates.svg or manipulate the file directly, or let users choose the calendar-icon via configuration of the clock-applet. The latter would be my favourite solution.
By the way, that calender in the clock-applet is really cool I've been playing around with it, and I just discovered that if you drag a date from the calendar to a text-editor it'll paste in the date you chose! |
ppmt, Friday 09 October 2009 à 03:19
|
|
Subscription date : 29 November 2007
Messages : 3520
|
Royohboy : Hmm, as in writing a C++-programme? <shudder> A simple shell-script like mine is no problem, but anything really complicated...
I'll download the sources and look at applet-programming and see if I understand it at all.
You are not going to get out of it that easily
The link that nochka gave will allow to write an applet in bash!
I can't wait now! |
matttbe, Friday 09 October 2009 à 03:36
|
|
Subscription date : 24 January 2009
Messages : 12573
|
And the overwriting of /usr/share/cairo-dock/plug-ins/clock/dates.svg can also be an interesting solution (but it needs 'root' right => a crontab or a modification in the source code of clock ) |
Royohboy, Friday 09 October 2009 à 10:13
|
|
Subscription date : 14 September 2009
Messages : 24
|
If you want to overwrite /usr/share/.../dates.svg through a crontab you'd have to use a crontab with admin privileges, and that's where I think it starts getting messy. I'd rather suggest modifying the Clock source to use an icon that lives in ~/.config/cairo-dock/current_theme, or at least somewhere in ~/.config/cairo-dock/ which is where the graphics for the clock live, anyway. |
ppmt, Saturday 10 October 2009 à 19:53
|
|
Subscription date : 29 November 2007
Messages : 3520
|
Just to let you know
I tested your procedure Royohboy and it works perfectly.
Good job. |
Royohboy, Sunday 11 October 2009 à 21:46
|
|
Subscription date : 14 September 2009
Messages : 24
|
Thanks for your feedback, ppmt
Nochka85 : You can probably do an external applet with that ... ... and without any cron
I'm slowly getting closer... I do now have an Icon in my dock, I can change the icon, and display a message while doing so (which would be nice at midnight (something like "whoa, did you see that? The icon just changed!"). There are still several things I don't understand:
- How can I change the icon at midnight without the help of a Cron-job? Does Cairo-Dock issue a signal like
on_time = 0 hours,0 minutes do something ?
- How do I listen for an signal in a shell-script and act on it? I haven't found that in the tutorial, and I suspect it's beyond what a shell-script can do.
- Wouldn't an applet like this, by its very nature, better be an internal applet instead of an external one?
|
matttbe, Sunday 11 October 2009 à 22:15
|
|
Subscription date : 24 January 2009
Messages : 12573
|
How can I change the icon at midnight without the help of a Cron-job? Does Cairo-Dock issue a signal like Yes, a Cron-Job. Or by adding an Alarm on Clock (of CD) (by editing the clock.conf file)
How do I listen for an signal in a shell-script and act on it? I haven't found that in the tutorial, and I suspect it's beyond what a shell-script can do. You have to use another language than bash just for that. You have a demo in the source code on bzr (here) or with a complete script here
Wouldn't an applet like this, by its very nature, better be an internal applet instead of an external one? It can be interesting to add this functionality to 'Clock' but if it's to do a new applet, it's better an external applet I think  |
nochka85, Sunday 11 October 2009 à 22:49
|
|
Subscription date : 29 November 2007
Messages : 7408
|
You have to use another language than bash just for that. You have a demo in the source code on bzr (here) or with a complete script here
The demo_bash is an external applet using bash for the programmation AND a "standard python remote script" to intercept signals from the dock (click, middle-click, scroll_up and down, drop_data) ... You just have to use this python script without any change (and rename it as your .sh but without extension) to remote your .sh ! |
Subscription date : 26 October 2008
Messages : 1904
|
Would it be possible to do by the same way a clock rendering in svg? Or would it use to much resources? |
nochka85, Monday 12 October 2009 à 23:04
|
|
Subscription date : 29 November 2007
Messages : 7408
|
One refresh per minute .... ... I don't know -> You can try it in python
HS : By the way taiebot, what about your applet ? |
fabounet, Tuesday 13 October 2009 à 10:25
|
|
Subscription date : 30 November 2007
Messages : 17118
|
clock rendering in svg
there is already a clock applet and it uses svg  |
nochka85, Tuesday 13 October 2009 à 10:55
|
|
Subscription date : 29 November 2007
Messages : 7408
|
I think he said that to generate svg each minutes (seconds ??) to do something like that :
... and by the way, we really need this rendering in clock ! |
Tips and Tricks | Trucs et Astuces
|