Migrate from .stow-rename to --dotfiles

This commit is contained in:
Danielle McLean 2023-10-23 15:17:45 +11:00
parent 10d4d5ba86
commit 2d78cda2f5
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
7 changed files with 0 additions and 1 deletions

View file

@ -0,0 +1,102 @@
#!/usr/bin/env python3
###############################################################################
#
# Copyright 2016 - 2020, Thomas Lauf, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# https://www.opensource.org/licenses/mit-license.php
#
###############################################################################
from __future__ import print_function
import json
import subprocess
import sys
# Hook should extract all of the following for use as Timewarrior tags:
# UUID
# Project
# Tags
# Description
# UDAs
try:
input_stream = sys.stdin.buffer
except AttributeError:
input_stream = sys.stdin
# Make no changes to the task, simply observe.
old = json.loads(input_stream.readline().decode("utf-8", errors="replace"))
new = json.loads(input_stream.readline().decode("utf-8", errors="replace"))
print(json.dumps(new))
def extract_tags_from(json_obj):
# Extract attributes for use as tags.
tags = [json_obj['description']]
if 'project' in json_obj:
tags.append(json_obj['project'])
if 'tags' in json_obj:
tags.extend(json_obj['tags'])
return tags
def extract_annotation_from(json_obj):
if 'annotations' not in json_obj:
return '\'\''
return json_obj['annotations'][0]['description']
start_or_stop = ''
# Started task.
if 'start' in new and 'start' not in old:
start_or_stop = 'start'
# Stopped task.
elif ('start' not in new or 'end' in new) and 'start' in old:
start_or_stop = 'stop'
if start_or_stop:
tags = extract_tags_from(new)
subprocess.call(['timew', start_or_stop] + tags + [':yes'])
# Modifications to task other than start/stop
elif 'start' in new and 'start' in old:
old_tags = extract_tags_from(old)
new_tags = extract_tags_from(new)
if old_tags != new_tags:
subprocess.call(['timew', 'untag', '@1'] + old_tags + [':yes'])
subprocess.call(['timew', 'tag', '@1'] + new_tags + [':yes'])
old_annotation = extract_annotation_from(old)
new_annotation = extract_annotation_from(new)
if old_annotation != new_annotation:
subprocess.call(['timew', 'annotate', '@1', new_annotation])

View file

@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA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OQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
-----END CERTIFICATE-----

33
dot-config/task/taskrc Normal file
View file

@ -0,0 +1,33 @@
# vim: set ft=dosini :
# [Created by task 2.5.1 4/26/2020 18:33:44]
# Taskwarrior program configuration file.
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default
# Use the command 'task show' to see all defaults and overrides
# Files
data.location=$XDG_DATA_HOME/task
hooks.location=$XDG_CONFIG_HOME/task/hooks
news.version=2.6.0
# Report specifically for displaying my in-progress task in the shell prompt, as a quick reminder
report.progress.description=Tasks currently in progress
report.progress.columns=id,description.truncated
report.progress.filter=status:pending and +ACTIVE
# Sync!
taskd.server=task.00dani.me:53589
taskd.ca=$XDG_CONFIG_HOME/task/isrgrootx1.pem
taskd.certificate=$XDG_CONFIG_HOME/task/client.cert.pem
taskd.key=$XDG_CONFIG_HOME/task/client.key.pem
include $XDG_CONFIG_HOME/task/taskd.credentials
recurrence=0
include $XDG_CONFIG_HOME/task/taskrc.local

234
dot-config/vit/config.ini Normal file
View file

@ -0,0 +1,234 @@
# This is the user configuration file for VIT.
# All configuration options are listed here, commented out, and showing their
# default value when not otherwise set.
# The format is standard INI file format. Configuration sections are enclosed
# by brackets. Configuration values should be placed in their relevant section,
# using a 'name = value' format. Boolean values can be expressed by the
# following:
# True values: 1, yes, true (case insensitive)
# False values: All other values.
[taskwarrior]
# Full path to the Taskwarrior configuration file. Tilde will be expanded to
# the user's home directory.
# NOTE: This setting is overridden by the TASKRC environment variable.
#taskrc = ~/.taskrc
[vit]
# The keybinding map to use. This maps actions registered with VIT to be fired
# when the user presses the specific keys configured in the keybindings file.
# Possible keybindings are in the 'keybinding' directory, and the setting's
# value should be the filename minus the .ini extension. The default keybinding
# configuration is modeled heavily on the legacy VIT keybindings, and inspired
# by vi/vim.
#default_keybindings = vi
# The theme to use. This allows control over the colors used in the
# application itself. Possible themes are in the 'theme' directory, and the
# setting's value should be the filename minus the .py extension.
# Note that the theme does not control any coloring related to tasks -- this
# is controlled via the color settings in the Taskwarrior configuration.
#theme = default
# Boolean. If true, VIT will ask for confirmation before marking a task as done,
# deleting a task, or quitting VIT. Set to false to disable the prompts.
#confirmation = True
# Boolean. If true, VIT will show the output of the task command and wait for
# enter. If false, VIT will not show output of the task command after
# modifications to a task are made.
#wait = True
# Boolean. If true, VIT will enable mouse support for actions such as selecting
# list items.
#mouse = False
# Boolean. If true, hitting backspace against an empty prompt aborts the prompt.
#abort_backspace = False
[report]
# The default Taskwarrior report to load when VIT first starts, if no report
# or filters are passed at the command line.
#default_report = next
# The default Taskwarrior report to load when VIT first starts, if filters are
# passed at the command line with no report.
#default_filter_only_report = next
# Boolean. If true, reports with the primary sort of project ascending will
# indent subprojects. If you use deeply nested subprojects, you'll probably
# like this setting.
#indent_subprojects = True
# Boolean. If true, display report rows with alternating background colors.
#row_striping = True
[marker]
# Boolean. Enables markers. Markers are configurable labels that appear on the
# left side of a report to indicate information about a task when the displayed
# report does not contain the related column.
# For example, let's suppose you have a 'notes' UDA configured. You'd like to
# see some indication that a task has a note, without displaying the full note
# column in reports. You could configure a marker for that custom UDA as
# follows:
# uda.notes.label = (N)
# Then, when a listed task has a note associated with it, you'll see the
# marker '(N)' displayed in the leftmost column of any report that displays the
# task in question.
#enabled = True
# What columns to generate markers for. Can either be 'all' for all columns, or
# a comma separated list of columns to enable markers for. Possible columns
# are:
# depends,description,due,project,recur,scheduled,start,status,tags,until
#columns = all
# The header label for the markers column when it is displayed.
#header_label =
# Boolean. If true, an associated color value must be configured in the
# Taskwarrior configuration in order for the marker to be displayed. If false,
# and no Taskwarrior color configuration is present for the matching marker,
# then it is not displayed.
# For example, if this is set to True, then for the above-mentioned 'notes'
# marker to be displayed, a matching Taskwarrior color configuration for the
# 'notes' UDA must be present, e.g.:
# color.uda.notes=yellow
#require_color = True
# Boolean. If true, subprojects of a project will also display the configured
# root project's marker, if the subproject itself does not have its own marker
# configured.
# For example, given the following projects:
# Foo
# Foo.Bar
# If this value is set to True, and the Foo project has a configured marker,
# then Foo.Bar would also display Foo's marker.
#include_subprojects = True
# Below are listed all of the available markers, with their default label.
# To disable a specific marker, set its label to empty. Any section enclosed
# in brackets should be replaced by the appropriate identifier, eg.
# [project_name] with the actual name of a project.
#active.label = (A)
#blocked.label = (BD)
#blocking.label = (BG)
#completed.label = (C)
#deleted.label = (X)
#due.label = (D)
#due.today.label = (DT)
#keyword.label = (K)
#keyword.[keyword_name].label =
#overdue.label = (OD)
#project.label = (P)
#project.none.label =
#project.[project_name].label =
#recurring.label = (R)
#scheduled.label = (S)
#tag.label = (T)
#tag.none.label =
#tag.[tag_name].label =
#uda.label =
#uda.priority.label = (PR)
#uda.[uda_name].label =
[color]
# Boolean. If true, use the colors in Taskwarrior's configuration to colorize
# reports. Note that VIT uses a fundamentally different paradigm for
# colorization, which combines tying coloring to associated report columns in
# combination with markers (see above). This setting works independently of
# Taskwarriors 'color' config setting.
#enabled = True
# Boolean. If true, subprojects of a project will also display the configured
# root project's color, if the subproject itself does not have its own color
# configured.
# For example, given the following projects:
# Foo
# Foo.Bar
# If this value is set to True, and the Foo project has a configured color,
# then Foo.Bar would also display Foo's color.
#include_subprojects = True
# For the Taskwarrior color configuration, there are three special values:
# color.project.none
# color.tag.none
# color.uda.[uda_name].none
# If any of these are configured for color, then the label below will be used
# in the related column to display the color configuration.
#none_label = [NONE]
[keybinding]
# This section allows you to override the configured keybindings, associate
# additional keybindings with VIT actions, and set up macros triggered by a
# keybinding.
# Meta keys are enclosed in angle brackets, variables are enclosed in curly
# brackets. Keybindings here can either be:
# - Associated with a single VIT action
# - A macro that describes a series of key presses to replay
# For VIT actions, the form is:
# keys[,keys] = {ACTION_NAME}
# For example, to associate the keybinding 'zz' with the undo action:
# zz = {ACTION_TASK_UNDO}
# To only disable a keybinding, use the special noop action:
# w = {ACTION_NOOP}
# wa = {ACTION_TASK_WAIT}
# The above would disable the task wait action for the 'w' key, and instead
# assign it to the 'wa' keybinding.
# For capital letter keybindings, use the letter directly:
# D = {ACTION_TASK_DONE}
# For a list of available actions, run 'vit --list-actions'.
# A great reference for many of the available meta keys, and understanding the
# default keybindings is the 'keybinding/vi.ini' file.
# For macros, the form is:
# keys[,keys] = keypresses
# For example, to map the 'o' key to opening the OneNote script, passing it
# the currently focused task UUID:
# o = :!wr onenote {TASK_UUID}<Enter>
# The special '{TASK_[attribute]}' variable can be used in any macro, and it
# will be replaced with the value of the attribute for the currently
# highlighted task. Any attribute listed in 'task _columns' is supported, e.g.
# o = :!wr echo project is {TASK_PROJECT}<Enter>
# Multiple keybindings can be associated with the same action/macro, simply
# separate the keybindings with a comma:
# <Ctrl> z,zz = {ACTION_TASK_UNDO}
# 'Special' keys are indicated by enclosing them in brackets. VIT supports the
# following special keys on either side of the keybinding declaration, by
# internally translating them into the single character:
#
# <Colon>
# <Equals>
# <Space>
# <Semicolon>
#
# Under the hood, VIT uses the Urwid mappings for keyboard input:
# http://urwid.org/manual/userinput.html
#
# Any modifier, navigation, or function keys can be described in the VIT
# keybinding configuration by wrapping them in angle brackets, matching the
# correct Urwid keyboard input structure:
#
# <Ctrl> e = :!wr echo do something
# <Shift> <Ctrl> <F5> = :!wr echo you used a function key

View file

@ -0,0 +1,4 @@
#! zsh
if [[ -z $RPROMPT ]]; then
RPROMPT='$(task progress rc.verbose=nothing rc.gc=0)'
fi

View file

@ -0,0 +1,7 @@
#! zsh
if [[ -z $TIMEWARRIORDB ]]; then
export TIMEWARRIORDB=$XDG_DATA_HOME/timew
fi
if [[ -z $VIT_DIR ]]; then
export VIT_DIR=$XDG_CONFIG_HOME/vit
fi