You are not logged in.

#1 2018-05-30 00:23:55

mouni
Member
Registered: 2011-07-03
Posts: 31

conky and moon phase infomation

Hi. I would like to have available information about the  phase of moon as shown on these sites. https://www.die.net/moon/ or https://www.moongiant.com/phase/today/
There is my code, just want add information about moon.
Thank you.

ackground yes
font Zekton:size=7
xftfont Zekton:size=7
use_xft yes
xftalpha 0.1
update_interval 1.0
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
minimum_size 220 5
maximum_width 220
default_color d7d7d7
default_shade_color white
default_outline_color black
alignment top_right
gap_x 2
gap_y 10
no_buffers yes
cpu_avg_samples 2
override_utf8_locale no
uppercase no # set to yes if you want all text to be in uppercase
use_spacer no

TEXT
${font Zekton:style=Bold:pixelsize=20}${alignc}${time %H:%M:%S}${font Zekton:size=8}${color violet}
${font Zekton:style=Bold:pixelsize=10}${alignc}${time %A - %D}${font Zekton:size=8}
SYSTEM ${hr 1 }${color white}

Hostname: $alignr$nodename ${color white}
Kernel: $alignr$kernel
Uptime: $alignr$uptime
Processes: ${alignr}$processes ($running_processes running)
Load: ${alignr}$loadavg
CPU ${alignc} ${freq}MHz / ${acpitemp}C ${alignr}(${cpu cpu1}%)
${cpubar 4 cpu1}
${cpugraph}
RAM ${alignr}$mem / $memmax ($memperc%)
${membar 4}
SWAP ${alignr}$swap / $swapmax ($swapperc%)
${swapbar 4}

Highest CPU $alignr CPU% MEM%
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}

Highest MEM $alignr CPU% MEM%
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}

NETWORK ${hr 1}${color red}

Down ${downspeed eth0} k/s ${alignr}Up ${upspeed eth0} k/s
${downspeedgraph eth0 25,107} ${alignr}${upspeedgraph eth0 25,107}
Total ${totaldown eth0} ${alignr}Total ${totalup eth0}

Last edited by mouni (2018-06-02 18:43:44)


"See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too." - Linus Torvalds

Offline

#2 2018-05-30 00:29:16

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: conky and moon phase infomation

A web search for conky moonphase shows for example this: https://forums.bunsenlabs.org/viewtopic.php?id=189


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2018-05-30 00:35:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: conky and moon phase infomation

curl -sA "Mozilla/5.0" "https://www.die.net/moon/" | awk -F'[<>]' '/colspan=2/ {print $5; exit}'

Moving to NC...


And please edit your thread title to one that actually describes your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2018-05-30 09:16:45

mouni
Member
Registered: 2011-07-03
Posts: 31

Re: conky and moon phase infomation

jasonwryan wrote:
curl -sA "Mozilla/5.0" "https://www.die.net/moon/" | awk -F'[<>]' '/colspan=2/ {print $5; exit}'

Hi, this code dont work.


"See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too." - Linus Torvalds

Offline

#5 2018-05-30 09:25:59

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: conky and moon phase infomation

It's fine here...

slithery@red:~$ curl -sA "Mozilla/5.0" "https://www.die.net/moon/" | awk -F'[<>]' '/colspan=2/ {print $5; exit}'
Full Moon 

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2018-05-30 10:39:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: conky and moon phase infomation

His code worked fine for me too.  But it would seem the following instruction failed to have any effect:

jasonwryan wrote:

And please edit your thread title to one that actually describes your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2018-05-30 14:55:07

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: conky and moon phase infomation

If you only need the phase of the Moon, you can also call pom ("phase of the moon", in bsd-games).

% pom
The Moon is Waning Gibbous (99% of Full)

Offline

#8 2018-05-30 18:49:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,849

Re: conky and moon phase infomation

mouni wrote:

Hi, this code dont work.

Please read the CoC, in particular https://bbs.archlinux.org/viewtopic.php?id=57855
Then try again.

Offline

#9 2018-06-02 13:26:25

mouni
Member
Registered: 2011-07-03
Posts: 31

Re: conky and moon phase infomation

Thank you all. Let me read and learn


"See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too." - Linus Torvalds

Offline

#10 2018-06-02 14:01:38

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: conky and moon phase infomation

jasonwryan wrote:
curl -sA "Mozilla/5.0" "https://www.die.net/moon/" | awk -F'[<>]' '/colspan=2/ {print $5; exit}'

"Full moon" is everyday now

Last edited by Docbroke (2018-06-02 14:02:06)

Offline

#11 2018-06-02 14:23:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,849

Re: conky and moon phase infomation

The current phase string spans 3 columns and the html source includes newlines, iow: parsing webpages sucks. (I'd suggest xml starlet, but that will stumble over the embedded JS code ...)
=> see comment #7

Offline

#12 2018-06-02 14:52:00

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: conky and moon phase infomation

There is also the navy api which returns a json object with a daily sun and moon data for a chosen location and date, but if the moon phase is all you want, then pom from bsd-games is better.
http://aa.usno.navy.mil/data/docs/api.php#rstt

Last edited by progandy (2018-06-02 14:52:38)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#13 2018-06-02 15:10:59

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: conky and moon phase infomation

mouni,

Please do change your post title (as instructed); the current title will be very unhelpful for people searching for solutions to similar problems.

All the best,

-HG

Offline

Board footer

Powered by FluxBB