Quellcode durchsuchen

write i3-blocks header to file

pull/1/head
Ursprung
Commit
f76ea50952
3 geänderte Dateien mit 9 neuen und 9 gelöschten Zeilen
  1. +5
    -5
      files/bin/timer
  2. +3
    -3
      tasks/timer.yaml
  3. +1
    -1
      templates/i3/i3blocks.config.j2

+ 5
- 5
files/bin/timer Datei anzeigen

@@ -3,7 +3,7 @@
set timer_folder ~/.timer
set activity_lists_folder $timer_folder/activity.lists
set activity_timeclock_file $timer_folder/activity.timeclock
set activity_i3blocks_pipe $timer_folder/activity.i3blocks.fifo
set activity_i3blocks_linefile $timer_folder/activity.i3blocks
set activity_current_file $timer_folder/activity.current
set activity_timeclock_append_log_folder $timer_folder/activity.timeclock.d
set activity_timeclock_append_log_filename $activity_timeclock_append_log_folder/(date +%Y-%m-%d)-(hostname)
@@ -36,10 +36,10 @@ function parse_activity_timeclock
end
if [ $state = 'i' ]
echo $activity > $activity_current_file
echo "<span foreground=\"#00FF00\">★ $activity</span>" > $activity_i3blocks_pipe
echo "<span foreground=\"#00FF00\">★ $activity</span>" > $activity_i3blocks_linefile
else
rm $activity_current_file
echo "<span foreground=\"#0000FF\">☆</span>" > $activity_i3blocks_pipe
echo "<span foreground=\"#0000FF\">☆</span>" > $activity_i3blocks_linefile
end
end

@@ -63,12 +63,12 @@ end

function begin_activity
echo i (date '+%Y-%m-%d %H:%M:%S') $argv >> $activity_timeclock_append_log_filename
echo "<span foreground=\"#00FF00\">★ $argv</span>" > $activity_i3blocks_pipe
echo "<span foreground=\"#00FF00\">★ $argv</span>" > $activity_i3blocks_linefile
end

function end_activity
echo o (date '+%Y-%m-%d %H:%M:%S') >> $activity_timeclock_append_log_filename
echo "<span foreground=\"#0000FF\">☆</span>" > $activity_i3blocks_pipe
echo "<span foreground=\"#0000FF\">☆</span>" > $activity_i3blocks_linefile
end




+ 3
- 3
tasks/timer.yaml Datei anzeigen

@@ -20,7 +20,7 @@
content: "{{ default_activities | join('\n') }}"
dest: "{{timer_folder}}/activity.lists/10-default"

- name: timer activity i3blocks fifo
command: mkfifo "{{timer_folder}}/activity.i3blocks.fifo"
- name: timer activity i3blocks linefile
shell: echo ☆ > "{{timer_folder}}/activity.i3blocks"
args:
creates: "{{timer_folder}}/activity.i3blocks.fifo"
creates: "{{timer_folder}}/activity.i3blocks"

+ 1
- 1
templates/i3/i3blocks.config.j2 Datei anzeigen

@@ -32,7 +32,7 @@ markup=none

# activity
[activity]
command=~/bin/pipe-watcher ~/.timer/activity.i3blocks.fifo ☆
command=tail -f ~/.timer/activity.i3blocks 2> /dev/null
interval=persist
markup=pango