要将 org-agenda 嵌入 linux 桌面背景需要两个工具:org-batch-agenda 以及 conky: github /brndnmtthws/conky
其中:
sudo pacman -S conky --noconfirm
创建一个 ~/.conky 文件并输入下面内容
conky.config = {
background = true,
update_interval = 1.5,
cpu_avg_samples = 2,
net_avg_samples = 2,
out_to_console = false,
override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
imlib_cache_size = 0,
own_window = true,
own_window_type = 'desktop',
own_window_argb_visual = true,
own_window_argb_value = 120,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
border_inner_margin = 10,
border_outer_margin = 0,
xinerama_head = 1,
alignment = 'top_right',
gap_x = 90,
gap_y = 90,
draw_shades = true,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
use_xft = true,
font = 'Ubuntu Mono:size=12',
xftalpha = 0.8,
uppercase = false,
default_color = '#FFFFFF',
own_window_colour = '#000000',
minimum_width = 0, minimum_height = 0,
};
conky.text = [[
${execpi 300 /usr/bin/emacs --batch -l ~/github/mobileorg-sync/mobileorg-sync.el -eval '(org-batch-agenda "m")' }
${execpi 300 /usr/bin/emacs --batch -l ~/github/mobileorg-sync/mobileorg-sync.el -eval '(org-batch-agenda "s")' }
]];
其中 conky.config 这一段用来配置显示效果的,而具体的内容由 conky.text 来实现。其中
${execpi 300 /usr/bin/emacs --batch -l ~/github/mobileorg-sync/mobileorg-sync.el -eval '(org-batch-agenda "m")' }
的意思是,每 300 秒执行一次 /usr/bin/emacs --batch -l ~/github/mobileorg-sync/mobileorg-sync.el -eval '(org-batch-agenda "m")' 命令,并显示其结果。
这里我将所有关于 org-agenda 的配置都集中在 ~/github/mobileorg-sync/mobileorg-sync.el 中。
conky
conky默认会加载 ~/.conky 中的配置,并显示结果。

当然你也可以使用 -c 选项指定加载某个配置文件,像这样
conky -c ~/.conkyrc.org_agenda
