summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar/.config/mpv/scripts/navigator.lua12
-rw-r--r--ar/.config/shell/bm-dirs6
-rw-r--r--ar/.config/taskopen/taskopenrc2
-rwxr-xr-xar/.local/bin/openfiles6
-rwxr-xr-xar/.local/bin/shortcuts14
5 files changed, 21 insertions, 19 deletions
diff --git a/ar/.config/mpv/scripts/navigator.lua b/ar/.config/mpv/scripts/navigator.lua
index af7595c..4533f60 100644
--- a/ar/.config/mpv/scripts/navigator.lua
+++ b/ar/.config/mpv/scripts/navigator.lua
@@ -1,6 +1,8 @@
local utils = require("mp.utils")
local mpopts = require("mp.options")
local assdraw = require("mp.assdraw")
+local user = os.getenv("USER") or "si"
+local home = os.getenv("HOME") or ("/home/" .. user)
ON_WINDOWS = (package.config:sub(1, 1) ~= "/")
WINDOWS_ROOTDIR = false
@@ -33,12 +35,12 @@ local settings = {
--favorites in format { 'Path to directory, notice trailing /' }
--on windows use double backslash c:\\my\\directory\\
favorites = {
- "/media/si",
+ "/media/" .. user,
"/mnt/second/videos",
- "/home/si/Downloads",
- "/home/si/Torrents/complete",
- "/home/si/Videos",
- "/home/si/.config/mpv/playlists",
+ home .. "/Downloads",
+ home .. "/Torrents/complete",
+ home .. "/Videos",
+ home .. "/.config/mpv/playlists",
},
--list of paths to ignore. the value is anything that returns true for if-statement.
--directory ignore entries must end with a trailing slash,
diff --git a/ar/.config/shell/bm-dirs b/ar/.config/shell/bm-dirs
index a44079e..45e3647 100644
--- a/ar/.config/shell/bm-dirs
+++ b/ar/.config/shell/bm-dirs
@@ -48,8 +48,8 @@ Esv /etc/runit/sv
gdc ${XDG_DOCUMENTS_DIR:-${HOME}/Documents}
gdk ${XDG_DESKTOP_DIR:-${HOME}/Desktop}
gdn ${XDG_DOWNLOAD_DIR:-${HOME}/Downloads}
-gfx $HOME/.mozilla/firefox/si.default
-gkd ${XDG_DATA_HOME:-${HOME}/.local/share}/kakaotalk/drive_c/users/si/Documents/KakaoTalk-Downloads
+gfx $HOME/.mozilla/firefox/$USER.default
+gkd ${XDG_DATA_HOME:-${HOME}/.local/share}/kakaotalk/drive_c/users/$USER/Documents/KakaoTalk-Downloads
gmu ${XDG_MUSIC_DIR:-${HOME}/Music}
gpb ${XDG_PUBLICSHARE_DIR:-${HOME}/Public}
gpp ${XDG_PICTURES_DIR:-${HOME}/Pictures}
@@ -61,7 +61,7 @@ gti $HOME/Torrents/incomplete
gtt $HOME/Torrents
gvr ${XDG_VIDEOS_DIR:-${HOME}/Videos}/recordings
gvv ${XDG_VIDEOS_DIR:-${HOME}/Videos}
-gwf $HOME/.librewolf/si.default
+gwf $HOME/.librewolf/$USER.default
gwo ${XDG_DESKTOP_DIR:-${HOME}/Desktop}/Work
gww ${XDG_PICTURES_DIR:-${HOME}/Pictures}/wallpaper
Hbk /mnt/second/backup
diff --git a/ar/.config/taskopen/taskopenrc b/ar/.config/taskopen/taskopenrc
index 36c99d7..761f764 100644
--- a/ar/.config/taskopen/taskopenrc
+++ b/ar/.config/taskopen/taskopenrc
@@ -11,7 +11,7 @@ path_ext=/usr/share/taskopen/scripts
nvimline.target=annotations
nvimline.labelregex=".*"
nvimline.regex="^nvimline:(\\d+):(.*)"
-nvimline.command="/home/si/.local/bin/taksopenline $FILE $TASK_DESCRIPTION"
+nvimline.command="$HOME/.local/bin/task/taskopen-line $FILE $TASK_DESCRIPTION"
nvimline.modes="batch,any,normal"
files.target=annotations
files.labelregex=".*"
diff --git a/ar/.local/bin/openfiles b/ar/.local/bin/openfiles
index 9aba756..5b4f7e2 100755
--- a/ar/.local/bin/openfiles
+++ b/ar/.local/bin/openfiles
@@ -20,13 +20,13 @@ count=$#
case "$count" in
2)
- ${EDITOR:-nvim} -O +'silent! normal g;' "$@"
+ ${EDITOR:-nvim} -O +'silent! normal g;' "$@" -c 'wincmd t'
;;
3)
- ${EDITOR:-nvim} -O "$1" -c 'wincmd j' -c "silent! vsplit $2" -c "silent! split $3"
+ ${EDITOR:-nvim} -O "$1" -c 'wincmd j' -c "silent! vsplit $2" -c "silent! split $3" -c 'wincmd t'
;;
4)
- ${EDITOR:-nvim} -O "$1" -c "silent! vsplit $2" -c "silent! split $3" -c 'wincmd h' -c "silent! split $4"
+ ${EDITOR:-nvim} -O "$1" -c "silent! vsplit $2" -c "silent! split $3" -c 'wincmd h' -c "silent! split $4" -c 'wincmd t'
;;
*)
${EDITOR:-nvim} "$@"
diff --git a/ar/.local/bin/shortcuts b/ar/.local/bin/shortcuts
index e7c96c1..118becb 100755
--- a/ar/.local/bin/shortcuts
+++ b/ar/.local/bin/shortcuts
@@ -35,9 +35,9 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"map %s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
printf(\"nmap <localleader><localleader>%s :Explore %s<cr>\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
- printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/si/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><leader>%s', '<cmd>Explore %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/si/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/si/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
+ printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><leader>%s', '<cmd>Explore %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" |
@@ -55,8 +55,8 @@ eval "echo \"$(cat "$bmfiles")\"" |
printf(\"map v%s \$\$EDITOR2 \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
printf(\"nmap <localleader><localleader>%s :e %s<cr>\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
- printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/si/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/si/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
+ printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
# root
root_shell_shortcuts="/root/.config/shell/rootshortcutrc"
@@ -70,7 +70,7 @@ sudo mkdir -p /root/.config/shell/ /root/.config/lf/ /root/.config/vim/
sudo touch "$root_shell_shortcuts" "$root_zsh_named_dirs" "$root_lf_shortcuts" "$root_vim_shortcuts"
eval "echo \"$(cat "$bmdirs")\"" |
- sudo awk "!/^\s*#/ && !/^\s*\$/ && /cache|config($|\/bash|\/lf|\/shell|\/vim)|local\/(bin|share|state)$/ {gsub(\"\\\s*#.*$\",\"\"); gsub(\"home/si\", \"root\");
+ sudo awk "!/^\s*#/ && !/^\s*\$/ && /cache|config($|\/bash|\/lf|\/shell|\/vim)|local\/(bin|share|state)$/ {gsub(\"\\\s*#.*$\",\"\"); gsub(\"home/$USER\", \"root\");
printf(\",%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$root_shell_shortcuts\" ;
printf(\"hash -d ,%s=%s \n\",\$1,\$2) >> \"$root_zsh_named_dirs\" ;
printf(\"map ,%s cd \42%s\42 \n\",\$1,\$2) >> \"$root_lf_shortcuts\" ;
@@ -78,7 +78,7 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"nmap <localleader><localleader>%s :Explore %s<cr>\n\",\$1,\$2) >> \"$root_vim_shortcuts\"}"
eval "echo \"$(cat "$bmfiles")\"" |
- sudo awk "!/^\s*#/ && !/^\s*\$/ && /config\/(bash|lf|vim)\/.*rc |inputrc|\$EDITOR / {gsub(\"\\\s*#.*$\",\"\"); gsub(\"home/si\", \"root\");
+ sudo awk "!/^\s*#/ && !/^\s*\$/ && /config\/(bash|lf|vim)\/.*rc |inputrc|\$EDITOR / {gsub(\"\\\s*#.*$\",\"\"); gsub(\"home/$USER\", \"root\");
printf(\",%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$root_shell_shortcuts\" ;
printf(\"hash -d ,%s=%s \n\",\$1,\$2) >> \"$root_zsh_named_dirs\" ;
printf(\"map ,%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$root_lf_shortcuts\" ;