Update dotfiles

This commit is contained in:
hok7z 2023-08-15 02:28:08 +03:00
parent d175a76650
commit 0de0f6a5dd
70 changed files with 241 additions and 106 deletions

View File

@ -1,3 +1,9 @@
if status --is-login
if test -z "$DISPLAY" -a $XDG_VTNR = 1
exec Hyprland > ~/.hyprland.log
end
end
if status is-interactive
alias ls="lsd"
@ -10,13 +16,17 @@ if status is-interactive
alias la="lsd -la"
alias dotfiles="git --git-dir=/home/q/repos/dotfiles --work-tree=$HOME"
set -U fish_user_paths $HOME/bin $fish_user_paths
set -x TERM "xterm-256color"
set -U fish_user_paths $HOME/.local/bin $fish_user_paths
alias dotfiles="git --git-dir=/home/q/repos/dotfiles --work-tree=$HOME"
alias chromium-browser-stable="chromium-browser-stable --disable-gpu --disable-software-rasterizer"
set -x PF_INFO "ascii title os kernel wm shell pkgs memory"
# set -x TERM "xterm"
set -x TERM "xterm-256color"
set -x EDITOR "nvim"
set -x VISUAL "nvim"
set -x XDG_DATA_HOME $HOME/.local/share
set srcdir "$HOME/.cache/"

View File

@ -49,6 +49,6 @@ SETUVAR fish_pager_color_selected_background:\x1d
SETUVAR fish_pager_color_selected_completion:\x1d
SETUVAR fish_pager_color_selected_description:\x1d
SETUVAR fish_pager_color_selected_prefix:\x1d
SETUVAR fish_user_paths:/home/q/bin\x1e/home/q/\x2elocal/bin
SETUVAR fish_user_paths:/home/q/\x2elocal/bin\x1e/home/q/bin
SETUVAR nvm_data:/home/q/\x2elocal/share/nvm
SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist

View File

@ -8,7 +8,7 @@
# title=foot
# locked-title=no
font=JetBrainsMono Nerd Font Mono:size=9
font=JetBrainsMono Nerd Font Mono:size=13
# font=monospace:size=8
# font-bold=<bold variant of regular font>

View File

@ -15,12 +15,15 @@ monitor=,1920x1080,auto,1
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = light -S 50
exec-once = swww init
exec-once = waybar
exec-once = light -S 50
exec-once = kotatogram-desktop
exec-once = dunst -config ~/.config/dunst/dunstrc
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec-once = /usr/bin/chromium-browser-stable --disable-gpu --disable-software-rasterizer
exec-once = $HOME/bin/battery-daemon &
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
@ -56,12 +59,8 @@ general {
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur = yes
blur_size = 3
blur_passes = 1
blur_new_optimizations = on
blur: 3
drop_shadow = yes
shadow_range = 4
@ -124,10 +123,15 @@ windowrulev2 = workspace 2 silent,title:^(Kotatogram)$
windowrulev2 = size 641 1022,title:^(Kotatogram)$
windowrulev2 = move 25 45,title:^(Kotatogram)$
windowrulev2 = workspace 1 silent,title:^(chromium-browser)$
$mainMod = SUPER
bind = $mainMod SHIFT, S,exec, bin/w-screenrecord
# bindl=,switch:[switch name],exec,$HOME/bin/lockscreen
bind = $mainMod, C, killactive,
bind = $mainMod, X, exit,
@ -148,7 +152,9 @@ bind = $mainMod, N, exec, foot -e lf
bind = $mainMod, M, exec, foot -e cmus
bind = $mainMod, d, exec, wofi --show drun -I -i
bind = ,Print, exec, makescreenshot
bind = $mainMod, l, exec, lockscreen
# bind = $mainMod, SHIFT, L, exec, lockscreen
bind = ALT, L, exec, lockscreen
# not forget install xdg-desktop-portal 1.14.6
# Modify file /usr/share/xdg-desktop-portal/portals/{}.portal UserIn=sway;wlroots
@ -195,3 +201,7 @@ bind = $mainMod SHIFT,h, movewindow, l
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
misc {
disable_hyprland_logo = true
}

View File

@ -8,8 +8,8 @@ set shellopts '-eu'
set previewer ctpv
set cleaner ctpvclear
&ctpv -s $id
&ctpvquit $id
&ctpv -d -s $id >> ~/temp/lf_ctpv.log
&ctpvquit $id >> ~/temp/lf_ctpvquit.log
cmd edit-config ${{
$EDITOR ~/.config/lf/lfrc
@ -27,7 +27,7 @@ cmd open &{{
esac
}}
cmd setwallpaper %swww img "$f" --transition-type right --transition-fps 60
cmd setwallpaper %swww img "$f" --transition-type wipe --transition-fps 60
cmd fzf_jump ${{
res="$(find . | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')"
@ -41,7 +41,7 @@ cmd fzf_jump ${{
lf -remote "send $id $cmd \"$res\""
}}
cmd fzf_search ${{
cmd rg_search ${{
res="$( \
RG_PREFIX="rg --column --line-number --no-heading --color=always \
--smart-case "
@ -83,15 +83,28 @@ cmd zip ${{
# Trash bindings
cmd trash ${{
cmd move-to-trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=${files%%;*}
if [[ "$(pwd)" == "/home/$USER/.local/share/Trash/files" ]]; then
rm -rf "$fx"
else
trash-put "$(basename "$file")"
if [ "$files" = "$file" ]; then
files=''
else
files="${files#*;}"
fi
done
}}
cmd delete-from-trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=${files%%;*}
if [[ "$(pwd)" == "$HOME/.local/share/Trash/files" ]]; then
rm -rf "$file"
fi
if [ "$files" = "$file" ]; then
@ -121,7 +134,9 @@ cmd trash ${{
# }}
# lfrc
cmd restore-from-trash ${{
cmd trash-restore-list ${{
ids="$(echo -ne '\n' | \
trash-restore | \
awk '$1 ~ /^[0-9]+/ {print $0}' | \
@ -132,6 +147,27 @@ cmd restore-from-trash ${{
clear
}}
cmd restore-from-trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=${files%%;*}
Id="$(echo -ne '\n'|
trash-restore ~ |
grep $(basename "$file") |
awk '{print $1}'
)"
echo $Id | trash-restore ~
if [ "$files" = "$file" ]; then
files=''
else
files="${files#*;}"
fi
done
}}
map m
map o
map n
@ -158,13 +194,16 @@ map x cut
map <enter> open
map f :fzf_jump
map gf :fzf_search
map gf :rg_search
map C edit-config
map bg setwallpaper
map dd trash
map dr restore-from-trash
map mt move-to-trash
map dt delete-from-trash
map tr restore-from-trash
map trl trash-restore-list
map R reload

View File

@ -6,7 +6,7 @@ vim.api.nvim_set_keymap('', '<down>', '<nop>', {noremap = true})
vim.api.nvim_set_keymap('', '<left>', '<nop>', {noremap = true})
vim.api.nvim_set_keymap('', '<right>', '<nop>',{noremap = true})
keymap("n","<space>,",":nohlsearch<CR>")
keymap("n","<space>,",":nohlsearch<CR>", {desc = "Clear an selected strings"})
keymap("n","s",'"_d"')
@ -14,3 +14,6 @@ keymap('n', 'gwh', '<C-w>h')
keymap('n', 'gwj', '<C-w>j')
keymap('n', 'gwk', '<C-w>k')
keymap('n', 'gwl', '<C-w>l')
keymap("n", "<space>bf",":bf<CR>",{desc = "[G]oto first buffer"})
keymap("n", "<space>bl",":bl<CR>",{desc = "[G]oto last buffer"})

View File

@ -26,6 +26,13 @@ require("lazy").setup({
vim.cmd.colorscheme "nord"
end
},
-- {
-- "andersevenrud/nordic.nvim",
-- config = function()
-- vim.cmd.colorscheme "nordic"
-- end
-- },
-- use {"catppuccin/nvim", as = "catppuccin"}
-- use {"tiagovla/tokyodark.nvim"}
-- use {'Everblush/everblush.nvim',as = 'everblush'}
@ -107,7 +114,10 @@ require("lazy").setup({
dependencies = {
{"williamboman/mason.nvim", opts},
"williamboman/mason-lspconfig.nvim",
{"j-hui/fidget.nvim", opts = {}}
{"j-hui/fidget.nvim",
tag = "legacy",
opts = {}
}
},
config = function()
require("lsp")

View File

@ -38,19 +38,37 @@ vim.g.lsp_capabilities = require('cmp_nvim_lsp').default_capabilities(capabiliti
vim.g.lsp_on_attach = function(client, bufnr)
print("Attaching to:",client.name)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end
local opts = {noremap = true,silent=true}
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set("n", keys, func, {buffer = bufnr, desc = desc})
end
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr)
end
buf_set_keymap('n','gd','<cmd>lua vim.lsp.buf.definition()<CR>',opts)
buf_set_keymap('n','K', '<cmd>lua vim.lsp.buf.hover()<CR>',opts)
buf_set_keymap('n','[d','<cmd>lua vim.diagnostic.goto_prev()<CR>',opts)
buf_set_keymap('n',']d','<cmd>lua vim.diagnostic.goto_next()<CR>',opts)
buf_set_keymap('n','<leader>d','<cmd>lua vim.diagnostic.open_float({border="rounded"})<CR>',opts)
buf_set_keymap('n','<space>f','<cmd>lua vim.lsp.buf.format()<CR>',opts)
nmap('gd', vim.lsp.buf.definition, "[G]oto [D]efinition")
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
nmap('K',vim.lsp.buf.hover, "Hover Documentation")
nmap('[d', vim.diagnostic.goto_prev, "[G]oto previous diagnostic message")
nmap(']d', vim.diagnostic.goto_next, "[G]oto next diagnostic message")
nmap('<leader>e', vim.diagnostic.open_float, "Open floating diagnostic message")
end
local servers = mason_lsp.get_installed_servers()
@ -66,7 +84,6 @@ for _, server in ipairs(servers) do
end
else
vim.pretty_print({server = server, result = result})
-- vim.notify("Missing server configuration for " .. server, "error")
end
end
end

View File

@ -7,8 +7,8 @@ end
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping.select_next_item(),
["<C-k>"] = cmp.mapping.select_next_item(),
["<C-j>"] = cmp.mapping.select_prev_item(),
["<C-N>"] = cmp.mapping.select_next_item(),
["<C-P>"] = cmp.mapping.select_prev_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({select = false}),

View File

@ -5,10 +5,10 @@ end
local s = ls.s
local fmt = require("luasnip.extras.fmt").fmt
local fmt = require("luasnip.extras.fmt")
local i = ls.insert_node
local t = ls.text_node
local rep = require("luasnip.extras").rep
ls.setup({
@ -20,22 +20,52 @@ ls.setup({
})
ls.add_snippets("lua", {
s(
"reqm",
fmt(
-- ls.add_snippets("lua", {
-- ls.snippet("reqm",
-- fmt.fmta(
-- [[
-- local ok, {} = pcall(require,"{}")
-- if not ok then
-- vim.notify("Failed load {}\n")
-- end
-- ]], {
-- i(1, "mod"),
-- i(2),
-- rep(2),
-- }
-- )
-- )
-- })
ls.add_snippets("go", {
ls.snippet("func",
fmt.fmta(
[[
local ok, {} = pcall(require,"{}")
if not ok then
vim.notify("Failed load {}\n")
end
<>, err := <>
if err != nil {
<>
}
]], {
i(1, "mod"),
i(2),
rep(2),
i(1, "out"),
i(2, "func()"),
i(3, "// some code")
}
)
),
ls.snippet(
"main",
fmt.fmta(
[[
func main() {
<><>
}
]],
{ t("\t"), i(0) }
)
),
})
-- Configuring keybinds

View File

@ -23,17 +23,13 @@ telescope.setup{
local keymap = vim.keymap.set
keymap("n","<leader>f",builtin.find_files)
keymap("n","<leader>l",builtin.live_grep)
keymap("n","<leader>L",builtin.grep_string)
keymap("n","<leader>sf",builtin.find_files, {desc = "[S]earch [F]iles"})
keymap("n","<leader>sg",builtin.live_grep, {desc = "[S]earch by [G]rep"})
keymap("n","<leader>sw",builtin.grep_string, {desc = "[S]earch current [W]ord"})
keymap("n","<leader>ff",builtin.current_buffer_fuzzy_find, {desc = "[F]uzzy [F]ind in current [B]uffer"})
keymap("n","<leader>;",builtin.current_buffer_fuzzy_find)
keymap("n","<leader>b",builtin.buffers)
keymap("n","<leader>fb",builtin.buffers, {desc = "[F]ind existing [B]uffers"})
keymap("n","<leader>e",function()
builtin.diagnostics{bufnr = 0,severity_limit = "WARN"}
end)
keymap("n","<leader>E",function()
builtin.diagnostics{severity_limit = "WARN"}
end)
keymap("n","<leader>sd",builtin.diagnostics, {desc = "[S]earch [D]iagnostics"})
keymap("n","<leader>sdc",function() builtin.diagnostics{bufnr = 0} end, {desc = "[S]earch [D]iagnostics in current [B]uffer"})
keymap("n","<leader>sk",builtin.keymaps, {desc = "[S]earch existing [K]eymaps"})

View File

@ -71,7 +71,7 @@ button:focus {
#workspaces button.active {
background-color: @background;
color: @blue;
color: @white;
}
#workspaces button.urgent {

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 274 KiB

View File

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 758 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 342 KiB

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

Before

Width:  |  Height:  |  Size: 482 KiB

After

Width:  |  Height:  |  Size: 482 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

12
bin/backup-game-files.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
declare -A local_games
local_games=( ["Factorio"]="$HOME/.factorio" ["Terraria"]="$HOME/.local/share/Terraria" )
remote_games_path="Game Files"
for game in ${!local_games[@]}
do
echo "${local_games[$game]} => $remote_games_path/$game"
upload-to-nextcloud "${local_games[$game]}" "$remote_games_path/$game"
done

View File

@ -27,7 +27,14 @@ while true; do
"Battery is low ($time_to_empty hours left)" \
-r 100 \
-i "$notify_icons/battery-low.png"
mpv "/home/q/.config/alarm/low-battery-sound.mp3"
mpv "/home/q/.config/alarm/low-battery-sound.mp3" > /dev/null 2>&1
fi
if [ "$battery_level" -gt 80 ] && [ "$discharging" -eq 0 ]; then
dunstify -a "Battery" \
"Battery is charged: ${battery_level}%" \
-r 100 \
-i "$notify_icons/battery-charged.png"
fi
sleep ${check_interval}s

BIN
bin/ctpv Executable file

Binary file not shown.

5
bin/ctpvclear Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
[ -z "$id" ] && id="$1"
exec ctpv -c "$id"

View File

@ -1,5 +0,0 @@
#!/bin/sh
last_pkg_updates=$(grep 'pacman -Suuy' /var/log/pacman.log | tail -1 | tr -d '[' | cut -f 1 -d 'T')
echo "Last update: $last_pkg_updates ($(date +'%Y-%m-%d'))"

View File

@ -6,11 +6,10 @@ last_pkg_updates=$(grep 'pacman -Suuy' /var/log/pacman.log | tail -1 | tr -d '['
case $1 in
"--notification")
dunstify -a "Updates" \
"$num updates available" \
"Last update: $last_pkg_updates ($(date +'%Y-%m-%d'))" \
-r 100 \
"Updates" \
"$num updates available\nLast update: $last_pkg_updates ($(date +'%Y-%m-%d'))"
;;
esac
#echo "Last update: $last_pkg_updates ($(date +'%Y-%m-%d'))"

BIN
bin/lf Executable file

Binary file not shown.

View File

@ -2,25 +2,10 @@
if [ -z "$1" ]
then
echo "./restart --picom/--polybar/--sxhkd";
echo "./restart [service]";
exit 1;
fi
case $1 in
"--picom")
pkill -USR1 -x picom
dunstify "picom restarted" -t 3500
;;
"--polybar")
pkill -USR1 -x polybar
dunstify "polybar restarted" -t 3500
;;
"--sxhkd")
pkill -USR1 -x sxhkd
dunstify "sxhkd restarted" -t 3500
;;
esac
pkill -USR1 -x $1
dunstify "$1 restarted" -t 3500
$1 & > /dev/null 2>&1

BIN
bin/swww Executable file

Binary file not shown.

BIN
bin/swww-daemon Executable file

Binary file not shown.

BIN
bin/telegram-bot-api Executable file

Binary file not shown.

BIN
bin/unmkbootimg Executable file

Binary file not shown.

View File

@ -1,8 +1,8 @@
#!/bin/bash
username="user"
password="pass123456"
url="https://domain.nextcloud.com/remote.php/dav/files/$username"
username="q"
password="k6gHR-3DPiD-s5fow-pNbzr-4MfdG"
url="https://cloud.fakeowl1.com/remote.php/dav/files/$username"
if [[ $# -lt 2 ]]; then
echo "upload-to-nextcloud - upload directory to nextcloud"

BIN
bin/user-acpid Executable file

Binary file not shown.

9
bin/w-screenrecord Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
SCREENCAST_FILE="$HOME/Videos/$(date +'%Y-%m-%d_%H:%M').mp4"
geometry=$(slurp -d -f "%wx%h %x,%y")
status=$(pkill -f "wf-recorder" || wf-recorder -f $SCREENCAST_FILE --codec=libx264)
notify-send "Screen recording started" -i "$HOME/.config/dunst/icons/record.png" -t 1000

8
bin/wrappedhl Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ~
export _JAVA_AWT_WM_NONREPARENTING=1
export XCURSOR_SIZE=24
exec Hyprland

View File

@ -15,7 +15,7 @@ artist=`echo $artist | sed 's/ *$//g'`
song=${array[1]}
song=`echo $song | sed 's/ *$//g'`
yt-dlp $1 -x --audio-format mp3 -o "$filename" $3
yt-dlp $1 -x --verbose --audio-format mp3 -o "$filename" $3
id3v2 -a "${artist}" "$filename"
id3v2 -t "${song}" "$filename"