mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 23:43:45 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be8a6761af | |||
| c348f3625f | |||
| 094f19c99c | |||
| 5a23ae8f01 |
@@ -213,7 +213,7 @@ get_sha256sum()
|
|||||||
# $2 - filename (string)
|
# $2 - filename (string)
|
||||||
#
|
#
|
||||||
# Returns 1 when replaceable, 0 when not replaceable.
|
# Returns 1 when replaceable, 0 when not replaceable.
|
||||||
replacable()
|
replaceable()
|
||||||
{
|
{
|
||||||
FILE1="$1"
|
FILE1="$1"
|
||||||
FILE2="$2"
|
FILE2="$2"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
-- ── Install lazylazy ────────────────────────────────────────────────
|
-- ── Install lazylazy ────────────────────────────────────────────────
|
||||||
-- https://github.com/folke/lazy.nvim
|
-- https://github.com/folke/lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
local out = vim.fn.system {
|
local out = vim.fn.system {
|
||||||
'git',
|
'git',
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ local a = vim.api -- A table to store API functions
|
|||||||
g.mapleader = ' ' -- Space as the leader key
|
g.mapleader = ' ' -- Space as the leader key
|
||||||
g.maplocalleader = ' ' -- Space as the local leader key
|
g.maplocalleader = ' ' -- Space as the local leader key
|
||||||
|
|
||||||
g.colors_theme = 'pencil' -- Set the colorscheme
|
g.colors_theme = 'onedark' -- Set the colorscheme
|
||||||
-- g.colors_variant_light = 'tokyonight-day' -- Set the light variant
|
-- g.colors_variant_light = 'tokyonight-day' -- Set the light variant
|
||||||
-- g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
|
-- g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
|
||||||
|
|
||||||
|
|||||||
@@ -22,16 +22,19 @@ yabai -m config \
|
|||||||
# apps to not manage (ignore)
|
# apps to not manage (ignore)
|
||||||
# TODO: add apps from aerospace config to here
|
# TODO: add apps from aerospace config to here
|
||||||
# list active apps:
|
# list active apps:
|
||||||
# > yabai -m query --windows | jq .[].app
|
# > yabai -m query --windows | jq .[].app | sort | uniq
|
||||||
yabai -m rule --add app="1Password" manage=off
|
yabai -m rule --add app="1Password" manage=off
|
||||||
yabai -m rule --add app="Fork" manage=off
|
yabai -m rule --add app="Fork" manage=off
|
||||||
|
yabai -m rule --add app="JetBrains Rider" manage=off
|
||||||
|
yabai -m rule --add app="Logi Options" manage=off
|
||||||
|
yabai -m rule --add app="MSTeams" manage=off
|
||||||
|
yabai -m rule --add app="Microsoft Teams" manage=off
|
||||||
|
yabai -m rule --add app="PhpStorm" manage=off
|
||||||
|
yabai -m rule --add app="Slack" manage=off
|
||||||
yabai -m rule --add app="System Settings" manage=off
|
yabai -m rule --add app="System Settings" manage=off
|
||||||
yabai -m rule --add app="^Logi Options$" manage=off
|
yabai -m rule --add app="TIDAL" manage=off
|
||||||
yabai -m rule --add app="^Microsoft Teams$" manage=off
|
yabai -m rule --add app="Windows App" manage=off
|
||||||
yabai -m rule --add app="^PhpStorm$" manage=off
|
yabai -m rule --add app="Zoom" manage=off
|
||||||
yabai -m rule --add app="^Slack$" manage=off
|
|
||||||
yabai -m rule --add app="^TIDAL$" manage=off
|
|
||||||
yabai -m rule --add app="^Windows App$" manage=off
|
|
||||||
|
|
||||||
# apply rules
|
# apply rules
|
||||||
yabai -m rule --apply
|
yabai -m rule --apply
|
||||||
|
|||||||
@@ -46,9 +46,25 @@ def test():
|
|||||||
assert vercmp("2.4 >= 2.4")
|
assert vercmp("2.4 >= 2.4")
|
||||||
assert vercmp("2.5 >= 2.4")
|
assert vercmp("2.5 >= 2.4")
|
||||||
assert vercmp("3 >= 2.999")
|
assert vercmp("3 >= 2.999")
|
||||||
assert vercmp("2.9 < 2.9a")
|
assert vercmp("2.9a < 2.9")
|
||||||
assert vercmp("2.9a >= 2.8")
|
assert vercmp("2.9a >= 2.8")
|
||||||
|
|
||||||
|
# multiple comparisons in a single expression
|
||||||
|
assert vercmp("1.0 < 2.0 <= 2.0")
|
||||||
|
assert not vercmp("1.0 > 2.0 < 3.0")
|
||||||
|
|
||||||
|
# mixed major/minor version comparisons
|
||||||
|
assert vercmp("2 >= 1.5")
|
||||||
|
assert not vercmp("1 < 1.0")
|
||||||
|
|
||||||
|
# invalid operator should raise an error
|
||||||
|
try:
|
||||||
|
vercmp("1.0 <> 2.0")
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
assert False, "invalid operator did not raise"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) == 2 and sys.argv[1] == "test":
|
if len(sys.argv) == 2 and sys.argv[1] == "test":
|
||||||
|
|||||||
18
scripts/install-cheat-purebashbible.sh
Executable file → Normal file
18
scripts/install-cheat-purebashbible.sh
Executable file → Normal file
@@ -47,6 +47,22 @@ prepare_cheat_dest()
|
|||||||
echo "$cheat_dest"
|
echo "$cheat_dest"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Processes chapter files from the pure-bash-bible repository and generates or updates corresponding cheat sheets.
|
||||||
|
#
|
||||||
|
# For each chapter file, creates or updates a cheat sheet in the appropriate destination directory, removes chapter end markers, and ensures required metadata is present.
|
||||||
|
#
|
||||||
|
# Globals:
|
||||||
|
# * PBB_TEMP_DIR: Directory containing the cloned pure-bash-bible repository.
|
||||||
|
# * PBB_SYNTAX, PBB_TAGS, PBB_SOURCE: Metadata strings for cheat sheets.
|
||||||
|
#
|
||||||
|
# Outputs:
|
||||||
|
# * Writes or updates cheat sheet files in the determined cheat sheet directory.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# ```bash
|
||||||
|
# process_chapters
|
||||||
|
# ```
|
||||||
process_chapters()
|
process_chapters()
|
||||||
{
|
{
|
||||||
local cheat_dest
|
local cheat_dest
|
||||||
@@ -59,7 +75,7 @@ process_chapters()
|
|||||||
header=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
header=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
||||||
cheat_file="$cheat_dest/$header"
|
cheat_file="$cheat_dest/$header"
|
||||||
|
|
||||||
if ! replacable "$f" "$cheat_file"; then
|
if ! replaceable "$f" "$cheat_file"; then
|
||||||
cp "$f" "$cheat_file" && msg_run "Updated: $cheat_file"
|
cp "$f" "$cheat_file" && msg_run "Updated: $cheat_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user