From 5cc0bb49851271857a5e9b31bef8dbdcd073d0e3 Mon Sep 17 00:00:00 2001 From: Jens Heinrich Date: Wed, 13 Mar 2019 17:47:16 +0100 Subject: [PATCH] =?UTF-8?q?/usr/home/jens/Development/ansible/roles/conky?= =?UTF-8?q?=20on=20deathbolt.927589452.space=20at=20Mi.=2013=20M=C3=A4rz?= =?UTF-8?q?=202019=2017:47:16=20CET?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/conky.yml | 28 ++++++++++++++++++++++++++++ tasks/main.yml | 7 +++++++ tasks/vars.yml | 16 ++++++++++++++++ templates/conkyrc.j2 | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 tasks/conky.yml create mode 100644 tasks/main.yml create mode 100644 tasks/vars.yml create mode 100644 templates/conkyrc.j2 diff --git a/tasks/conky.yml b/tasks/conky.yml new file mode 100644 index 0000000..109b5d3 --- /dev/null +++ b/tasks/conky.yml @@ -0,0 +1,28 @@ +--- +- name: install prequsites + package: + name: conky + state: present + become: true + tags: + - installation + +- name: generate directories + file: + state: directory + dest: "{{ home_path }}/{{ current_user}}/.config/conky" + owner: "{{ current_user }}" + become: true + tags: + - configuration + +- name: generate conkyrc + template: + src: conkyrc.j2 + dest: "{{ home_path }}/{{ current_user}}/.config/conky/conky.conf" + owner: "{{ current_user }}" + become: true + tags: + - configuration + + diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..1275c25 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,7 @@ +--- +- include_tasks: "{{ item }}" + tags: + - installation + - configuration + loop: + - conky.yml diff --git a/tasks/vars.yml b/tasks/vars.yml new file mode 100644 index 0000000..9b5a386 --- /dev/null +++ b/tasks/vars.yml @@ -0,0 +1,16 @@ +--- +- debug: + msg: "{{ansible_distribution}}-{{ansible_distribution_major_version}}-{{ansible_distribution}}" + verbosity: 0 + +- name: Load OS specific vars, if available + include_vars: "{{ lookup('first_found', params)}}" + vars: + params: + files: + - '{{ansible_distribution}}-{{ansible_distribution_major_version}}.yml' + - '{{ansible_distribution}}.yml' + - '{{ansible_os_family}}.yml' + - default.yml + paths: + - 'vars' diff --git a/templates/conkyrc.j2 b/templates/conkyrc.j2 new file mode 100644 index 0000000..d86f098 --- /dev/null +++ b/templates/conkyrc.j2 @@ -0,0 +1,43 @@ +{{ ansible_managed | comment }} + +# i will probably keep running i3wm +# https://www.reddit.com/r/i3wm/comments/4x8tif/i3_and_conky_in_the_background/own_window yes +own_window_class Conky +own_window_type override +background yes +# https://faq.i3wm.org/question/3829/conky-on-desktop.1.html +# conky config battery indicator +alignment top_left +background no +border_width 1 +cpu_avg_samples 2 +default_color white +default_outline_color white +default_shade_color white +draw_borders no +draw_graph_borders yes +draw_outline no +draw_shades no +use_xft yes +xftfont DejaVu Sans Mono:size=10 +gap_x 25 +gap_y 25 +minimum_size 5 5 +net_avg_samples 2 +double_buffer yes +out_to_console no +out_to_stderr no +extra_newline no +own_window yes +own_window_class Conky +own_window_type override +stippled_borders 0 +update_interval 1.0 +uppercase no +use_spacer none +show_graph_scale no +show_graph_range no + + +TEXT +${battery BAT1} ${battery_bar BAT1} ${battery_short BAT1}