Compare commits
10 commits
e36ed17a97
...
c6de9b0686
| Author | SHA1 | Date | |
|---|---|---|---|
| c6de9b0686 | |||
| 41754c5d24 | |||
| 15cf9b192b | |||
| 2eebe047f6 | |||
| 0ce49d758a | |||
| a01431609f | |||
| ea066eebb5 | |||
| 47a96a2d42 | |||
| 554e13cd36 | |||
| 07a619060a |
12 changed files with 147 additions and 103 deletions
|
|
@ -4,6 +4,12 @@
|
||||||
if [ -d "$TURNSTILE_ENV_DIR" ]; then
|
if [ -d "$TURNSTILE_ENV_DIR" ]; then
|
||||||
echo "$DISPLAY" >"$TURNSTILE_ENV_DIR/DISPLAY"
|
echo "$DISPLAY" >"$TURNSTILE_ENV_DIR/DISPLAY"
|
||||||
echo "$WAYLAND_DISPLAY" >"$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY"
|
echo "$WAYLAND_DISPLAY" >"$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY"
|
||||||
|
echo "ADDING KEYCHAIN TO ENV"
|
||||||
|
keychain --eval --quiet --agents ssh,gpg C414FF88A557F29AFEF76C7E73BA40D5AFAF49C9
|
||||||
|
echo "$SSH_AUTH_SOCK">"$TURNSTILE_ENV_DIR/SSH_AUTH_SOCK"
|
||||||
|
echo "$SSH_AGENT_PID">"$TURNSTILE_ENV_DIR/SSH_AGENT_PID"
|
||||||
|
echo "$GPG_AGENT_INFO">"$TURNSTILE_ENV_DIR/GPG_AGENT_INFO"
|
||||||
|
echo "DONE ADDING KEYCHAIN TO ENV"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mod="Mod4"
|
mod="Mod4"
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
"format": "{icon}{0}", // issue tracked here https://github.com/Alexays/Waybar/issues/3623
|
"format": "{icon}{0}", // issue tracked here https://github.com/Alexays/Waybar/issues/3623
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"event": "",
|
"event": "",
|
||||||
|
"event-today": " ",
|
||||||
"no-event": "",
|
"no-event": "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,16 @@ for line in lines:
|
||||||
if len(clean_line) and clean_line[0] not in ["0", "1", "2"]:
|
if len(clean_line) and clean_line[0] not in ["0", "1", "2"]:
|
||||||
clean_line = "\n<b>" + clean_line + "</b>"
|
clean_line = "\n<b>" + clean_line + "</b>"
|
||||||
new_lines.append(clean_line)
|
new_lines.append(clean_line)
|
||||||
|
|
||||||
output = "\n".join(new_lines).strip()
|
output = "\n".join(new_lines).strip()
|
||||||
|
|
||||||
data["alt"] = "no-event"
|
if today in output: # an event today!
|
||||||
data["tooltip"] = output
|
data["alt"] = "event-today"
|
||||||
|
|
||||||
if today in output:
|
|
||||||
data["text"] = output.split("\n")[1]
|
data["text"] = output.split("\n")[1]
|
||||||
|
elif output: # an event in the week!
|
||||||
data["alt"] = "event"
|
data["alt"] = "event"
|
||||||
|
data["tooltip"] = output
|
||||||
|
else: # no events
|
||||||
|
data["alt"] = "no-event"
|
||||||
|
|
||||||
print(json.dumps(data))
|
print(json.dumps(data))
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,35 @@ vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||||
group = vim.api.nvim_create_augroup("highlightyanks", { clear = true }),
|
group = vim.api.nvim_create_augroup("highlightyanks", { clear = true }),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local private_mode = function()
|
||||||
|
vim.o.shada = ""
|
||||||
|
vim.o.swapfile = false
|
||||||
|
vim.o.undofile = false
|
||||||
|
vim.o.backup = false
|
||||||
|
vim.o.writebackup = false
|
||||||
|
vim.o.shelltemp = false
|
||||||
|
vim.o.history = 0
|
||||||
|
vim.o.modeline = false
|
||||||
|
vim.o.secure = true
|
||||||
|
end
|
||||||
-- Special setting for editing gopass files - make sure nothing leaks outside the directories it
|
-- Special setting for editing gopass files - make sure nothing leaks outside the directories it
|
||||||
-- is supposed to
|
-- is supposed to
|
||||||
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("passnoleak", { clear = true }),
|
||||||
pattern = {
|
pattern = {
|
||||||
"/dev/shm/gopass.*",
|
"/dev/shm/gopass.*",
|
||||||
"/dev/shm/pass.?*/?*.txt",
|
"/dev/shm/pass.?*/?*.txt",
|
||||||
"$TMPDIR/pass.?*/?*.txt",
|
"$TMPDIR/pass.?*/?*.txt",
|
||||||
"/tmp/pass.?*/?*.txt",
|
"/tmp/pass.?*/?*.txt",
|
||||||
},
|
},
|
||||||
command = "setlocal noswapfile nobackup noundofile nowritebackup viminfo=",
|
|
||||||
desc = "Don't leak any information when editing potential password files",
|
desc = "Don't leak any information when editing potential password files",
|
||||||
group = vim.api.nvim_create_augroup("passnoleak", { clear = true }),
|
callback = private_mode,
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ "BufNewFile", "BufReadPre" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("PrivateJrnl", {}),
|
||||||
|
pattern = "*.jrnl",
|
||||||
|
desc = "Don't leak information when editing jrnl files",
|
||||||
|
callback = private_mode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- remove line numbers from terminal buffers
|
-- remove line numbers from terminal buffers
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ return { -- file/item pickers and managers
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
fzf_opts = { ["--select-1"] = false },
|
|
||||||
keymap = {
|
keymap = {
|
||||||
builtin = {
|
builtin = {
|
||||||
true,
|
true,
|
||||||
|
|
@ -78,7 +77,10 @@ return { -- file/item pickers and managers
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, -- FIXME: Does not seem to work with single result and still closes instantly?
|
defaults = { -- FIXME: Does not seem to work with single result and still closes instantly?
|
||||||
|
jump1 = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
opts.actions = opts.actions or { true }
|
opts.actions = opts.actions or { true }
|
||||||
opts.actions["ctrl-q"] = require("fzf-lua").actions.file_sel_to_qf
|
opts.actions["ctrl-q"] = require("fzf-lua").actions.file_sel_to_qf
|
||||||
|
|
|
||||||
|
|
@ -168,39 +168,49 @@ local prose_plugs = {
|
||||||
-- bring zettelkasten commands
|
-- bring zettelkasten commands
|
||||||
{
|
{
|
||||||
"zk-org/zk-nvim",
|
"zk-org/zk-nvim",
|
||||||
config = function()
|
opts = function()
|
||||||
if require("core.util").is_available("which-key") then
|
if require("core.util").is_available("which-key") then
|
||||||
require("which-key").add({
|
require("which-key").add({
|
||||||
{ "<leader>n", group = "notes" },
|
{ "<leader>n", group = "notes" },
|
||||||
{ "<localleader>n", group = "note" },
|
{ "<localleader>n", group = "note" },
|
||||||
{ "<localleader>n", group = "note", mode = "v" },
|
{ "<localleader>n", group = "note", mode = "v" },
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
require("zk.commands").add("ZkOrphans", function(opts)
|
require("zk.commands").add("ZkOrphans", function(opts)
|
||||||
opts = vim.tbl_extend("force", { orphan = true }, opts or {})
|
opts = vim.tbl_extend("force", { orphan = true }, opts or {})
|
||||||
require("zk").edit(opts, { title = "Zk Orphans" })
|
require("zk").edit(opts, { title = "Zk Orphans" })
|
||||||
end)
|
end)
|
||||||
require("zk.commands").add("ZkGrep", function(opts)
|
require("zk.commands").add("ZkGrep", function(opts)
|
||||||
local collection = {}
|
local collection = {}
|
||||||
local list_opts = { select = { "title", "path", "absPath" } }
|
local list_opts = { select = { "title", "path", "absPath" } }
|
||||||
require("zk.api").list(vim.env.ZK_NOTEBOOK_DIR, list_opts, function(_, notes)
|
require("zk.api").list(vim.env.ZK_NOTEBOOK_DIR, list_opts, function(_, notes)
|
||||||
for _, note in ipairs(notes) do
|
for _, note in ipairs(notes) do
|
||||||
collection[note.absPath] = note.title or note.path
|
collection[note.absPath] = note.title or note.path
|
||||||
end
|
end
|
||||||
end)
|
|
||||||
local options = vim.tbl_deep_extend("force", {
|
|
||||||
prompt_title = "Notes",
|
|
||||||
search_dirs = { vim.env.ZK_NOTEBOOK_DIR },
|
|
||||||
disable_coordinates = true,
|
|
||||||
path_display = function(_, path)
|
|
||||||
return collection[path]
|
|
||||||
end,
|
|
||||||
}, opts or {})
|
|
||||||
require("telescope.builtin").live_grep(options)
|
|
||||||
end)
|
end)
|
||||||
|
local search_dir = vim.env.ZK_NOTEBOOK_DIR
|
||||||
|
local options = vim.tbl_deep_extend("force", {
|
||||||
|
prompt = "Note Grep❯ ",
|
||||||
|
-- cmd = "cd " .. search_dir .. "; rg --vimgrep",
|
||||||
|
cwd = search_dir,
|
||||||
|
disable_coordinates = true,
|
||||||
|
path_display = function(_, path)
|
||||||
|
return collection[path]
|
||||||
|
end,
|
||||||
|
}, opts or {})
|
||||||
|
-- FIXME: Don't hard-code this so much?
|
||||||
|
-- require("telescope.builtin").live_grep(options)
|
||||||
|
require("fzf-lua").live_grep(options)
|
||||||
|
end)
|
||||||
|
local picker = "select"
|
||||||
|
if require("core.util").is_available("fzf-lua") then
|
||||||
|
picker = "fzf_lua"
|
||||||
|
elseif require("core.util").is_available("telescope") then
|
||||||
|
picker = "telescope"
|
||||||
end
|
end
|
||||||
require("zk").setup({
|
require("zk").setup({
|
||||||
picker = "telescope",
|
picker = picker,
|
||||||
lsp = {
|
lsp = {
|
||||||
auto_attach = {
|
auto_attach = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
# From: https://gist.github.com/varunagrawal/2b93c5dc721520ff6876e940c420ab05
|
|
||||||
# This hooks script syncs task warrior to the configured task server.
|
|
||||||
# The on-exit event is triggered once, after all processing is complete.
|
|
||||||
|
|
||||||
# Make sure hooks are enabled and this hook script is executable.
|
|
||||||
# Run `task diag` for diagnostics on the hook.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import json
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
try:
|
|
||||||
tasks = json.loads(sys.stdin.readline())
|
|
||||||
except:
|
|
||||||
# No input
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
# no tasks to work through, don't error
|
|
||||||
if len(tasks) <= 0:
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
# Call the `sync` command
|
|
||||||
# hooks=0 ensures that the sync command doesn't call the on-exit hook
|
|
||||||
# verbose=nothing sets the verbosity to print nothing at all
|
|
||||||
subprocess.Popen(["task", "rc.verbose=nothing", "rc.hooks=0", "sync"], close_fds=True)
|
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
65
office/.local/share/task/hooks/on-exit.git-backup
Executable file
65
office/.local/share/task/hooks/on-exit.git-backup
Executable file
|
|
@ -0,0 +1,65 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Automatically git commits, pushes and pulls if doable in the taskwarrior data directory
|
||||||
|
#
|
||||||
|
# Much of this taken from: https://github.com/mrschyte/taskwarrior-hooks/
|
||||||
|
# with much gratitude
|
||||||
|
#
|
||||||
|
# The minimum amount of time required between 2 commits in seconds.
|
||||||
|
# So only if the last commit is at least x seconds old will a new one
|
||||||
|
# be created. Set to 0 to sync each taskwarrior change.
|
||||||
|
MINIMUM_WAIT_TIME=600
|
||||||
|
|
||||||
|
# Do not display status information.
|
||||||
|
QUIET=true
|
||||||
|
|
||||||
|
# Removes the tasks.json file after each run, keeping the
|
||||||
|
# task directory clean.
|
||||||
|
REMOVE_JSON=false
|
||||||
|
|
||||||
|
if [ "${DISABLE_HOOKS}" = "true" ] || ! command -v git >/dev/null 2>&1; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" != "api:2" ]; then
|
||||||
|
printf "Taskwarrior uses different data API version than git plugin. Aborting!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
data_dir="$(echo "$5" | cut -f2 -d:)"
|
||||||
|
command_run="$(echo "$3" | cut -f2 -d:)"
|
||||||
|
|
||||||
|
if [ "$command_run" = "synchronize" ]; then
|
||||||
|
DISABLE_HOOKS=true env task sync
|
||||||
|
|
||||||
|
git -C "$data_dir" pull >/dev/null 2>&1
|
||||||
|
pull_ret="$?"
|
||||||
|
git -C "$data_dir" push >/dev/null 2>&1
|
||||||
|
push_ret="$?"
|
||||||
|
if [ "$pull_ret" -eq 0 ] && [ "$push_ret" -eq 0 ]; then
|
||||||
|
[ $QUIET = "true" ] || echo "Git upstream synchronized."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
last_commit=$(git -C "$data_dir" log -1 --format="%at")
|
||||||
|
# if now is not yet greater than last commit + wait time do nothing
|
||||||
|
if [ "$(date "+%s")" -lt $((last_commit + MINIMUM_WAIT_TIME)) ]; then
|
||||||
|
# TODO: Implement DEBUG msg level (info/debug) system
|
||||||
|
# echo "Too early to check for changes, exiting."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo "EXPORTING TASKS"
|
||||||
|
DISABLE_HOOKS=true env task export > "$data_dir/tasks.json"
|
||||||
|
# after any command, if there's changes add and commit
|
||||||
|
if ! git -C "$data_dir" diff --exit-code >/dev/null 2>&1; then
|
||||||
|
# echo "found changes"
|
||||||
|
# need to run to fully update tasks that just got done
|
||||||
|
DISABLE_HOOKS=true env task next >/dev/null 2>&1
|
||||||
|
|
||||||
|
header="auto: ${2##* }"
|
||||||
|
msg="full command: $2"
|
||||||
|
git -C "$data_dir" commit "$data_dir/tasks.json" -m "$header" -m "$msg" --no-gpg-sign >/dev/null 2>&1
|
||||||
|
[ $QUIET = "true" ] || echo "Backup up to git."
|
||||||
|
fi
|
||||||
|
[ "$REMOVE_JSON" = true ] && rm "$data_dir/tasks.json" >/dev/null 2>&1
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# Automatically git commits, pushes and pulls if doable in the taskwarrior data directory
|
|
||||||
#
|
|
||||||
# Much of this taken from: https://github.com/mrschyte/taskwarrior-hooks/
|
|
||||||
# with much gratitude
|
|
||||||
|
|
||||||
if [ "${DISABLE_HOOKS}" = "true" ] || ! command -v git >/dev/null 2>&1; then
|
|
||||||
exit 0;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" != "api:2" ]; then
|
|
||||||
printf "Taskwarrior uses different data API version than git plugin. Aborting!" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
data_dir="$(echo "$5" | cut -f2 -d:)"
|
|
||||||
command_run="$(echo "$3" | cut -f2 -d:)"
|
|
||||||
|
|
||||||
# after any command, if there's changes add and commit
|
|
||||||
if ! git -C "$data_dir" diff --exit-code >/dev/null 2>&1; then
|
|
||||||
# need to run to fully update tasks that just got done
|
|
||||||
DISABLE_HOOKS=true env task next >/dev/null 2>&1
|
|
||||||
|
|
||||||
header="auto: ${2##* }"
|
|
||||||
msg="full command: $2"
|
|
||||||
git -C "$data_dir" commit -a -m "$header" -m "$msg" --no-gpg-sign >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$command_run" = "synchronize" ]; then
|
|
||||||
DISABLE_HOOKS=true env task sync
|
|
||||||
|
|
||||||
git -C "$data_dir" pull >/dev/null 2>&1
|
|
||||||
pull_ret="$?"
|
|
||||||
git -C "$data_dir" push >/dev/null 2>&1
|
|
||||||
push_ret="$?"
|
|
||||||
if [ "$pull_ret" -eq 0 ] && [ "$push_ret" -eq 0 ]; then
|
|
||||||
echo Git upstream synchronized.
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import os
|
import os
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from freedirect.freedirect import Redirects
|
||||||
|
|
||||||
# pylint: disable=C0111
|
# pylint: disable=C0111
|
||||||
from qutebrowser.config.config import ConfigContainer # noqa: F401
|
from qutebrowser.config.config import ConfigContainer # noqa: F401
|
||||||
from qutebrowser.config.configfiles import ConfigAPI
|
from qutebrowser.config.configfiles import ConfigAPI
|
||||||
|
|
||||||
from freedirect.freedirect import Redirects
|
|
||||||
|
|
||||||
config: ConfigAPI = cast(ConfigAPI, config) # noqa: F821 pylint: disable=E0602,C0103
|
config: ConfigAPI = cast(ConfigAPI, config) # noqa: F821 pylint: disable=E0602,C0103
|
||||||
c: ConfigContainer = cast(ConfigContainer, c) # noqa: F821 pylint: disable=E0602,C0103
|
c: ConfigContainer = cast(ConfigContainer, c) # noqa: F821 pylint: disable=E0602,C0103
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ c.content.javascript.log_message.excludes = {
|
||||||
"userscript:_qute_js": ["*TrustedHTML*"],
|
"userscript:_qute_js": ["*TrustedHTML*"],
|
||||||
}
|
}
|
||||||
|
|
||||||
term = os.getenv("TERMINAL", "xterm")
|
term = os.getenv("TERMINAL", "wezterm")
|
||||||
|
|
||||||
c.completion.web_history.max_items = 1000
|
c.completion.web_history.max_items = 1000
|
||||||
c.hints.uppercase = True
|
c.hints.uppercase = True
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,11 @@ case "$result" in
|
||||||
if [ -n "$POWERMENU_LOGOUT_CMD" ]; then eval "$POWERMENU_LOGOUT_CMD"; else
|
if [ -n "$POWERMENU_LOGOUT_CMD" ]; then eval "$POWERMENU_LOGOUT_CMD"; else
|
||||||
command -v i3 >/dev/null 2>&1 && i3-msg exit
|
command -v i3 >/dev/null 2>&1 && i3-msg exit
|
||||||
command -v riverctl >/dev/null 2>&1 && riverctl exit
|
command -v riverctl >/dev/null 2>&1 && riverctl exit
|
||||||
|
# Try to heuristically find the program started by greetd and shut it down.
|
||||||
|
# Generally this will just be a 'pause' program on my system.
|
||||||
|
if command -v pgrep >/dev/null 2>&1 && pgrep greetd; then
|
||||||
|
kill $(pgrep -P "$(pgrep greetd | tr '\n' ',')" pause)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"Suspend" | "$suspend_btn")
|
"Suspend" | "$suspend_btn")
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
_zk_wiki() {
|
_zk_wiki() {
|
||||||
zk --notebook-dir="$WIKIROOT" "$@"
|
zk --working-dir="$WIKIROOT" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
n() {
|
n() {
|
||||||
|
|
@ -26,6 +26,9 @@ if [ -n "${WIKIROOT}" ]; then
|
||||||
nn() { # 'new note'
|
nn() { # 'new note'
|
||||||
_zk_wiki new "$@"
|
_zk_wiki new "$@"
|
||||||
}
|
}
|
||||||
|
nni() { # 'new note inbox'
|
||||||
|
_zk_wiki new -t "${*}" inbox
|
||||||
|
}
|
||||||
nnl() { # 'new note log'
|
nnl() { # 'new note log'
|
||||||
_zk_wiki log "$@"
|
_zk_wiki log "$@"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue