diff options
author | Süleyman Fərəcli <suleyman@farajli.net> | 2025-06-19 01:19:02 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-19 01:19:02 +0400 |
commit | 4d14ace3c5180ec0827408c1222cb35fe27cf484 (patch) | |
tree | 5e0caad138af71bdb2d9c524b0f6fff87eee4443 /config | |
parent | 1eb90cf48629b8dfc0182cbe38b34c8082f4dc40 (diff) | |
parent | 4210338b4166f8f1c16bf30e72a69e11c098eea8 (diff) |
Merge pull request #9 from sfarajli/dev
Dev
Diffstat (limited to 'config')
-rw-r--r-- | config/bash/bashrc | 24 | ||||
-rw-r--r-- | config/git/gitconfig | 19 | ||||
-rw-r--r-- | config/lf/lfrc | 51 | ||||
-rw-r--r-- | config/mpv/input.conf | 9 | ||||
-rw-r--r-- | config/nvim/init.lua | 83 | ||||
-rw-r--r-- | config/nvim/lua/plugins.lua | 24 | ||||
-rw-r--r-- | config/picom/picom.conf | 19 | ||||
l--------- | config/qutebrowser/bookmarks/bookmarks.txt | 1 | ||||
-rwxr-xr-x | config/qutebrowser/bookmarks/urls | 2 | ||||
-rwxr-xr-x | config/qutebrowser/config.py | 2 | ||||
l--------- | config/qutebrowser/current_theme.py | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | config/qutebrowser/startpage/index.html | 6 | ||||
-rw-r--r-- | config/qutebrowser/themes/ayu_light.py | 16 | ||||
-rw-r--r-- | config/qutebrowser/themes/gruvbox.py (renamed from config/qutebrowser/gruvbox.py) | 0 | ||||
-rw-r--r-- | config/qutebrowser/themes/nord.py | 16 | ||||
-rwxr-xr-x | config/sxiv/exec/key-handler | 79 | ||||
-rwxr-xr-x | config/zsh/zshrc | 1 |
17 files changed, 227 insertions, 126 deletions
diff --git a/config/bash/bashrc b/config/bash/bashrc index ca2435d..f143fd2 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -1,18 +1,28 @@ -# Minimal bash config for servers - set -o vi -stty -ixon # Disable ctrl-s and ctrl-q for freezing prompt -shopt -s autocd # automatically cd into typed directory +# `set show-mode-in-prompt on` is not set, +# indicating vi mode in bash is too slow + +# Ctrl-l is disabled in vi mode, bind it manually +bind -m vi-command '"\C-l": clear-screen' +bind -m vi-insert '"\C-l": clear-screen' -alias vi=vim -alias vi=nvim +stty -ixon # Disable ctrl-s and ctrl-q for freezing prompt +shopt -s autocd # Automatically cd into typed directory -PS1='\e[01;31m$(code=${?##0};echo ${code:+[${code}]" "})\e[00m\u@\H \w % ' +PS1='\[\e[01;31m\]$(code=$?; [ "$code" -ne 0 ] && echo "[${code}] ")\[\e[00m\]\[\e[01;34m\]\u\[\e[00m\]@\H \w % ' if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" +else + # Fallback aliases where aliasrc isn't present (e.g., on servers) + alias \ + vi="vim" \ + vi="nvim" \ + clear="clear -x" + fi if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" + bind '"\C-o": "\C-ulfcd\n"' fi diff --git a/config/git/gitconfig b/config/git/gitconfig index 976d768..8a69554 100644 --- a/config/git/gitconfig +++ b/config/git/gitconfig @@ -1,9 +1,26 @@ [init] defaultBranch = master + [pager] branch = false + [alias] - pushall = !git remote | xargs -L1 git push --all + co = checkout + br = branch + ci = commit + st = status + pushall = "!for r in $(git remote); do git push --all \"$r\"; done" + [user] email = suleyman@farajli.net name = Suleyman Farajli + # signingkey = <to be set manually> + +[commit] + gpgSign = true + +[tag] + gpgSign = true + +[gpg] + format = openpgp diff --git a/config/lf/lfrc b/config/lf/lfrc index 1b50065..40b6272 100644 --- a/config/lf/lfrc +++ b/config/lf/lfrc @@ -1,51 +1,48 @@ -# Suleyman's gruvbox themed lf config at "https://git.farajli.net/slcf.git" - -# Due to the facts that ueberzug is no longer maintained and adds extra \ -# complexity it is not included in the config +# Due to the fact that ueberzug is no longer maintained and +# adds extra complexity, it is not included in the configuration." # Options set incsearch -set scrolloff 4 #smooth scrolling +set scrolloff 4 # Smooth scrolling -# Key-maps +# Bindings map <enter> shell map m push $mkdir<space> map t push $touch<space> map D trash map <c-f> $lf -remote "send $id select \"$(fzf --reverse)\"" -map x $$f # execute current file (must be executable) +map x $$f # Execute current file (must be executable) map zb :{{ set sortby natural; set info size; set preview; set ratios 5:2; }} map zz :{{ set preview; set ratios 1:2:3; }} -# Directory change -map <c-h> cd ~ +# Directory change keybinds (some overwrite default ones) +# <c-h> and <c-k> might fail on some terminal emulators +map <c-h> cd ~/ map <c-p> cd ~/proj map <c-t> cd ~/tproj -map <c-c> cd ~/.config -map <c-r> cd /tmp -map <c-u> cd /usr/local/bin -map <c-m> cd ~/music -map <c-b> cd ~/books - -# Colors -set cursoractivefmt "\033[0;1;7m" #white -# set cursoractivefmt "\033[32;1;7m" #yellowish green -# set cursoractivefmt "\033[33;1;7m" #orange -# set cursoractivefmt "\033[36;1;7m" #green +map <c-k> cd /tmp +map <c-w> cd ~/work +# Theme +set cursoractivefmt "\033[0;1;7m" set cursorparentfmt "\033[0;1;7m" set tagfmt "\033[32;1;7m" set rulerfmt "\033[32;1;7m" set promptfmt "\033[48;1;234m %w/%f" -#FIXME: Doesn't overwrite some files cmd trash ${{ - mkdir -p ~/.trash - if [ -z "$fs" ]; then - mv "$f" ~/.trash - else - IFS="$(printf '\n\t')"; mv $fs ~/.trash - fi + set -f + mkdir -p ~/.trash + for entry in $fx; do + trash_path=~/.trash/$(basename -- "${entry}") + if [ -e "${trash_path}" ]; then + printf '%s exists\n' "${trash_path}" >&2 + trash_path="${trash_path}_$(date +%s)_$RANDOM" + printf 'moving to %s\n' "${trash_path}" >&2 + fi + + mv -- "${entry}" "${trash_path}" + done }} diff --git a/config/mpv/input.conf b/config/mpv/input.conf index 192a14c..8c32fe8 100644 --- a/config/mpv/input.conf +++ b/config/mpv/input.conf @@ -1,7 +1,8 @@ -l seek 5 -h seek -5 , seek -60 . seek 60 +h seek -5 +l seek 5 + S cycle sub -L ab-loop -J cycle-values loop-file "inf" "no" +Ctrl+l ab-loop +L cycle-values loop-file "inf" "no" diff --git a/config/nvim/init.lua b/config/nvim/init.lua index df90607..ea8a3d2 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,15 +1,14 @@ require("plugins") -vim.cmd("let mapleader = ' '") -vim.cmd("set relativenumber") -vim.cmd("set number") -vim.cmd("colorscheme duskfox") -vim.cmd("set nowrap") -vim.cmd("set clipboard=unnamedplus") -- Use system clipboard -vim.cmd("set background=dark") -vim.cmd("set shm+=I") -- Disable intro message -vim.cmd("autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o") -- Disable auto-comment --- vim.cmd("set list") -- Show spaces tabs etc. +vim.g.mapleader = ' ' +vim.opt.background = "dark" +vim.opt.clipboard = "unnamedplus" -- Use system clipboard +vim.opt.list = true -- Show spaces, tabs, etc. +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.shortmess:append("I") -- Disable intro message +vim.opt.wrap = false +vim.cmd.colorscheme("duskfox") vim.opt.fillchars = { vert = "|", @@ -22,16 +21,54 @@ vim.opt.fillchars = { foldclose = ">", } -vim.keymap.set('n', '<leader><leader>', ':w!<CR>') -vim.keymap.set('n', '<leader>q', ':wq!<CR>') -vim.keymap.set('n', '<C-t>', ':tabnew<CR>') -vim.keymap.set('n', 'J', ':tabn<CR>') -vim.keymap.set('n', 'K', ':tabp<CR>') -vim.keymap.set('n', '<C-n>', ':vsplit<CR>') -vim.keymap.set('n', 'H', ':wincmd h<CR>') -vim.keymap.set('n', 'L', ':wincmd l<CR>') -vim.keymap.set('n', '<leader>e', ':Neotree toggle right<CR>') -vim.keymap.set('n', '<leader>o', '<C-W>w') -vim.keymap.set('i', '<C-h>', '<Left>') -vim.keymap.set('i', '<C-l>', '<Right>') -vim.keymap.set('i', '<C-space>', '<ESC>') +-- Remove trailing whitespace on all lines before saving, excluding markdown files +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*", + callback = function() + if vim.bo.filetype == "markdown" then + return + end + vim.cmd([[%s/\s\+$//e]]) + end, +}) + +-- Disable auto-comment +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + vim.opt_local.formatoptions:remove({ "c", "r", "o" }) + end, +}) + + +-- NOTE: On some terminal emulators, the keybinds +-- <C-j> and <C-k> don't work either in normal or insert mode. + +-- Tabs +vim.keymap.set('n', '<C-t>', '<cmd>tabnew<CR>' , { noremap = true, silent = true }) +vim.keymap.set('n', 'H' , '<cmd>wincmd h<CR>', { noremap = true, silent = true }) +vim.keymap.set('n', 'J' , '<cmd>tabn<CR>' , { noremap = true, silent = true }) +vim.keymap.set('n', 'K' , '<cmd>tabp<CR>' , { noremap = true, silent = true }) +vim.keymap.set('n', 'L' , '<cmd>wincmd l<CR>', { noremap = true, silent = true }) + +-- Windows +vim.keymap.set('n', '<C-Down>' , '<cmd>split<CR>' , { noremap = true, silent = true }) +vim.keymap.set('n', '<C-Right>', '<cmd>vsplit<CR>', { noremap = true, silent = true }) +vim.keymap.set('n', '<C-h>' , '<C-w>h' , { noremap = true }) +vim.keymap.set('n', '<C-j>' , '<C-w>j' , { noremap = true }) +vim.keymap.set('n', '<C-k>' , '<C-w>k' , { noremap = true }) +vim.keymap.set('n', '<C-l>' , '<C-w>l' , { noremap = true }) + +-- Imitate normal mode in insert mode +vim.keymap.set('i', '<C-h>' , '<Left>' , { noremap = true }) +vim.keymap.set('i', '<C-l>' , '<Right>', { noremap = true }) +vim.keymap.set('i', '<C-j>' , '<Down>' , { noremap = true }) +vim.keymap.set('i', '<C-k>' , '<Up>' , { noremap = true }) +vim.keymap.set('i', '<C-space>', '<ESC>' , { noremap = true }) + +-- Plugins +vim.keymap.set('n', '<leader>e', '<cmd>Neotree toggle right<CR>', { noremap = true, silent = true }) + +-- Other +vim.keymap.set('n', '<leader><leader>', '<cmd>w!<CR>' , { noremap = true, silent = true }) +vim.keymap.set('n', '<leader>q' , '<cmd>wq!<CR>', { noremap = true, silent = true }) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 911a4d7..7b00b1c 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -33,18 +33,18 @@ require("lazy").setup({ }) require("Comment").setup{ - padding = true, -- Add a space b/w comment and the line - sticky = true, -- Whether the cursor should stay at its position - ignore = nil, -- Lines to be ignored while (un)comment + padding = true, -- Add a space b/w comment and the line + sticky = true, -- Whether the cursor should stay at its position + ignore = nil, -- Lines to be ignored while (un)comment -- LHS of toggle mappings in NORMAL mode toggler = { - line = 'cc', --Line-comment toggle keymap - block = 'cb', -- Block-comment toggle keymap + line = 'cc', --Line-comment toggle keymap + block = 'cb', -- Block-comment toggle keymap }, -- LHS of operator-pending mappings in NORMAL and VISUAL mode opleader = { - line = 'cc', --Line-comment keymap - block = 'cb', --Block-comment keymap + line = 'cc', --Line-comment keymap + block = 'cb', --Block-comment keymap }, } @@ -72,25 +72,21 @@ require("neo-tree").setup({ } } }, - --Indent Markers default_component_configs = { indent = { + --Indent Markers with_markers = true, indent_marker = "│", last_indent_marker = "└", indent_size = 2, - }, - }, - --Expanders - default_component_configs = { - indent = { + -- Expanders with_expanders = false, --Not active expander_collapsed = ">", expander_expanded = "", expander_highlight = "NeoTreeExpander", + }, }, - }) require("nvim-autopairs").setup({ diff --git a/config/picom/picom.conf b/config/picom/picom.conf index 58188aa..a5583a0 100644 --- a/config/picom/picom.conf +++ b/config/picom/picom.conf @@ -1,16 +1,13 @@ -# Minimal picom config - backend = "glx"; shadow = false; fading = false; - vsync = true; - wintypes: - { - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; clip-shadow-above = true; } - dnd = { shadow = false; } - popup_menu = { opacity = 0.8; } - dropdown_menu = { opacity = 0.8; } - }; +wintypes: +{ + tooltip = { shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; clip-shadow-above = true; }; + dnd = { shadow = false; }; + popup_menu = { opacity = 0.8; }; + dropdown_menu = { opacity = 0.8; }; +}; diff --git a/config/qutebrowser/bookmarks/bookmarks.txt b/config/qutebrowser/bookmarks/bookmarks.txt new file mode 120000 index 0000000..526f096 --- /dev/null +++ b/config/qutebrowser/bookmarks/bookmarks.txt @@ -0,0 +1 @@ +../../sites/bookmarks.txt
\ No newline at end of file diff --git a/config/qutebrowser/bookmarks/urls b/config/qutebrowser/bookmarks/urls deleted file mode 100755 index 0711a66..0000000 --- a/config/qutebrowser/bookmarks/urls +++ /dev/null @@ -1,2 +0,0 @@ -yewtu.be -onion.tube diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index faaf7f2..fa84b4e 100755 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -1,4 +1,4 @@ -from gruvbox import * +from current_theme import * # Text color of the completion widget. May be a single color to use for # all columns or a list of three colors, one for each column. diff --git a/config/qutebrowser/current_theme.py b/config/qutebrowser/current_theme.py new file mode 120000 index 0000000..f9e5462 --- /dev/null +++ b/config/qutebrowser/current_theme.py @@ -0,0 +1 @@ +themes/nord.py
\ No newline at end of file diff --git a/config/qutebrowser/startpage/index.html b/config/qutebrowser/startpage/index.html index b848797..05a074f 100644..100755 --- a/config/qutebrowser/startpage/index.html +++ b/config/qutebrowser/startpage/index.html @@ -3,14 +3,14 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel='stylesheet' type='text/css' href="style.css"> <title>startpage</title> <style> body { - height: 97.5vh; + height: 100vh; display: flex; align-items: center; - font: 12px monospace; + font-family: "JetBrains Mono"; + font-size: 11px; justify-content: center; background: #212121; color: #fff; diff --git a/config/qutebrowser/themes/ayu_light.py b/config/qutebrowser/themes/ayu_light.py new file mode 100644 index 0000000..afb20e9 --- /dev/null +++ b/config/qutebrowser/themes/ayu_light.py @@ -0,0 +1,16 @@ +base00 = "#fafafa" +base01 = "#f0f0f0" +base02 = "#dedede" +base03 = "#b3b1ad" +base04 = "#9e9e9e" +base05 = "#5c6773" +base06 = "#6c7680" +base07 = "#14191f" +base08 = "#ff3333" +base09 = "#f6973f" +base0A = "#f2ae49" +base0B = "#86b300" +base0C = "#4cbf99" +base0D = "#36a3d9" +base0E = "#a37acc" +base0F = "#d33f3f" diff --git a/config/qutebrowser/gruvbox.py b/config/qutebrowser/themes/gruvbox.py index d06e346..d06e346 100644 --- a/config/qutebrowser/gruvbox.py +++ b/config/qutebrowser/themes/gruvbox.py diff --git a/config/qutebrowser/themes/nord.py b/config/qutebrowser/themes/nord.py new file mode 100644 index 0000000..3e4f13d --- /dev/null +++ b/config/qutebrowser/themes/nord.py @@ -0,0 +1,16 @@ +base00 = "#2e3440" +base01 = "#3b4252" +base02 = "#434c5e" +base03 = "#4c566a" +base04 = "#d8dee9" +base05 = "#e5e9f0" +base06 = "#eceff4" +base07 = "#8fbcbb" +base08 = "#bf616a" +base09 = "#d08770" +base0A = "#ebcb8b" +base0B = "#a3be8c" +base0C = "#88c0d0" +base0D = "#81a1c1" +base0E = "#b48ead" +base0F = "#5e81ac" diff --git a/config/sxiv/exec/key-handler b/config/sxiv/exec/key-handler index 50202fc..e90cbb1 100755 --- a/config/sxiv/exec/key-handler +++ b/config/sxiv/exec/key-handler @@ -1,76 +1,91 @@ #!/bin/sh # For theme to be applied ~/.Xresource file must be present -picdir="${HOME}/pics" +set -f while read -r file; do case "$1" in "m") + # FIXME: Providing directory selections to dmenu limits choices; + # e.g., if `/home/user/pics` is given, `/` can't be selected. + if [ -z "${destdir}" ]; then - destdir="$(echo "${picdir}" \ - | dmenu -p "Move directory: " \ + destdir="$(printf '' \ + | dmenu -c -bw 2 -p "Copy directory: " \ | sed "s|~|${HOME}|g")" fi + # Skip non-directories to prevent overwriting files during loop processing if [ ! -d "${destdir}" ]; then - nsend -s "Not a directory" + nsend -s "Failed to move" "Not a directory: ${destdir}" exit 1 fi - if mv "${file}" "${destdir}"; then - nsend -s "${file} moved to ${destdir}" & + if output=$(mv -- "${file}" "${destdir}" 2>&1); then + nsend -s "Moved" "${file} to ${destdir}" & else - nsend -s "Failed to move ${file} to ${destdir}" + nsend -s "Failed to Move" "$output" & fi ;; "c") - - if [ -z "${destdir}" ];then - destdir="$(echo "${picdir}" \ - | dmenu -p "Copy directory: " \ + if [ -z "${destdir}" ]; then + destdir="$(printf '' \ + | dmenu -c -bw 2 -p "Copy directory: " \ | sed "s|~|${HOME}|g")" fi if [ ! -d "${destdir}" ]; then - nsend -s "Not a directory" & + nsend -s "Failed to copy" "Not a directory: ${destdir}" exit 1 fi - if cp "${file}" "${destdir}"; then - nsend -s "${file} copied to ${destdir}" & + if output=$(cp -- "${file}" "${destdir}" 2>&1); then + nsend -s "Copied" "${file} to ${destdir}" & else - nsend -s "Failed to copy ${file} to ${destdir}" & + nsend -s "Failed to copy" "$output" & fi ;; - "w") - swall -d "$file" && nsend -s "Wallpaper ${file}" \ - || nsend -s "Couldn't set wallpaper" - ;; "d") - mkdir -p ~/.trash + mkdir -p "${HOME}/.trash" + trash_path="$HOME/.trash/$(basename -- "${file}")" + if [ -e "${trash_path}" ]; then + rand=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ') + trash_path="${trash_path}_$(date +%Y%m%d%H%M%S)_${rand}" + fi - if mv "$file" ~/.trash; then - nsend -s "$file is moved to ~/.trash" & + if output=$(mv -- "${file}" "${trash_path}" 2>&1); then + nsend -s "Deleted" "${file} to ${trash_path}" & else - nsend -s "Failed to move ${file} to ~/.trash" & + nsend -s "Failed to delete" "$output" & fi + ;; - "r") convert -rotate 90 "$file" "$file" ;; - "R") convert -rotate -90 "$file" "$file" ;; - "f") convert -flop "$file" "$file" ;; "y") if printf "%s" "${file}" | xclip -selection clipboard; then - nsend -s "Copied to clipboard" & + nsend -s "Relative path copied to clipboard." & else - nsend -s "Failed to copy to clipboard" & + nsend -s "Failed to copy relative path to clipboard." & fi ;; "Y") - if readlink -f "$file" | tr -d '\n' | xclip -selection clipboard; then - nsend -s "Copied to clipboard" & + if readlink -f "${file}" | tr -d '\n' | xclip -selection clipboard; then + nsend -s "Full path copied to clipboard." & + else + nsend -s "Failed to copy full path to clipboard." & + fi + ;; + "w") + + if output=$(swall -d "${file}" 2>&1); then + nsend -s "Set as wallpaper" "${file}" & else - nsend -s "Failed to copy to clipboard" & + nsend -s "Failed to set as wallpaper" "$output" & fi ;; - esac + # No need for nsend since whether the photo has rotated or not is obvious + # FIXME: convert is depricated use magick instead + "r") convert -rotate 90 "${file}" "${file}" ;; + "R") convert -rotate -90 "${file}" "${file}" ;; + "f") convert -flop "${file}" "${file}" ;; + esac done diff --git a/config/zsh/zshrc b/config/zsh/zshrc index 4afbbc1..892310a 100755 --- a/config/zsh/zshrc +++ b/config/zsh/zshrc @@ -33,7 +33,6 @@ bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char - # Change cursor shape for different vi modes. function zle-keymap-select () { case "${KEYMAP}" in |