Migrate from .stow-rename to --dotfiles

This commit is contained in:
Danielle McLean 2023-10-23 15:15:37 +11:00
parent 2cd7ee3bf7
commit f309f3a7a6
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
20 changed files with 0 additions and 2 deletions

1
dot-config/swiftbar/bin/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.repository.json

View file

@ -0,0 +1,48 @@
#!/bin/zsh
path+=(/usr/local/bin)
mpc==mpc
print -n ♫
state=$(mpc status | sed '/^[^\[]/d; s/^\[\(.*\)\].*$/\1/')
i=$(mpc current -f %position%)
if [[ $state == playing ]]; then
icon=' ▶ '
menu=("Ⅱ Pause | terminal=false bash=$mpc param1=pause")
else
icon=' Ⅱ '
menu=("▶ Play | terminal=false bash=$mpc param1=play")
fi
if [[ -n $state ]]; then
print -n $icon
menu=(
"⏪ Previous | terminal=false bash=$mpc param1=prev"
$menu
"⏩ Next | terminal=false bash=$mpc param1=next"
"⏹ Stop | terminal=false bash=$mpc param1=stop"
)
else
i=0
print
fi
menu=(--- $menu "🔀 Shuffle | terminal=false bash=$mpc param1=shuffle" ---)
format=()
for field in position title artist; format+=($field %$field%)
songs=( ${(f)"$(mpc playlist -f ${(j-::-)format})"} )
typeset -A song
for s in $songs; do
song=(${(s/::/)s})
song[menu]="$song[title] - $song[artist] | length=50"
if (( $song[position] == $i )); then
print "$song[title] | length=30"
else
song[menu]+=" terminal=false bash=$mpc param1=play param2=$song[position]"
fi
menu+=($song[menu])
done
print -l -- $menu

View file

@ -0,0 +1,9 @@
#!/usr/bin/python
import sys
from os.path import abspath, dirname, join
LIB = join(dirname(dirname(abspath(sys.argv[0]))), 'lib')
sys.path.insert(0, LIB)
import taskpaper
taskpaper.count('~/Dropbox/Tasks/eCoach.taskpaper', icon='ecoach')

View file

@ -0,0 +1,9 @@
#!/usr/bin/python
import sys
from os.path import abspath, dirname, join
LIB = join(dirname(dirname(abspath(sys.argv[0]))), 'lib')
sys.path.insert(0, LIB)
import taskpaper
taskpaper.count('~/Dropbox/Tasks/Personal.taskpaper')

View file

@ -0,0 +1,32 @@
#!/bin/zsh
# <bitbar.title>yabai mode</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Danielle McLean</bitbar.author>
# <bitbar.author.github>00dani</bitbar.author.github>
# <bitbar.desc>Display current desktop ID and layout from yabai.</bitbar.desc>
# <bitbar.dependencies>brew,yabai</bitbar.dependencies>
# For info about yabai, see: https://github.com/koekeishiya/yabai
path=(/usr/local/bin $path)
yabai==yabai
modes=(
bsp 🌳
stack 📚
float ⛵
)
typeset -A icons
icons=($modes)
yabai -m query --spaces | jq -r 'map(select(.focused == 1))[-1] | (.index | tostring) + " " + .type' | read id mode
print -l "$icons[$mode] $id" "---"
for m i in $modes; do
if [[ $mode = $m ]]; then
print $i $m
else
print "$i $m | terminal=false bash=$yabai param1=-m param2=space param3=--layout param4=$m"
fi
done

View file

@ -0,0 +1,29 @@
import base64
import inspect
import os.path as p
import sys
PATH = p.dirname(p.abspath(inspect.getfile(inspect.currentframe())))
def count(file, icon='default'):
project = ''
items = []
with open(p.expanduser(file)) as f:
for line in f:
if project.lower() == 'archive': break
line = line.strip()
if line.endswith(':'):
project = line[:-1]
elif line.startswith('- ') and '@done' not in line:
items.append('%s (%s)' % (line[2:], project))
if not items: return
with open(p.join(PATH, icon + '.png')) as img:
icon = base64.b64encode(img.read())
print("%d | templateImage='%s'" % (len(items), icon))
print('---')
print("%s | terminal=false bash=/usr/bin/open param1='%s'" % (file, p.expanduser(file)))
print('---')
for item in items: print(item)

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B