various updates
This commit is contained in:
parent
d0525f25a8
commit
bf1a1a9ee2
32 changed files with 426 additions and 173 deletions
|
@ -1,17 +1,17 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
if mountpoint -q /media/samsung-T3; then
|
||||
# sudo /usr/bin/rsnapshot daily
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf daily
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🏠 Daily `/home` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Daily `/home` backup failed.'
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Daily `/home` backup failed.' || exit $?
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
THIS_FILE=${0}
|
||||
SLACK_NOTIFIER="/home/thomas/dotfiles/scripts/slack_notifier.sh"
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly
|
||||
# sudo /usr/bin/rsnapshot hourly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🏠 Hourly `/home` backup completed successfully'
|
||||
if mountpoint -q /media/samsung-T3; then
|
||||
SNAPSHOT=$(sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly 2>&1 1>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
$SLACK_NOTIFIER "backups" "ERROR Hourly /home backup failed" "$SNAPSHOT"
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Hourly `/home` backup failed.'
|
||||
$SLACK_NOTIFIER "backups" "SUCCESS Hourly /home backup completed."
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🏠 Error: `/home` backup drive not mounted.'
|
||||
$SLACK_NOTIFIER "backups" "ERROR Hourly /home backup failed: disk not mounted."
|
||||
fi
|
||||
|
|
|
@ -5,13 +5,13 @@ export XDG_RUNTIME_DIR=/run/user/1000
|
|||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
if mountpoint -q /media/samsung-T3; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf monthly
|
||||
# sudo /usr/bin/rsnapshot monthly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🏠 Monthly `/home` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Monthly `/home` backup failed.'
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Weekly `/home` backup failed.' || exit $?
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
|
|
|
@ -3,16 +3,15 @@
|
|||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
if mountpoint -q /media/samsung-T3; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf weekly
|
||||
# sudo /usr/bin/rsnapshot weekly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🏠 Weekly `/home` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Weekly `/home` backup failed.'
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🏠 Weekly `/home` backup failed.' || exit $?
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot_root.conf daily
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🫚 Daily `/` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🫚 Daily `/` backup failed.'
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🫚 Error: `/` backup drive not mounted.'
|
||||
fi
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot_root.conf hourly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🫚 Hourly `/` backup completed successfully'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🫚 Hourly `/` backup failed.'
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🫚 Error: `/` backup drive not mounted.'
|
||||
fi
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot_root.conf monthly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🫚 Monthly `/` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🫚 Monthly `/` backup failed.'
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🫚 Error: `/` backup drive not mounted.'
|
||||
fi
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
|
||||
|
||||
source /home/thomas/.env
|
||||
|
||||
if mountpoint -q /media/backups-home; then
|
||||
|
||||
sudo /usr/bin/rsnapshot -c /etc/rsnapshot_root.conf monthly
|
||||
if [ $? -eq 0 ]; then
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '✅🫚 Weekly `/` backup completed successfully.'
|
||||
else
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔🫚 Weekly `/` backup failed.'
|
||||
fi
|
||||
else
|
||||
echo "Backup drive not mounted"
|
||||
/home/thomas/repos/slack-notifier/src/index.js 'backups' '💾🫚 Error: `/` backup drive not mounted.'
|
||||
fi
|
|
@ -21,7 +21,7 @@ config_version 1.2
|
|||
# All snapshots will be stored under this root directory.
|
||||
#
|
||||
|
||||
snapshot_root /media/backups-home
|
||||
snapshot_root /media/samsung-T3
|
||||
|
||||
# If no_create_root is enabled, rsnapshot will not automatically create the
|
||||
# snapshot_root directory. This is particularly useful if you are backing
|
||||
|
@ -164,7 +164,24 @@ lockfile /var/run/rsnapshot.pid
|
|||
#include ???
|
||||
#include ???
|
||||
#exclude ???
|
||||
#exclude ???
|
||||
exclude node_modules
|
||||
exclude .npm
|
||||
exclude .mozilla
|
||||
exclude .config/chromium
|
||||
exclude .config/google-chrome
|
||||
exclude .local/share/Trash
|
||||
exclude .thumbnails
|
||||
exclude .android
|
||||
exclude .docker
|
||||
exclude tmp
|
||||
exclude .vscode
|
||||
exclude .electron
|
||||
exclude .cargo
|
||||
exclude .yarn
|
||||
exclude .Trash
|
||||
exclude .Trash-*
|
||||
exclude .local/share/Trash
|
||||
exclude lost+found
|
||||
|
||||
# The include_file and exclude_file parameters, if enabled, simply get
|
||||
# passed directly to rsync. Please look up the --include-from and
|
||||
|
@ -226,8 +243,7 @@ lockfile /var/run/rsnapshot.pid
|
|||
###############################
|
||||
|
||||
# LOCALHOST
|
||||
backup /home/ home/
|
||||
exclude "/lost+found/"
|
||||
backup /home/ home
|
||||
|
||||
#backup /etc/ etc/
|
||||
#backup /usr/local/ usr/local/
|
||||
|
|
BIN
gruvbox-95/sounds/consolewarning.mp3
Normal file
BIN
gruvbox-95/sounds/consolewarning.mp3
Normal file
Binary file not shown.
BIN
gruvbox-95/sounds/success.mp3
Normal file
BIN
gruvbox-95/sounds/success.mp3
Normal file
Binary file not shown.
|
@ -5,7 +5,8 @@ include ./theme.conf
|
|||
# italic_font PragmataPro Mono Liga Italic
|
||||
# bold_italic_font PragmataPro Mono Liga Bold Italic
|
||||
|
||||
font_family JetBrainsMonoNL Nerd Font
|
||||
|
||||
font_family JetBrainsMono
|
||||
bold_font auto
|
||||
italic_font auto
|
||||
bold_italic_font auto
|
||||
|
@ -21,6 +22,10 @@ bold_italic_font auto
|
|||
# italic_font TerminusTTF-Italic
|
||||
# bold_italic_font TerminusTTF-Bold-Italic
|
||||
|
||||
# font_family TerminusTTF
|
||||
# bold_font TerminusTTF-Bold
|
||||
# italic_font TerminusTTF-Italic
|
||||
|
||||
|
||||
font_size 10
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
|
||||
|
@ -21,6 +23,7 @@
|
|||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"neogit": { "branch": "master", "commit": "6d1bd94f7fca92a50a892f494920696b5defa8c8" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
|
||||
|
@ -39,8 +42,6 @@
|
|||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
||||
"vim-css-color": { "branch": "master", "commit": "950e80352b325ff26d3b0faf95b29e301c200f7d" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "cf51327a9e08935569614d1cb24e779ee9f45519" },
|
||||
"zk-nvim": { "branch": "main", "commit": "aa9b346f2b0ab0c822bef917ee7f607d5c99f7bc" }
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
local global = vim.g
|
||||
-- local global = vim.g
|
||||
|
||||
global.gruvbox_material_background = "medium"
|
||||
global.gruvbox_material_enable_bold = 0
|
||||
global.gruvbox_material_enable_italic = 1
|
||||
-- global.gruvbox_material_background = "medium"
|
||||
-- global.gruvbox_material_enable_bold = 0
|
||||
-- global.gruvbox_material_enable_italic = 0
|
||||
|
||||
local function update_highlight_group(group, tbl)
|
||||
local old_hl = vim.api.nvim_get_hl_by_name(group, true)
|
||||
local new_hl = vim.tbl_extend("force", old_hl, tbl)
|
||||
vim.api.nvim_set_hl(0, group, new_hl)
|
||||
end
|
||||
-- local function update_highlight_group(group, tbl)
|
||||
-- local old_hl = vim.api.nvim_get_hl_by_name(group, true)
|
||||
-- local new_hl = vim.tbl_extend("force", old_hl, tbl)
|
||||
-- vim.api.nvim_set_hl(0, group, new_hl)
|
||||
-- end
|
||||
|
||||
update_highlight_group("Function", { bold = false })
|
||||
update_highlight_group("Comment", { italic = true })
|
||||
update_highlight_group("String", { italic = false })
|
||||
-- update_highlight_group("Function", { bold = false })
|
||||
-- update_highlight_group("Comment", { italic = false })
|
||||
-- update_highlight_group("String", { italic = false })
|
||||
|
|
|
@ -23,3 +23,9 @@ keymap.set("n", "<leader>lh", function()
|
|||
local config = vim.diagnostic.config()
|
||||
vim.diagnostic.config({ virtual_text = not config.virtual_text })
|
||||
end)
|
||||
|
||||
-- Toggle spellcheck
|
||||
keymap.set("n", "<leader>sp", function()
|
||||
vim.opt.spell = not vim.opt.spell:get()
|
||||
vim.opt.spelllang = "en_gb"
|
||||
end, { desc = "Toggle spell check" })
|
||||
|
|
|
@ -27,7 +27,7 @@ require("lazy").setup({
|
|||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "gruvbox" } },
|
||||
--install = { colorscheme = { "gruvbox-material" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false },
|
||||
})
|
||||
|
|
|
@ -2,7 +2,7 @@ local global = vim.g
|
|||
local opt = vim.opt
|
||||
local diagnostic = vim.diagnostic
|
||||
|
||||
vim.api.nvim_set_hl(0, "@keyword.function.python", { italic = true })
|
||||
--vim.api.nvim_set_hl(0, "@keyword.function.python", { italic = true })
|
||||
global.mapleader = ";"
|
||||
global.maplocalleader = "\\"
|
||||
global.lazyvim_picker = "telescope"
|
||||
|
@ -33,8 +33,14 @@ opt.formatoptions = "cro"
|
|||
opt.backspace = "indent,eol,start"
|
||||
opt.conceallevel = 0
|
||||
opt.spelllang = "en_gb"
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
vim.opt.spell = false
|
||||
|
||||
-- vim.g.gruvbox_material_enable_bold = 1
|
||||
-- vim.g.gruvbox_material_enable_italic = 0
|
||||
--vim.g.gruvbox_italic = false
|
||||
|
||||
diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
return {
|
||||
"sainnhe/gruvbox-material",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("gruvbox-material")
|
||||
end,
|
||||
}
|
46
nvim/lua/plugins/gruvbox.lua
Normal file
46
nvim/lua/plugins/gruvbox.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
return {
|
||||
"sainnhe/gruvbox-material",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- Optionally configure and load the colorscheme
|
||||
-- directly inside the plugin declaration.
|
||||
|
||||
-- vim.g.gruvbox_material_disable_italic_comment = true
|
||||
vim.g.gruvbox_material_enable_bold = false
|
||||
vim.g.gruvbox_material_enable_italic = false
|
||||
vim.cmd.colorscheme("gruvbox-material")
|
||||
end,
|
||||
}
|
||||
|
||||
-- return {
|
||||
-- "https://github.com/ellisonleao/gruvbox.nvim",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- config = function()
|
||||
-- require("gruvbox").setup({
|
||||
-- invert_tabline = true,
|
||||
-- invert_selection = true,
|
||||
-- terminal_colors = true, -- add neovim terminal colors
|
||||
-- undercurl = true,
|
||||
-- underline = true,
|
||||
-- bold = true,
|
||||
-- italic = {
|
||||
-- comments = true,
|
||||
-- emphasis = false,
|
||||
-- strings = true,
|
||||
-- operators = true,
|
||||
-- folds = false,
|
||||
-- },
|
||||
-- })
|
||||
-- vim.cmd.colorscheme("gruvbox")
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
-- return {
|
||||
-- "f4z3r/gruvbox-material.nvim",
|
||||
-- name = "gruvbox-material",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- opts = {},
|
||||
-- }
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"RRethy/vim-illuminate",
|
||||
}
|
|
@ -1,7 +1,17 @@
|
|||
return { "kdheepak/lazygit.nvim", keys = {
|
||||
{
|
||||
"<leader>lg",
|
||||
"LazyGit<CR>",
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- },
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,14 @@ return {
|
|||
keys = {
|
||||
{ "<leader>fb", ":Neotree<cr>" },
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
return { "wakatime/vim-wakatime" }
|
86
scripts/convert_img_grvubox.sh
Executable file
86
scripts/convert_img_grvubox.sh
Executable file
|
@ -0,0 +1,86 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Enable debug output
|
||||
set -x
|
||||
|
||||
# Expanded Gruvbox palette with more intermediate shades
|
||||
colors=(
|
||||
# Dark backgrounds
|
||||
"#282828" # bg
|
||||
"#32302f" # bg0
|
||||
"#3c3836" # bg1
|
||||
"#504945" # bg2
|
||||
"#665c54" # bg3
|
||||
"#7c6f64" # bg4
|
||||
|
||||
# Light colors
|
||||
"#ebdbb2" # fg
|
||||
"#d5c4a1" # fg2
|
||||
"#bdae93" # fg3
|
||||
"#a89984" # fg4
|
||||
|
||||
# Bright colors with variations
|
||||
"#fb4934" # bright red
|
||||
"#cc241d" # dark red
|
||||
"#9d0006" # darker red
|
||||
|
||||
"#b8bb26" # bright green
|
||||
"#98971a" # dark green
|
||||
"#79740e" # darker green
|
||||
|
||||
"#fabd2f" # bright yellow
|
||||
"#d79921" # dark yellow
|
||||
"#b57614" # darker yellow
|
||||
|
||||
"#83a598" # bright blue
|
||||
"#458588" # dark blue
|
||||
"#076678" # darker blue
|
||||
|
||||
"#d3869b" # bright purple
|
||||
"#b16286" # dark purple
|
||||
"#8f3f71" # darker purple
|
||||
|
||||
"#8ec07c" # bright aqua
|
||||
"#689d6a" # dark aqua
|
||||
"#427b58" # darker aqua
|
||||
|
||||
"#fe8019" # bright orange
|
||||
"#d65d0e" # dark orange
|
||||
"#af3a03" # darker orange
|
||||
)
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <input_image.png> [output_image.png]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_file="$1"
|
||||
output_file="${2:-${1%.*}_gruvbox.png}"
|
||||
|
||||
echo "Processing $input_file..."
|
||||
|
||||
# Create color palette file with all colors
|
||||
palette_cmd="magick convert "
|
||||
for color in "${colors[@]}"; do
|
||||
palette_cmd+="xc:$color "
|
||||
done
|
||||
palette_cmd+="+append /tmp/palette.png"
|
||||
eval $palette_cmd
|
||||
|
||||
echo "Created palette..."
|
||||
|
||||
# Process the image with refined parameters
|
||||
magick convert "$input_file" \
|
||||
-colorspace RGB \
|
||||
-brightness-contrast 3x10 \
|
||||
-level 0%,100%,1.1 \
|
||||
-colors 128 \
|
||||
-dither None \
|
||||
-remap /tmp/palette.png \
|
||||
-define png:color-type=6 \
|
||||
"$output_file"
|
||||
|
||||
echo "Conversion complete. Output saved to: $output_file"
|
||||
|
||||
# Clean up
|
||||
rm /tmp/palette.png
|
12
scripts/dummy_error_script.sh
Executable file
12
scripts/dummy_error_script.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
THIS_FILE=${0}
|
||||
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh"
|
||||
COMMAND=$(ls /nonexisting_dir 2>&1 1>/dev/null)
|
||||
#COMMAND=$(ls . 2>&1 1>/dev/null)
|
||||
|
||||
if ! $COMMAND; then
|
||||
$SLACK_NOTIFIER "test" "error" "Something went wrong" "$COMMAND" "$THIS_FILE"
|
||||
else
|
||||
$SLACK_NOTIFIER "test" "success" "All good!"
|
||||
fi
|
33
scripts/monitor_mullvad.sh
Executable file
33
scripts/monitor_mullvad.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
while true; do
|
||||
# Check both Mullvad connection and internet connectivity
|
||||
if ! mullvad status | grep -q "Connected"; then
|
||||
echo "$(date '+%H:%M:%S') - Mullvad reports as disconnected. Reconnecting..."
|
||||
mullvad disconnect
|
||||
sleep 2
|
||||
mullvad connect
|
||||
|
||||
# Wait a moment for connection to establish
|
||||
sleep 2
|
||||
|
||||
# Verify and report the new connection status
|
||||
if mullvad status | grep -q "Connected"; then
|
||||
echo "$(date '+%H:%M:%S') - Successfully reconnected to Mullvad"
|
||||
fi
|
||||
elif ! ping -c 1 google.com &>/dev/null; then
|
||||
echo "$(date '+%H:%M:%S') - Ping to google.com failed. Reconnecting..."
|
||||
mullvad disconnect
|
||||
sleep 2
|
||||
mullvad connect
|
||||
|
||||
# Wait a moment for connection to establish
|
||||
sleep 2
|
||||
|
||||
# Verify and report the new connection status
|
||||
if mullvad status | grep -q "Connected" && ping -c 1 google.com &>/dev/null; then
|
||||
echo "$(date '+%H:%M:%S') - Successfully reconnected to Mullvad with internet access"
|
||||
fi
|
||||
fi
|
||||
sleep 1
|
||||
done
|
82
scripts/slack_notifier.sh
Normal file
82
scripts/slack_notifier.sh
Normal file
|
@ -0,0 +1,82 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check that this can be sourced by cron at actual runtime
|
||||
|
||||
# Env vars:
|
||||
# --- Webhook URLs for given channel, eg $SLACK_WEBHOOK_TEST, $SLACK_WEBHOOK_EOLAS
|
||||
# --- sourced from `.env` file in Zsh path
|
||||
|
||||
# Parameters:
|
||||
# --- $1 = Slack channel,
|
||||
# --- $2 = type 'error' | 'success'
|
||||
# --- $3 = Message
|
||||
# --- $4 = (Opt) Error details
|
||||
# --- $5 = (Opt) Error source
|
||||
|
||||
# Usage:
|
||||
# --- ./slack_notifier.sh test 'SUCCESS: It worked'
|
||||
# --- ./slack_notifier.sh test 'ERROR: Something went wrong' 'Error message'
|
||||
|
||||
declare -A CHANNEL_TO_WEBHOOK
|
||||
CHANNEL_TO_WEBHOOK["test"]=$SLACK_WEBHOOK_TEST
|
||||
CHANNEL_TO_WEBHOOK["backups"]=$SLACK_WEBHOOK_BACKUPS
|
||||
CHANNEL_TO_WEBHOOK["eolas"]=$SLACK_WEBHOOK_EOLAS
|
||||
CHANNEL_TO_WEBHOOK["website"]=$SLACK_WEBHOOK_SYSTEMS_OBSCURE
|
||||
CHANNEL_TO_WEBHOOK["time-tracking"]=$SLACK_WEBHOOK_TIME_TRACKING
|
||||
|
||||
WEBHOOK=${CHANNEL_TO_WEBHOOK[$1]}
|
||||
|
||||
ERROR_BLOCKS=$(
|
||||
jq -n \
|
||||
--arg channel "$1" \
|
||||
--arg message "$3" \
|
||||
--arg details "$4" \
|
||||
--arg source "$5" \
|
||||
'{
|
||||
channel: $channel,
|
||||
blocks: ([
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "plain_text",
|
||||
text: "🔴" + $message
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "mrkdwn",
|
||||
text: "```\n\($details)\n```"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "context",
|
||||
"elements": [
|
||||
{
|
||||
"type": "plain_text",
|
||||
text: $source
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
}'
|
||||
)
|
||||
|
||||
# Initialise sound playback
|
||||
mpv --volume=0 --start=0 --length=0.1 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3
|
||||
sleep 1
|
||||
|
||||
# Process notification
|
||||
if [ "$2" != "error" ]; then
|
||||
curl -X POST \
|
||||
-H 'Content-type: application/json' \
|
||||
--data '{"text":"🟢 '"$3"'"}' \
|
||||
"$WEBHOOK"
|
||||
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-success.mp3
|
||||
else
|
||||
curl -X POST \
|
||||
-H 'Content-type: application/json' \
|
||||
--json "$ERROR_BLOCKS" \
|
||||
"$WEBHOOK"
|
||||
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-error.mp3
|
||||
fi
|
BIN
sounds/star-trek-computer-error.mp3
Normal file
BIN
sounds/star-trek-computer-error.mp3
Normal file
Binary file not shown.
BIN
sounds/star-trek-computer-success.mp3
Normal file
BIN
sounds/star-trek-computer-success.mp3
Normal file
Binary file not shown.
|
@ -11,11 +11,11 @@ set -ga terminal-overrides ",*256col*:Tc"
|
|||
set-option -g status-position top
|
||||
set -g status-justify centre
|
||||
|
||||
# set -g window-status-current-style 'bg=#282828,fg=#ebdbb2'
|
||||
set -g window-status-current-style 'bg=#282828,fg=#ebdbb2'
|
||||
|
||||
set-option -g status-left " Session #S "
|
||||
set-option -g status-left " Session #S"
|
||||
|
||||
# set -g status-right 'tmux '
|
||||
set -g status-right 'tmux '
|
||||
set -g window-status-format " #I:#W "
|
||||
set -g window-status-current-format " #I:#W "
|
||||
|
||||
|
@ -24,8 +24,10 @@ set -g window-status-current-format " #I:#W "
|
|||
# set -g status-bg colour8
|
||||
# set -g status-fg colour7
|
||||
# Split panes with \ and -
|
||||
bind \\ split-window -h -c "#{pane_current_path}"
|
||||
bind £ split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
|
||||
|
||||
# unbind \\
|
||||
# unbind -
|
||||
bind h select-pane -L
|
||||
|
@ -34,10 +36,10 @@ bind k select-pane -U
|
|||
bind l select-pane -R
|
||||
|
||||
|
||||
bind-key -r C-Up resize-pane -U 5
|
||||
bind-key -r C-Down resize-pane -D 5
|
||||
bind-key -r C-Left resize-pane -L 5
|
||||
bind-key -r C-Right resize-pane -R 5
|
||||
bind-key -r Up resize-pane -U 5
|
||||
bind-key -r Down resize-pane -D 5
|
||||
bind-key -r Left resize-pane -L 5
|
||||
bind-key -r Right resize-pane -R 5
|
||||
|
||||
set -g mouse on
|
||||
# remove delay for exiting insert mode with ESC in Neovim
|
||||
|
|
|
@ -3,7 +3,26 @@
|
|||
# PROMPT='%{$fg_bold[green]%}%n@%m %{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.) '
|
||||
#PROMPT='%{$fg_bold[green]%}%n@%m %{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.) '
|
||||
|
||||
PROMPT='%{$fg_bold[green]%}%{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.) '
|
||||
#PROMPT='%{$fg_bold[green]%}%{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.) '
|
||||
#PROMPT='%{$fg[cyan]%}%D{%H:%M:%S}%{$reset_color%} %{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.) '
|
||||
#PROMPT='%{$fg[yellow]%}[%D{%H:%M:%S}]%{$reset_color%} %{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.)$'\n' '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%} "
|
||||
#PROMPT='%{$fg[yellow]%}[%D{%H:%M:%S}]%{$reset_color%} %{$fg_bold[magenta]%}(%2~)$(git_prompt_info)%{$reset_color%}%(.)
|
||||
#%{$reset_color%}$ '
|
||||
|
||||
# PROMPT='%{$fg[cyan]%}%D{%H:%M:%S}%{$reset_color%} %{$fg_bold[magenta]%}%2~$(git_prompt_info)%{$reset_color%}%(.)
|
||||
# %{$fg[green]%}$%{$reset_color%} '
|
||||
|
||||
# PROMPT='%{$fg[cyan]%}%D{%H:%M:%S}%{$reset_color%} %{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[magenta]%}%2~$(git_prompt_info)%{$reset_color%}%(.)
|
||||
# %{$fg[green]%}$%{$reset_color%} '
|
||||
|
||||
# PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[magenta]%}%2~$(git_prompt_info)%{$reset_color%}%(.)
|
||||
# %{$fg[green]%}$%{$reset_color%} '
|
||||
|
||||
PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%}$(git_prompt_info)%(.)
|
||||
%{$fg[green]%}$%{$reset_color%} '
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[magenta]%} "
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
#ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%} "
|
||||
#ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
@ -12,6 +12,13 @@ alias dot="cd /home/thomas/dotfiles"
|
|||
alias ddb="aws dynamodb"
|
||||
alias zcom="/home/thomas/repos/eolas/scripts/auto_save.sh"
|
||||
alias sysobs="cd /home/thomas/repos/systems-obscure"
|
||||
alias gs="git status"
|
||||
alias ga="git add"
|
||||
alias gc="git commit"
|
||||
alias syncmus="/home/thomas/repos/utilities/music_sync/update_music_library.sh"
|
||||
alias dc="docker compose"
|
||||
|
||||
|
||||
# alias xhd="cd /run/media/thomas"
|
||||
# alias cs-update="/home/thomas/repos/eolas/_scripts/auto_save.sh"
|
||||
# alias cs-query="/home/thomas/repos/eolas/_scripts/query.sh"
|
||||
|
|
Loading…
Add table
Reference in a new issue