summaryrefslogtreecommitdiff
path: root/ar
diff options
context:
space:
mode:
Diffstat (limited to 'ar')
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua2
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/image.lua4
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua8
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua33
-rw-r--r--ar/.config/lf/lfrc6
-rw-r--r--ar/.config/pipewire/pipewire.conf.d/10-no-rtkit.conf10
-rw-r--r--ar/.config/sesh/sesh.toml2
-rw-r--r--ar/.config/shell/aliasrc2
-rw-r--r--ar/.config/wireplumber/main.lua.d/51-device-priority.conf74
-rwxr-xr-xar/.local/bin/fzffiles4
-rwxr-xr-xar/.local/bin/gitupdate2
-rwxr-xr-xar/.local/bin/opensessions2
-rwxr-xr-xar/.local/bin/statusbar/sb-cpu2
-rwxr-xr-xar/.local/bin/statusbar/sb-forecast3
-rwxr-xr-xar/.local/bin/statusbar/sb-internet1
-rwxr-xr-xar/.local/bin/statusbar/sb-memory5
-rwxr-xr-xar/.local/bin/statusbar/sb-price6
17 files changed, 147 insertions, 19 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
index ee97612..90b62e2 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
@@ -349,7 +349,7 @@ return {
vim.keymap.set({ "n", "x" }, "<C-q>", function()
require("opencode").ask("@this: ", { submit = true })
end, { desc = "Ask opencode" })
- vim.keymap.set({ "n", "x" }, "<C-x>", function()
+ vim.keymap.set({ "n", "x" }, "<C-CR>", function()
require("opencode").select()
end, { desc = "Execute opencode action…" })
vim.keymap.set({ "n", "t" }, "<C-.>", function()
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/image.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/image.lua
index a4f126f..81fa28b 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/image.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/image.lua
@@ -64,9 +64,9 @@ return {
local absolute_image_path = current_file_path .. "/" .. image_path
-- Check if the image exists in the current path
if not file_exists(absolute_image_path) then
- -- If not found, search ../Screenshots/
+ -- If not found, search ../screenshots/
local fallback_path = vim.fn.fnamemodify(current_file_path, ":h")
- .. "/Screenshots/"
+ .. "/screenshots/"
.. image_path
if file_exists(fallback_path) then
absolute_image_path = fallback_path
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua
index 96c52a7..aff6f62 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua
@@ -33,25 +33,25 @@ return {
vim.cmd.runtime({ args = { "lua/TheSiahxyz/snippets/*.lua" }, bang = true }) -- load custom snippets
- vim.keymap.set({ "i", "x" }, "<A-L>", function()
+ vim.keymap.set({ "i", "x" }, "<C-L>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true, desc = "Expand snippet or jump to the next snippet node" })
- vim.keymap.set({ "i", "x" }, "<A-H>", function()
+ vim.keymap.set({ "i", "x" }, "<C-H>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true, desc = "Previous spot in the snippet" })
- vim.keymap.set({ "i", "x" }, "<A-l>", function()
+ vim.keymap.set({ "i", "s" }, "<C-j>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, { silent = true, desc = "Next snippet choice" })
- vim.keymap.set({ "i", "x" }, "<A-h>", function()
+ vim.keymap.set({ "i", "s" }, "<C-k>", function()
if ls.choice_active() then
ls.change_choice(-1)
end
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
index 90528a1..4f233d1 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
@@ -3,15 +3,47 @@ local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local f = ls.function_node
+local c = ls.choice_node
+local t = ls.text_node
+local d = ls.dynamic_node
+local sn = ls.snippet_node
local fmt = require("luasnip.extras.fmt").fmta
+local function bgm_node_generator()
+ return function()
+ local handle = io.popen("ssh root@thesiah.xyz 'ls /var/www/thesiah/bgm/' 2>/dev/null")
+ if not handle then
+ return sn(nil, { i(1, "bgm") })
+ end
+
+ local result = handle:read("*a")
+ handle:close()
+
+ if not result or result == "" then
+ return sn(nil, { i(1, "bgm") })
+ end
+
+ local choices = {}
+ for filename in result:gmatch("[^\r\n]+") do
+ table.insert(choices, t(filename))
+ end
+
+ if #choices == 0 then
+ return sn(nil, { i(1, "bgm") })
+ end
+
+ return sn(nil, { c(1, choices) })
+ end
+end
+
local diary_snippet = s(
"diary",
fmt(
[[---
title: <title>
date: <date>
+bgm: <bgm>
---
<story>
@@ -21,6 +53,7 @@ date: <date>
date = f(function()
return os.date("%Y-%m-%d")
end, {}),
+ bgm = d(2, bgm_node_generator(), {}),
story = i(3),
}
)
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index c88b1f1..becd52c 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -110,6 +110,12 @@ cmd mkdir %{{
cmd touch %{{
IFS=" "
file="$*"
+ case "$file" in
+ /*) ;;
+ *) file="$PWD/$file" ;;
+ esac
+ dir="${file%/*}"
+ [ "$dir" != "$file" ] && mkdir -p -- "$dir"
touch -- "$file"
file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')"
lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\""
diff --git a/ar/.config/pipewire/pipewire.conf.d/10-no-rtkit.conf b/ar/.config/pipewire/pipewire.conf.d/10-no-rtkit.conf
new file mode 100644
index 0000000..9d5903f
--- /dev/null
+++ b/ar/.config/pipewire/pipewire.conf.d/10-no-rtkit.conf
@@ -0,0 +1,10 @@
+context.modules = [
+ { name = libpipewire-module-rt
+ args = {
+ rt.prio = 20
+ rt.time.soft = -1
+ rt.time.hard = -1
+ }
+ flags = [ ifexists nofail ]
+ }
+]
diff --git a/ar/.config/sesh/sesh.toml b/ar/.config/sesh/sesh.toml
index 349c5ba..77f1b9f 100644
--- a/ar/.config/sesh/sesh.toml
+++ b/ar/.config/sesh/sesh.toml
@@ -30,7 +30,7 @@ name = "config"
path = "~/.config"
[[session]]
-name = "dotfiles"
+name = "_dotfiles"
path = "~/.dotfiles"
[[session]]
diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc
index 1e129f6..1cf6045 100644
--- a/ar/.config/shell/aliasrc
+++ b/ar/.config/shell/aliasrc
@@ -12,7 +12,7 @@
[ -f "$MBSYNCRC" ] && alias mbsync='mbsync -c $MBSYNCRC'
# sudo not required for some system commands
-for command in blkid lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
+for command in arp-scan blkid docker ecrypt lazydocker lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
alias $command="sudo $command"
done
unset command
diff --git a/ar/.config/wireplumber/main.lua.d/51-device-priority.conf b/ar/.config/wireplumber/main.lua.d/51-device-priority.conf
new file mode 100644
index 0000000..13c4987
--- /dev/null
+++ b/ar/.config/wireplumber/main.lua.d/51-device-priority.conf
@@ -0,0 +1,74 @@
+monitor.alsa.rules = [
+ {
+ matches = [
+ {
+ node.name = "~alsa_output.*hdmi.*"
+ }
+ ]
+ actions = {
+ update-props = {
+ priority.driver = 2000
+ priority.session = 2000
+ }
+ }
+ }
+ {
+ matches = [
+ {
+ node.name = "~alsa_output.*analog.*"
+ }
+ ]
+ actions = {
+ update-props = {
+ priority.driver = 1000
+ priority.session = 1000
+ }
+ }
+ }
+]
+
+monitor.bluez.rules = [
+ {
+ matches = [
+ {
+ device.name = "~bluez_card.*"
+ }
+ ]
+ actions = {
+ update-props = {
+ priority.driver = 3000
+ priority.session = 3000
+ bluez5.auto-connect = [ a2dp_sink ]
+ }
+ }
+ }
+]
+
+node.rules = [
+ {
+ matches = [
+ {
+ node.name = "~bluez_output.*"
+ }
+ ]
+ actions = {
+ update-props = {
+ priority.driver = 3000
+ priority.session = 3000
+ }
+ }
+ }
+ {
+ matches = [
+ {
+ node.name = "~bluez_input.*"
+ }
+ ]
+ actions = {
+ update-props = {
+ priority.driver = 3000
+ priority.session = 3000
+ }
+ }
+ }
+]
diff --git a/ar/.local/bin/fzffiles b/ar/.local/bin/fzffiles
index 9f5cd90..64c7a6d 100755
--- a/ar/.local/bin/fzffiles
+++ b/ar/.local/bin/fzffiles
@@ -11,7 +11,7 @@ IFS='
files=$(fzf-tmux \
--header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \
--preview "selection={};
- clean=\$(printf '%s' \"\$selection\" | sed -e 's/^πŸ“„ //' -e 's/^✏️ //' -e 's/^βœ… //' -e 's/^❌ //' -e 's/^πŸ”€ //' -e 's/^❓ //');
+ clean=\$(printf '%s' \"\$selection\" | sed -e 's/^πŸ“„ //' -e 's/^✏ //' -e 's/^βœ… //' -e 's/^❌ //' -e 's/^πŸ”€ //' -e 's/^❓ //');
[ -z \"\$clean\" ] && { echo 'No selection'; exit 0; }
target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\");
if [ -z \"\$target\" ]; then
@@ -65,7 +65,7 @@ files=$(fzf-tmux \
else if (staged == \"!\" && unstaged == \"!\") icon=\"❌\";
else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"πŸ”€\";
else if (staged != \" \" && staged != \"?\") icon=\"βœ…\";
- else if (unstaged != \" \") icon=\"✏️\";
+ else if (unstaged != \" \") icon=\"✏\";
else icon=\"❓\";
print icon \" \" root \"/\" file
}'; else echo 'This is not a git repository.'; fi)" \
diff --git a/ar/.local/bin/gitupdate b/ar/.local/bin/gitupdate
index 87c13c3..3dabf34 100755
--- a/ar/.local/bin/gitupdate
+++ b/ar/.local/bin/gitupdate
@@ -2,8 +2,6 @@
set -eu
-pidof transmission-daemon >/dev/null && echo "Turn off transmission-daemon first!" && exit 1
-
# Check if inside a Git repository
! git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "Not a git repository." && exit 1
diff --git a/ar/.local/bin/opensessions b/ar/.local/bin/opensessions
index d16f42f..e05e68a 100755
--- a/ar/.local/bin/opensessions
+++ b/ar/.local/bin/opensessions
@@ -9,7 +9,7 @@ dirs=$(echo "$dirs" | tr -s ' ' '\n' | sed '/^$/d')
# function to clean and create a valid session name
get_session_name() {
- basename "$1" | sed 's/[^a-zA-Z0-9]/_/g'
+ basename "$1" | sed 's/[^a-zA-Z0-9-]/_/g'
}
set -- $dirs
diff --git a/ar/.local/bin/statusbar/sb-cpu b/ar/.local/bin/statusbar/sb-cpu
index 0cb6f4f..753542f 100755
--- a/ar/.local/bin/statusbar/sb-cpu
+++ b/ar/.local/bin/statusbar/sb-cpu
@@ -3,7 +3,7 @@
case $BLOCK_BUTTON in
1) notify-send "πŸ–₯ CPU hogs" "$(ps axch -o cmd,%cpu | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)\\n(100% per core)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
-3) notify-send "πŸ–₯ CPU module " "\- Shows CPU temperature
+3) notify-send "🧁 CPU module " "\- Shows CPU temperature
- Left click to show intensive processes
- Middle click to open htop" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast
index 063c8e5..65bcd1a 100755
--- a/ar/.local/bin/statusbar/sb-forecast
+++ b/ar/.local/bin/statusbar/sb-forecast
@@ -11,7 +11,8 @@ weatherreportjson="${XDG_CACHE_HOME:-${HOME}/.cache}/weatherreport.json"
error() {
rm -f "$weatherreport" "$weatherreportjson"
- notify-send -u critical "β›” Failed to update 'weather$1'"
+ notify-send "β›” Failed to update 'weather$1'"
+ echo "❓"
exit 1
}
diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet
index 4dfb605..eeab61a 100755
--- a/ar/.local/bin/statusbar/sb-internet
+++ b/ar/.local/bin/statusbar/sb-internet
@@ -46,6 +46,7 @@ case $BLOCK_BUTTON in
pkill -RTMIN+6 dwmblocks
;;
3) notify-send "🌐 Internet module" "\- Left click to connect
+- Middle click to toggle wifi
❌: wifi disabled
πŸ“‘: no wifi connection
πŸ›œ: wifi connection with quality
diff --git a/ar/.local/bin/statusbar/sb-memory b/ar/.local/bin/statusbar/sb-memory
index 3c9dd03..3b71f3c 100755
--- a/ar/.local/bin/statusbar/sb-memory
+++ b/ar/.local/bin/statusbar/sb-memory
@@ -3,9 +3,10 @@
case $BLOCK_BUTTON in
1) notify-send "🐏 Memory hogs" "$(ps axch -o cmd,%mem | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)" ;;
2) setsid -f "$TERMINAL" -e htop ;;
-3) notify-send "🐏 Memory module" "\- Shows Memory used/total
+3) notify-send "🐏 Memory module" "\- Shows Memory temperature and used/total
- Left click to show memory hogs
-- Middle click to open htop" ;;
+- Middle click to open htop
+🌑️: Memory temperature" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
diff --git a/ar/.local/bin/statusbar/sb-price b/ar/.local/bin/statusbar/sb-price
index 84d86b6..70703f8 100755
--- a/ar/.local/bin/statusbar/sb-price
+++ b/ar/.local/bin/statusbar/sb-price
@@ -64,4 +64,8 @@ esac
notify-send "$icon Update complete" "$name price is now
\$$(cat "$pricefile")"
-[ -f "$pricefile" ] && printf "%s%s%0.2f" "$icon" "$symb" "$(cat "$pricefile")"
+[ -f "$pricefile" ] && {
+ price=$(cat "$pricefile")
+ formatted_price=$(printf "%0.2f" "$price" | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')
+ printf "%s%s%s" "$icon" "$symb" "$formatted_price"
+}