From 321d059c300d59bfe41ab7f3259f0f937eb3cb53 Mon Sep 17 00:00:00 2001 From: inkch Date: Mon, 15 Jan 2024 01:49:06 +0900 Subject: [PATCH] conky: add widgets and start.sh --- dot_config/conky/executable_start.sh | 12 ++++++ dot_config/conky/widgets/qlocktwo.lua | 52 ++++++++++++++++++++++++ dot_config/conky/widgets/simpleclock.lua | 35 ++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 dot_config/conky/executable_start.sh create mode 100644 dot_config/conky/widgets/qlocktwo.lua create mode 100644 dot_config/conky/widgets/simpleclock.lua diff --git a/dot_config/conky/executable_start.sh b/dot_config/conky/executable_start.sh new file mode 100644 index 0000000..64a76f7 --- /dev/null +++ b/dot_config/conky/executable_start.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +pkill conky + +widgetsdir="$XDG_CONFIG_HOME/conky/widgets" +if [ -d "$widgetsdir" ]; then + for widget in $widgetsdir/*; do + filename=$(echo $widget | sed "s;$widgetsdir/;;") + [[ $filename =~ ^_.* ]] && continue + conky -q -c "$widget" + done +fi diff --git a/dot_config/conky/widgets/qlocktwo.lua b/dot_config/conky/widgets/qlocktwo.lua new file mode 100644 index 0000000..3cca480 --- /dev/null +++ b/dot_config/conky/widgets/qlocktwo.lua @@ -0,0 +1,52 @@ +conky.config = { + -- common + background = true, + alignment = 'middle_middle', + double_buffer = true, + gap_x = 0, + gap_y = 0, + draw_shades = false, + update_interval = 15.0, + + -- window + own_window = true, + own_window_type = 'override', + own_window_transparent = true, + own_window_class = 'Conky', + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + own_window_argb_visual = true, + own_window_argb_value = 0, + + -- color + default_shade_color = '#1d1f21', + default_color = '#ffffff', + + -- dim color + color1 = '#4f4f4f', + + -- font + use_xft = true, + xftalpha = 0.1, +}; + +conky.text = [[ +${font Source Han Code JP:pixelsize=32} +${alignc}${color}I T ${color1}L ${color}I S ${color1}A S T I M E +${alignc}${if_match ${exec date +"%M"} < 35}${if_match ${exec date +"%M"} >= 15}${if_match ${exec date +"%M"} < 20}${color}${endif}${endif}A ${color1}C ${if_match ${exec date +"%M"} >= 15}${if_match ${exec date +"%M"} < 20}${color}${endif}${endif}Q U A R T E R ${color1}D C +${alignc}${if_match ${exec date +"%M"} >= 20}${if_match ${exec date +"%M"} < 30}${color}${endif}${endif}T W E N T Y ${if_match ${exec date +"%M"} >= 25}${if_match ${exec date +"%M"} < 30}${color}${endif}${else}${color1}${endif}${if_match ${exec date +"%M"} >= 5}${if_match ${exec date +"%M"} < 10}${color}${endif}${endif}F I V E ${color1}X +${alignc}${if_match ${exec date +"%M"} >= 30}${if_match ${exec date +"%M"} < 35}${color}${endif}${endif}H A L F ${color1}B ${if_match ${exec date +"%M"} >= 10}${if_match ${exec date +"%M"} < 15}${color}${endif}${endif}T E N ${color1}F T O +${alignc}${else}${if_match ${exec date +"%M"} >= 45}${if_match ${exec date +"%M"} < 50}${color}${endif}${endif}A ${color1}C ${if_match ${exec date +"%M"} >= 45}${if_match ${exec date +"%M"} < 50}${color}${endif}${endif}Q U A R T E R ${color1}D C +${alignc}${if_match ${exec date +"%M"} >= 35}${if_match ${exec date +"%M"} < 45}${color}${endif}${endif}T W E N T Y ${if_match ${exec date +"%M"} < 40}${if_match ${exec date +"%M"} >= 35}${color}${endif}${else}${color1}${endif}${if_match ${exec date +"%M"} >= 55}${color}${endif}F I V E ${color1}X +${alignc}H A L F B ${if_match ${exec date +"%M"} >= 50}${if_match ${exec date +"%M"} < 55}${color}${endif}${endif}T E N ${color1}F ${color}T O${color1} +${alignc}${endif}${if_match ${exec date +"%M"} < 35}${if_match ${exec date +"%M"} >= 5}${color}${endif}${endif}P A S T ${color1}E R U ${if_match ${exec date +"%M"} < 35}${if_match ${exec date +"%I"} == 9}${color}${else}${color1}${endif}N I N E +${alignc}${if_match ${exec date +"%I"} == 1}${color}${else}${color1}${endif}O N E ${if_match ${exec date +"%I"} == 6}${color}${else}${color1}${endif}S I X ${if_match ${exec date +"%I"} == 3}${color}${else}${color1}${endif}T H R E E +${alignc}${if_match ${exec date +"%I"} == 4}${color}${else}${color1}${endif}F O U R ${if_match ${exec date +"%I"} == 5}${color}${else}${color1}${endif}F I V E ${if_match ${exec date +"%I"} == 2}${color}${else}${color1}${endif}T W O +${alignc}${if_match ${exec date +"%I"} == 8}${color}${else}${color1}${endif}E I G H T ${if_match ${exec date +"%I"} == 11}${color}${else}${color1}${endif}E L E V E N +${alignc}${if_match ${exec date +"%I"} == 7}${color}${else}${color1}${endif}S E V E N ${if_match ${exec date +"%I"} == 12}${color}${else}${color1}${endif}T W E L V E +${alignc}${if_match ${exec date +"%I"} == 10}${color}${else}${color1}${endif}T E N ${else}${if_match ${exec date +"%I"} == 8}${color}${else}${color1}${endif}N I N E +${alignc}${if_match ${exec date +"%I"} == 12}${color}${else}${color1}${endif}O N E ${if_match ${exec date +"%I"} == 5}${color}${else}${color1}${endif}S I X ${if_match ${exec date +"%I"} == 2}${color}${else}${color1}${endif}T H R E E +${alignc}${if_match ${exec date +"%I"} == 3}${color}${else}${color1}${endif}F O U R ${if_match ${exec date +"%I"} == 4}${color}${else}${color1}${endif}F I V E ${if_match ${exec date +"%I"} == 1}${color}${else}${color1}${endif}T W O +${alignc}${if_match ${exec date +"%I"} == 7}${color}${else}${color1}${endif}E I G H T${if_match ${exec date +"%I"} == 10}${color}${else}${color1}${endif} E L E V E N +${alignc}${if_match ${exec date +"%I"} == 6}${color}${else}${color1}${endif}S E V E N${if_match ${exec date +"%I"} == 11}${color}${else}${color1}${endif} T W E L V E +${alignc}${if_match ${exec date +"%I"} == 9}${color}${else}${color1}${endif}T E N ${endif}${color1}S E ${if_match ${exec date +"%M"} < 5}${color}${endif}O C L O C K +]]; diff --git a/dot_config/conky/widgets/simpleclock.lua b/dot_config/conky/widgets/simpleclock.lua new file mode 100644 index 0000000..30721de --- /dev/null +++ b/dot_config/conky/widgets/simpleclock.lua @@ -0,0 +1,35 @@ +conky.config = { + -- common + background = true, + alignment = 'middle_middle', + double_buffer = true, + gap_x = 2240, + gap_y = 50, + draw_shades = false, + update_interval = 1.0, + + -- window + own_window = true, + own_window_type = 'override', + own_window_transparent = true, + own_window_class = 'Conky', + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + own_window_argb_visual = true, + own_window_argb_value = 0, + + -- color + default_shade_color = '#1d1f21', + default_color = '#ffffff', + -- color1 = '#2d2d2d', + color1 = '#4f4f4f', + + -- font + -- uppercase = true, + use_xft = true, + xftalpha = 0.1, +}; + +conky.text = [[ +${font Source Han Code JP:pixelsize=48} +${alignc}${color}${exec date +"%H:%M"} +]];