Bye Taskwarrior
This commit is contained in:
parent
81337dc1b8
commit
ad66e05701
|
@ -47,7 +47,6 @@ if __name__ == "__main__":
|
||||||
PERSONAL_THEME = 0
|
PERSONAL_THEME = 0
|
||||||
Bar.addSectionAll(KeystoreProvider(theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
Bar.addSectionAll(KeystoreProvider(theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
||||||
# Bar.addSectionAll(NotmuchUnreadProvider(dir='~/.mail/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
# Bar.addSectionAll(NotmuchUnreadProvider(dir='~/.mail/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
||||||
Bar.addSectionAll(TaskWarriorProvider(theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
|
||||||
# Bar.addSectionAll(TodoProvider(dir='~/.vdirsyncer/currentCalendars/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
# Bar.addSectionAll(TodoProvider(dir='~/.vdirsyncer/currentCalendars/', theme=PERSONAL_THEME), BarGroupType.RIGHT)
|
||||||
|
|
||||||
TIME_THEME = 6
|
TIME_THEME = 6
|
||||||
|
|
|
@ -14,7 +14,6 @@ import json
|
||||||
import notmuch
|
import notmuch
|
||||||
import mpd
|
import mpd
|
||||||
import random
|
import random
|
||||||
import taskw
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
coloredlogs.install(level='DEBUG', fmt='%(levelname)s %(message)s')
|
coloredlogs.install(level='DEBUG', fmt='%(levelname)s %(message)s')
|
||||||
|
@ -526,39 +525,6 @@ class NotmuchUnreadProvider(ColorCountsSection, InotifyUpdater):
|
||||||
self.addPath(os.path.join(self.dir, '.notmuch', 'xapian'))
|
self.addPath(os.path.join(self.dir, '.notmuch', 'xapian'))
|
||||||
|
|
||||||
|
|
||||||
class TaskWarriorProvider(StatefulSection, InotifyUpdater):
|
|
||||||
ICON = ''
|
|
||||||
NUMBER_STATES = 2
|
|
||||||
DEFAULT_STATE = 1
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, theme=None):
|
|
||||||
InotifyUpdater.__init__(self)
|
|
||||||
StatefulSection.__init__(self, theme=theme)
|
|
||||||
self.taskw = taskw.TaskWarrior()
|
|
||||||
self.addPath(os.path.expanduser(self.taskw.config['data']['location']))
|
|
||||||
|
|
||||||
def fetcher(self):
|
|
||||||
maxi = -math.inf
|
|
||||||
total = 0
|
|
||||||
for task in self.taskw.load_tasks('pending')['pending']:
|
|
||||||
urgency = task['urgency']
|
|
||||||
if urgency > maxi:
|
|
||||||
maxi = urgency
|
|
||||||
if urgency > 0:
|
|
||||||
total += urgency
|
|
||||||
t = Text()
|
|
||||||
t.append(f"{maxi:.1f}")
|
|
||||||
|
|
||||||
if self.showTotal:
|
|
||||||
t.append(f" | {total:.1f}")
|
|
||||||
|
|
||||||
return t
|
|
||||||
|
|
||||||
def onChangeState(self, state):
|
|
||||||
self.showTotal = state >= 1
|
|
||||||
|
|
||||||
|
|
||||||
class TodoProvider(ColorCountsSection, InotifyUpdater):
|
class TodoProvider(ColorCountsSection, InotifyUpdater):
|
||||||
# TODO OPT/UX Maybe we could get more data from the todoman python module
|
# TODO OPT/UX Maybe we could get more data from the todoman python module
|
||||||
# TODO OPT Specific callback for specific directory
|
# TODO OPT Specific callback for specific directory
|
||||||
|
|
|
@ -9,6 +9,5 @@ pulsectl==18.8.0
|
||||||
pyinotify==0.9.6
|
pyinotify==0.9.6
|
||||||
python-mpd2==1.0.0
|
python-mpd2==1.0.0
|
||||||
python-uinput==0.11.2
|
python-uinput==0.11.2
|
||||||
taskw==1.2.0
|
|
||||||
yoke==0.1.1
|
yoke==0.1.1
|
||||||
zeroconf==0.21.3
|
zeroconf==0.21.3
|
||||||
|
|
|
@ -175,8 +175,7 @@ then
|
||||||
i vdirsyncer # Synchronize DAV
|
i vdirsyncer # Synchronize DAV
|
||||||
i khard # Contacts editor
|
i khard # Contacts editor
|
||||||
i khal # Calendar editor
|
i khal # Calendar editor
|
||||||
i task # Todo-list
|
i todoman # Todo-list
|
||||||
i timew # Time-tracker
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import taskw
|
|
||||||
import sys
|
|
||||||
|
|
||||||
tw = taskw.TaskWarrior()
|
|
||||||
|
|
||||||
total = 0
|
|
||||||
number = 0
|
|
||||||
statuses = set()
|
|
||||||
for task in tw._get_task_objects(*sys.argv[1:], 'export'):
|
|
||||||
statuses.add(task['status'])
|
|
||||||
if task['status'] not in {'pending', 'waiting'}:
|
|
||||||
continue
|
|
||||||
urgency = task['urgency']
|
|
||||||
if urgency <= 0:
|
|
||||||
continue
|
|
||||||
total += urgency
|
|
||||||
number += 1
|
|
||||||
|
|
||||||
print(f"Σ{total:.3f} #{number}")
|
|
|
@ -42,10 +42,7 @@ direnv PARALLEL_HOME "$HOME/.cache/parallel"
|
||||||
export PYTHONSTARTUP="$HOME/.config/pythonstartup.py"
|
export PYTHONSTARTUP="$HOME/.config/pythonstartup.py"
|
||||||
export SCREENRC="$HOME/.config/screenrc"
|
export SCREENRC="$HOME/.config/screenrc"
|
||||||
export SQLITE_HISTFILE="$HOME/.cache/sqlite_history"
|
export SQLITE_HISTFILE="$HOME/.cache/sqlite_history"
|
||||||
export TASKRC="$HOME/.config/taskrc"
|
|
||||||
direnv TASKDATA "$HOME/.config/task"
|
|
||||||
direnv TERMINFO "$HOME/.config/terminfo"
|
direnv TERMINFO "$HOME/.config/terminfo"
|
||||||
direnv TIMEWARRIORDB "$HOME/.config/timewarrior"
|
|
||||||
export RXVT_SOCKET="$HOME/.cache/urxvtd-$HOST"
|
export RXVT_SOCKET="$HOME/.cache/urxvtd-$HOST"
|
||||||
export MYVIMRC="$HOME/.config/vim/vimrc"
|
export MYVIMRC="$HOME/.config/vim/vimrc"
|
||||||
export VIMINIT="source $MYVIMRC"
|
export VIMINIT="source $MYVIMRC"
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Taskwarrior synchronisation
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/bin/task sync
|
|
||||||
Environment=TASKRC=%h/.config/taskrc
|
|
||||||
Environment=TASKDATA=%h/.config/task
|
|
|
@ -1,10 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Taskwarrior synchronisation timer
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
OnBootSec=2m
|
|
||||||
OnUnitActiveSec=5m
|
|
||||||
Unit=tasksync.service
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=timers.target
|
|
Loading…
Reference in a new issue