Compare commits

..

3 commits

Author SHA1 Message Date
850b880bf0
update.sh: track more 2024-06-19 08:19:50 -05:00
95f6abdf90
note-taker.sh: init 2024-06-19 08:19:05 -05:00
a93369e278
autostarts (i3ipc): init 2024-06-19 08:18:31 -05:00
3 changed files with 79 additions and 3 deletions

View file

@ -0,0 +1,34 @@
---
autostarts:
pre: # blocking tasks before others; ie: backup
- "truncate -s 0 --no-create ~/.gnupg/trezor/gpg-agent.log" # this grows ridiculously large/fast, clear it on login - before backup
- "kitty ~/.local/bin/backup_restic --single-instance --instance-group autostart"
weekend: [] # blocking tasks to run on weekends, after 'pre' but before the rest in 'common'. 'work' is excluded from weekends.
# - "/usr/bin/flatpak update --user --noninteractive --assumeyes | systemd-cat -t flatpak-update"
common:
- "/usr/bin/mako"
- "/usr/libexec/xfce-polkit" # minimal polkit (gnome is busted), LXQt has an alright option too
- "kitty --session ~/.config/kitty/sessions/monitoring.conf --title stats"
- "wl-paste -t text --watch clipman store --no-persist"
- "firefox-wayland" # flatpak/IPA don't seem to work nicely together RE: trust/self-signed
- "flatpak run --user com.valvesoftware.Steam -silent -nofriendsui -voice_quality 3 -tcp"
- "gtk4-launch discord.desktop"
- "blueman-applet"
# - "gtk4-launch quasselclient.desktop"
- "env XDG_CURRENT_DESKTOP=Unity kdeconnect-indicator"
- "nm-applet"
# - "env ELECTRON_NO_UPDATER=1 gtk4-launch bitwarden.desktop" # disable the updater when running automatically
- "env XDG_CURRENT_DESKTOP=Unity tuned-switcher"
- "thunderbird-wayland -P jlay"
- "flatpak run --file-forwarding org.signal.Signal --class='Signal' --app-id='Signal'"
# - "flatpak run org.kde.kweather"
# - "flatpak run com.belmoussaoui.Authenticator"
# - "bash -c 'ulimit -n 1048576; strawberry --quiet'"
# - "rhythmbox"
work:
- "kitty --session ~/.config/kitty/sessions/triplesplit.conf" # main term, single instance w/ three panes. one with (tabbed) vim for weekly notes
- "swayidle" # attempt to be modestly compliant; lock screen when away
# - "gtk4-launch slack.desktop"
# - "/opt/Webex/bin/CiscoCollabHost" # I broke the layout on wayland, use browser instead - can share
# - "firefox-wayland --new-instance --no-remote --name='work-firefox' --class='work-firefox' -P workIBM" # RIP 4/30/2024; no mas w/ IBM
# - "systemctl --user start macbookTunnel.service" # "

View file

@ -0,0 +1,42 @@
#!/bin/bash
# with Sway on login, a Kitty session is started which runs *this* script
# provides a pane with an editor on notes for this week (and last)
#
# my kitty session config:
# # ~/config/kitty/sessions/triplesplit.conf
# layout tall
# launch --location=hsplit --cwd=current bash
# launch --location=hsplit --cwd=current bash
# launch --location=hsplit --cwd=current bash .config/kitty/scripts/note-taker.sh
# the last command is *this script*
#
SCRIPT_NAME=$(basename "$0")
# Check if the script is already running/controlling editors
if pgrep -f "$SHELL.*$SCRIPT_NAME" | grep -v $$ > /dev/null; then
echo "The notes are already being edited elsewhere."
exit 1
fi
# Where are notes held? Can be overridden outside of the script; defaults to ~/notes
NOTE_DIR="${NOTE_DIR:-${HOME}/notes}"
# Get the current year and week number, used for the name of the file. eg: 2023-week40
CURRENT_NOTE=$(date +%Y-week%V)
# Get the year and week number for the same day of the previous week
LAST_WEEK_NAME=$(date -d '7 days ago' +%Y-week%V)
# Construct the two note files to open in tabs as one array
NOTE_PATHS=("$NOTE_DIR/$CURRENT_NOTE" "$NOTE_DIR/$LAST_WEEK_NAME")
# Use EDITOR variable or fallback to vim as default.
# If EDITOR contains "vim" (like nvim, vim, etc.), add tab arguments.
EDITOR="${EDITOR:-vim}"
if [[ $EDITOR == *vim* ]]; then
# Run the vim-like editor with tabs
$EDITOR -c ':tab all' "${NOTE_PATHS[@]}"
else
# Run the editor without vim tab arg; assume array is fine
$EDITOR "${NOTE_PATHS[@]}"
fi

View file

@ -3,7 +3,6 @@
# minimal dotfile manager
# tracks files / copies them into the repo, sorted by hostname
#
# note: assumes pwd is this repo before running this script
set -u
# array of files/dirs [relative to home] to include
@ -18,17 +17,18 @@ DOTS=(
'.config/nvim/coc-settings.json'
'.config/autostart-i3ipc.yml'
'.config/sway/'
'.local/bin/note-taker.sh' # run by Kitty in a 'triplesplit' session, one of many of autostart 'wants' in '...-i3ipc.yml' above
)
# to avoid hacky pwd/dirname stuff w/ $0 [for now?], inline the path to the repo where copies are held
DOT_DIR="${HOME}/git/dot"
# ensure the host running this script/updating dotfiles has a directory within the repo
# then, begin dotfile processing - ensure structure is retained, naively copy w/ rsync
# at the end/out of band: rely on Git to tell us about changes. TODO: reconsider, edge cases? auto commit/push?
HOST_DIR="${DOT_DIR}/${HOSTNAME}"
[ -d "$HOST_DIR" ] || mkdir -v "$HOST_DIR"
# begin dotfile processing - ensure structure is retained, naively copy w/ rsync. rely on Git to tell us about changes.
# TODO: reconsider, edge cases?
for DOT in "${DOTS[@]}"; do
echo "Copying '$HOME/$DOT' to '$HOST_DIR/${DOT}'"
rsync -aqv "$HOME/$DOT" "$HOST_DIR/${DOT}" || echo "Couldn't copy '$DOT', got rc: $?"