Last active
October 31, 2022 12:13
-
-
Save TiZ-HugLife/0ed27e92235a1c4a48e5 to your computer and use it in GitHub Desktop.
todo.txt conky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_interval 1.0 | |
update_interval_on_battery 5.0 | |
total_run_times 0 | |
alignment bl | |
gap_x 2 | |
gap_y 2 | |
use_xft yes | |
override_utf8_locale yes | |
xftfont Liberation Sans:size=9 | |
border_width 0 | |
border_inner_margin 2 | |
border_outer_margin 0 | |
draw_shades yes | |
own_window yes | |
own_window_type desktop #Change to normal when using GNOME Shell | |
own_window_title Todo-Conky | |
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager | |
own_window_transparent yes | |
own_window_argb_visual yes | |
max_text_width 0 | |
minimum_size 50 10 | |
default_color FFFFFF | |
color1 FFFFFF | |
text_buffer_size 65536 | |
double_buffer yes | |
no_buffers yes | |
lua_load ~/.conky/todo.txt/draw.lua | |
lua_draw_hook_pre draw 0x000000 0.35 0 16 0 0 | |
TEXT | |
${execp ~/.conky/todo.txt/todoview.sh} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cairo' | |
local function rgb_to_r_g_b(colour,alpha) | |
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha | |
end | |
function conky_draw(bg_colour, bg_alpha, rad_tl, rad_tr, rad_br, rad_bl, v) | |
if conky_window == nil then return end | |
if v == nil then v = 0 end | |
local w = conky_window.width | |
local h = conky_window.height | |
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) | |
local cr = cairo_create(cs) | |
cairo_move_to(cr,rad_tl,0) | |
cairo_line_to(cr,w-rad_tr,0) | |
cairo_curve_to(cr,w,0,w,0,w,rad_tr) | |
cairo_line_to(cr,w,h+v-rad_br) | |
cairo_curve_to(cr,w,h+v,w,h+v,w-rad_br,h+v) | |
cairo_line_to(cr,rad_bl,h+v) | |
cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-rad_bl) | |
cairo_line_to(cr,0,rad_tl) | |
cairo_curve_to(cr,0,0,0,0,rad_tl,0) | |
cairo_close_path(cr) | |
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha)) | |
cairo_fill(cr) | |
cairo_surface_destroy(cs) | |
cairo_destroy(cr) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Not as polished as I want it to be yet; I want to add the ability to use | |
# custom headers at some point and distribute this properly. | |
HEADER_START='${font Liberation Sans:size=9:weight=bold}' | |
HEADER_END='${font Liberation Sans:size=9}' | |
OTHER_HEADER="Other" | |
ARGS=(-d $HOME/.todo/config-conky -Pn) | |
TODAY=$(date -d "-4hours" +%Y-%m-%d) | |
DONERX="s:[0-9]* x [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} ::" | |
MATCH='(\$\{.*\})?([0-9]*) (.*)' | |
SWITCH='\2 \| \1\3' | |
while getopts rbo:p: OPT; do | |
case $OPT in | |
r) SWITCH='\1\3 \| \2'; ALIGN='${alignr}'; ALNRX="s/^/$ALIGN/" ;; | |
b) DONE_BOTTOM=yes ;; | |
o) OTHER_HEADER="$OPTARG" ;; | |
p) PADDING=$OPTARG ;; # Conky likes to shift around a lot without this. | |
esac | |
done | |
shift $((OPTIND - 1)) | |
DONE=$(todo ${ARGS[@]} lf done.txt $TODAY | head -n -2) | |
WORK=$(todo ${ARGS[@]} ls @work | head -n -2) | |
SCHOOL=$(todo ${ARGS[@]} ls @school | head -n -2) | |
OTHER=$(todo ${ARGS[@]} ls -@work -@school | head -n -2) | |
[[ -n "$PADDING" ]] && { | |
LINES=0 | |
SEP=0 | |
[[ -n "$DONE" ]] && LINES=$(($LINES + $(echo "$DONE" | wc -l) + 1)) | |
[[ -n "$DONE" ]] && [[ -n "$WORK" ]] && LINES=$(($LINES + 1)) | |
[[ -n "$WORK" ]] && LINES=$(($LINES + $(echo "$WORK" | wc -l) + 1)) | |
[[ -n "$WORK" ]] && [[ -n "$SCHOOL" ]] && LINES=$(($LINES + 1)) | |
[[ -n "$SCHOOL" ]] && LINES=$(($LINES + $(echo "$SCHOOL" | wc -l) + 1)) | |
[[ -n "$SCHOOL" ]] && [[ -n "$OTHER" ]] && LINES=$(($LINES + 1)) | |
[[ -n "$OTHER" ]] && LINES=$(($LINES + $(echo "$OTHER" | wc -l) + 1)) | |
LINES=$(($PADDING - $LINES)) | |
} | |
[[ -z "$DONE_BOTTOM" ]] && { | |
[[ -n "$PADDING" ]] && for i in $(seq 1 $LINES); do echo; done | |
[[ -n "$DONE" ]] && { | |
echo "$HEADER_START$ALIGN-= Done Today =-$HEADER_END" | |
echo "$DONE" | sed -e "s:[0-9]* x $TODAY ::" -e "$ALNRX" | |
[[ -n "$WORK$SCHOOL$OTHER" ]] && echo '${color}' | |
} | |
} | |
[[ -n "$WORK" ]] && { | |
echo "$HEADER_START$ALIGN-= Work =-$HEADER_END" | |
echo "$WORK" | sed -r -e 's: @work::gI' -e "s/$MATCH/$SWITCH/" -e "$ALNRX" | |
[[ -n "$SCHOOL$OTHER" ]] && echo '${color}' | |
} | |
[[ -n "$SCHOOL" ]] && { | |
echo "$HEADER_START$ALIGN-= School =-$HEADER_END" | |
echo "$SCHOOL" | sed -r -e 's: @school::gI' -e "s/$MATCH/$SWITCH/" -e "$ALNRX" | |
[[ -n "$OTHER" ]] && echo '${color}' | |
} | |
[[ -n "$OTHER" ]] && { | |
echo "$HEADER_START$ALIGN-= $OTHER_HEADER =-$HEADER_END" | |
echo "$OTHER" | sed -r -e "s/$MATCH/$SWITCH/" -e "$ALNRX" | |
} | |
[[ -n "$DONE_BOTTOM" ]] && { | |
[[ -n "$DONE" ]] && { | |
[[ -n "$OTHER" ]] && echo '${color}' | |
echo "$HEADER_START$ALIGN-= Done Today =-$HEADER_END" | |
echo "$DONE" | sed -e "$DONERX" -e "$ALNRX" | |
} | |
[[ -n "$PADDING" ]] && for i in $(seq 1 $LINES); do echo; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So how can I install this?