diff --git a/.config/fish/completions/fzf_configure_bindings.fish b/.config/fish/completions/fzf_configure_bindings.fish new file mode 100644 index 0000000..b38ef92 --- /dev/null +++ b/.config/fish/completions/fzf_configure_bindings.fish @@ -0,0 +1,8 @@ +complete fzf_configure_bindings --no-files +complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h" +complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory" +complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log" +complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status" +complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history" +complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes" +complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables" diff --git a/.config/fish/completions/swww.fish b/.config/fish/completions/swww.fish new file mode 100644 index 0000000..412391f --- /dev/null +++ b/.config/fish/completions/swww.fish @@ -0,0 +1,36 @@ +complete -c swww -n "__fish_use_subcommand" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c swww -n "__fish_use_subcommand" -s V -l version -d 'Print version' +complete -c swww -n "__fish_use_subcommand" -f -a "clear" -d 'Fills the specified outputs with the given color' +complete -c swww -n "__fish_use_subcommand" -f -a "img" -d 'Sends an image (or animated gif) for the daemon to display' +complete -c swww -n "__fish_use_subcommand" -f -a "init" -d 'Initializes the daemon' +complete -c swww -n "__fish_use_subcommand" -f -a "kill" -d 'Kills the daemon' +complete -c swww -n "__fish_use_subcommand" -f -a "query" -d 'Asks the daemon to print output information (names and dimensions)' +complete -c swww -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c swww -n "__fish_seen_subcommand_from clear" -s o -l outputs -d 'Comma separated list of outputs to display the image at' -r +complete -c swww -n "__fish_seen_subcommand_from clear" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c swww -n "__fish_seen_subcommand_from img" -s o -l outputs -d 'Comma separated list of outputs to display the image at' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l resize -d 'Whether to resize the image and the method by which to resize it' -r -f -a "{no Do not resize the image,crop Resize the image to fill the whole screen\, cropping out parts that don\'t fit,fit Resize the image to fit inside the screen\, preserving the original aspect ratio}" +complete -c swww -n "__fish_seen_subcommand_from img" -l fill-color -d 'Which color to fill the padding with when output image does not fill screen' -r +complete -c swww -n "__fish_seen_subcommand_from img" -s f -l filter -d 'Filter to use when scaling images (run swww img --help to see options)' -r +complete -c swww -n "__fish_seen_subcommand_from img" -s t -l transition-type -d 'Sets the type of transition. Default is \'simple\', that fades into the new image' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-step -d 'How fast the transition approaches the new image' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-duration -d 'How long the transition takes to complete in seconds' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-fps -d 'Frame rate for the transition effect' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-angle -d 'This is used for the \'wipe\' and \'wave\' transitions. It controls the angle of the wipe' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-pos -d 'This is only used for the \'grow\',\'outer\' transitions. It controls the center of circle (default is \'center\')' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-bezier -d 'bezier curve to use for the transition https://cubic-bezier.com is a good website to get these values from' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l transition-wave -d 'currently only used for \'wave\' transition to control the width and height of each wave' -r +complete -c swww -n "__fish_seen_subcommand_from img" -l no-resize -d 'Do not resize the image. Equivalent to `--resize=no`' +complete -c swww -n "__fish_seen_subcommand_from img" -l invert-y -d 'inverts the y position sent in \'transiiton_pos\' flag' +complete -c swww -n "__fish_seen_subcommand_from img" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c swww -n "__fish_seen_subcommand_from init" -l no-daemon -d 'Don\'t fork the daemon. This will keep it running in the current terminal' +complete -c swww -n "__fish_seen_subcommand_from init" -l no-cache -d 'Don\'t load the cache *during initialization* (it still loads on monitor (re)connection)' +complete -c swww -n "__fish_seen_subcommand_from init" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c swww -n "__fish_seen_subcommand_from kill" -s h -l help -d 'Print help' +complete -c swww -n "__fish_seen_subcommand_from query" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "clear" -d 'Fills the specified outputs with the given color' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "img" -d 'Sends an image (or animated gif) for the daemon to display' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "init" -d 'Initializes the daemon' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "kill" -d 'Kills the daemon' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "query" -d 'Asks the daemon to print output information (names and dimensions)' +complete -c swww -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from clear; and not __fish_seen_subcommand_from img; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from kill; and not __fish_seen_subcommand_from query; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' diff --git a/.config/fish/conf.d/fzf.fish b/.config/fish/conf.d/fzf.fish new file mode 100644 index 0000000..8156c11 --- /dev/null +++ b/.config/fish/conf.d/fzf.fish @@ -0,0 +1,28 @@ +# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup +if not status is-interactive && test "$CI" != true + exit +end + +# Because of scoping rules, to capture the shell variables exactly as they are, we must read +# them before even executing _fzf_search_variables. We use psub to store the +# variables' info in temporary files and pass in the filenames as arguments. +# This variable is global so that it can be referenced by fzf_configure_bindings and in tests +set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' + + +# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings +fzf_configure_bindings + +# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased +function _fzf_uninstall --on-event fzf_uninstall + _fzf_uninstall_bindings + + set --erase _fzf_search_vars_command + functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings + complete --erase fzf_configure_bindings + + set_color cyan + echo "fzf.fish uninstalled." + echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings." + set_color normal +end diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 8d2eb14..8cc486d 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -45,6 +45,13 @@ if status is-interactive set pkgdir "$HOME/.npm/" alias npm="npm --cache $srcir/npm-cache" + bind \el forward-word + bind \eh backward-word + + bind \eg beginning-of-line + bind \eG end-of-line + + set fish_greeting # Commands to run in interactive sessions can go here end diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins index 840a2dd..bfce667 100644 --- a/.config/fish/fish_plugins +++ b/.config/fish/fish_plugins @@ -5,3 +5,4 @@ catppuccin/fish jorgebucaran/autopair.fish joshmedeski/fish-lf-icons nickeb96/puffer-fish +patrickf1/fzf.fish diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index a379394..e7ad641 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -8,7 +8,8 @@ SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fish SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish SETUVAR _fisher_joshmedeski_2F_fish_2D_lf_2D_icons_files:\x7e/\x2econfig/fish/conf\x2ed/lf\x2dicons\x2efish SETUVAR _fisher_nickeb96_2F_puffer_2D_fish_files:\x7e/\x2econfig/fish/functions/_puffer_fish_expand_bang\x2efish\x1e\x7e/\x2econfig/fish/functions/_puffer_fish_expand_dots\x2efish\x1e\x7e/\x2econfig/fish/functions/_puffer_fish_expand_lastarg\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/puffer_fish_key_bindings\x2efish -SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish\x1ederekstavis/fish\x2dneovim\x1ecatppuccin/fish\x1ejorgebucaran/autopair\x2efish\x1ejoshmedeski/fish\x2dlf\x2dicons\x1enickeb96/puffer\x2dfish +SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish +SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish\x1ederekstavis/fish\x2dneovim\x1ecatppuccin/fish\x1ejorgebucaran/autopair\x2efish\x1ejoshmedeski/fish\x2dlf\x2dicons\x1enickeb96/puffer\x2dfish\x1epatrickf1/fzf\x2efish SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR fish_color_autosuggestion:747369 SETUVAR fish_color_cancel:\x2d\x2dreverse diff --git a/.config/fish/functions/_fzf_configure_bindings_help.fish b/.config/fish/functions/_fzf_configure_bindings_help.fish new file mode 100644 index 0000000..ecfe68e --- /dev/null +++ b/.config/fish/functions/_fzf_configure_bindings_help.fish @@ -0,0 +1,43 @@ +function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings." + echo "\ +USAGE: + fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...] + +DESCRIPTION + fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it + previously installed. It installs bindings for both default and insert modes. fzf.fish executes + it without options on fish startup to install the out-of-the-box key bindings. + + By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding + can be configured using a namesake corresponding option: + COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION + Search Directory | Ctrl+Alt+F (F for file) | --directory + Search Git Log | Ctrl+Alt+L (L for log) | --git_log + Search Git Status | Ctrl+Alt+S (S for status) | --git_status + Search History | Ctrl+R (R for reverse) | --history + Search Processes | Ctrl+Alt+P (P for process) | --processes + Search Variables | Ctrl+V (V for variable) | --variables + Override a command's binding by specifying its corresponding option with the desired key + sequence. Disable a command's binding by specifying its corresponding option with no value. + + Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly + executed multiple times. Once the desired fzf_configure_bindings command has been found, add it + to your config.fish in order to persist the customized bindings. + + In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an + equals sign between an option's name and value. However, it does not validate key sequences. + + Pass -h or --help to print this help message and exit. + +EXAMPLES + Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V + \$ fzf_configure_bindings --directory=\cf --variables=\e\cv + Default bindings but disable Search History + \$ fzf_configure_bindings --history= + An agglomeration of different options + \$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes= + +SEE Also + To learn more about fish key bindings, see bind(1) and fish_key_reader(1). +" +end diff --git a/.config/fish/functions/_fzf_extract_var_info.fish b/.config/fish/functions/_fzf_extract_var_info.fish new file mode 100644 index 0000000..dd4e952 --- /dev/null +++ b/.config/fish/functions/_fzf_extract_var_info.fish @@ -0,0 +1,15 @@ +# helper function for _fzf_search_variables +function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output." + # Extract only the lines about the variable, all of which begin with either + # $variable_name: ...or... $variable_name[ + string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output | + + # Strip the variable name prefix, including ": " for scope info lines + string replace --regex "^\\\$$variable_name(?:: )?" '' | + + # Distill the lines of values, replacing... + # [1]: |value| + # ...with... + # [1] value + string replace --regex ": \|(.*)\|" ' $1' +end diff --git a/.config/fish/functions/_fzf_preview_changed_file.fish b/.config/fish/functions/_fzf_preview_changed_file.fish new file mode 100644 index 0000000..78dd561 --- /dev/null +++ b/.config/fish/functions/_fzf_preview_changed_file.fish @@ -0,0 +1,49 @@ +# helper for _fzf_search_git_status +# arg should be a line from git status --short, e.g. +# MM functions/_fzf_preview_changed_file.fish +# D README.md +# R LICENSE -> "New License" +function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file." + # remove quotes because they'll be interpreted literally by git diff + # no need to requote when referencing $path because fish does not perform word splitting + # https://fishshell.com/docs/current/fish_for_bash_users.html + set -f path (string unescape (string sub --start 4 $path_status)) + # first letter of short format shows index, second letter shows working tree + # https://git-scm.com/docs/git-status/2.35.0#_short_format + set -f index_status (string sub --length 1 $path_status) + set -f working_tree_status (string sub --start 2 --length 1 $path_status) + + set -f diff_opts --color=always + + if test $index_status = '?' + _fzf_report_diff_type Untracked + _fzf_preview_file $path + else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU + # Unmerged statuses taken directly from git status help's short format table + # Unmerged statuses are mutually exclusive with other statuses, so if we see + # these, then safe to assume the path is unmerged + _fzf_report_diff_type Unmerged + git diff $diff_opts -- $path + else + if test $index_status != ' ' + _fzf_report_diff_type Staged + + # renames are only detected in the index, never working tree, so only need to test for it here + # https://stackoverflow.com/questions/73954214 + if test $index_status = R + # diff the post-rename path with the original path, otherwise the diff will show the entire file as being added + set -f orig_and_new_path (string split --max 1 -- ' -> ' $path) + git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2] + # path currently has the form of "original -> current", so we need to correct it before it's used below + set path $orig_and_new_path[2] + else + git diff --staged $diff_opts -- $path + end + end + + if test $working_tree_status != ' ' + _fzf_report_diff_type Unstaged + git diff $diff_opts -- $path + end + end +end diff --git a/.config/fish/functions/_fzf_preview_file.fish b/.config/fish/functions/_fzf_preview_file.fish new file mode 100644 index 0000000..c926475 --- /dev/null +++ b/.config/fish/functions/_fzf_preview_file.fish @@ -0,0 +1,43 @@ +# helper function for _fzf_search_directory and _fzf_search_git_status +function _fzf_preview_file --description "Print a preview for the given file based on its file type." + # because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file + # as one argument, we collect all the arguments into one single variable and treat that as the path + set -f file_path $argv + + if test -L "$file_path" # symlink + # notify user and recurse on the target of the symlink, which can be any of these file types + set -l target_path (realpath "$file_path") + + set_color yellow + echo "'$file_path' is a symlink to '$target_path'." + set_color normal + + _fzf_preview_file "$target_path" + else if test -f "$file_path" # regular file + if set --query fzf_preview_file_cmd + # need to escape quotes to make sure eval receives file_path as a single arg + eval "$fzf_preview_file_cmd '$file_path'" + else + bat --style=numbers --color=always "$file_path" + end + else if test -d "$file_path" # directory + if set --query fzf_preview_dir_cmd + # see above + eval "$fzf_preview_dir_cmd '$file_path'" + else + # -A list hidden files as well, except for . and .. + # -F helps classify files by appending symbols after the file name + command ls -A -F "$file_path" + end + else if test -c "$file_path" + _fzf_report_file_type "$file_path" "character device file" + else if test -b "$file_path" + _fzf_report_file_type "$file_path" "block device file" + else if test -S "$file_path" + _fzf_report_file_type "$file_path" socket + else if test -p "$file_path" + _fzf_report_file_type "$file_path" "named pipe" + else + echo "$file_path doesn't exist." >&2 + end +end diff --git a/.config/fish/functions/_fzf_report_diff_type.fish b/.config/fish/functions/_fzf_report_diff_type.fish new file mode 100644 index 0000000..cc26fb3 --- /dev/null +++ b/.config/fish/functions/_fzf_report_diff_type.fish @@ -0,0 +1,18 @@ +# helper for _fzf_preview_changed_file +# prints out something like +# ╭────────╮ +# │ Staged │ +# ╰────────╯ +function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch." + # number of "-" to draw is the length of the string to box + 2 for padding + set -f repeat_count (math 2 + (string length $diff_type)) + set -f line (string repeat --count $repeat_count ─) + set -f top_border ╭$line╮ + set -f btm_border ╰$line╯ + + set_color yellow + echo $top_border + echo "│ $diff_type │" + echo $btm_border + set_color normal +end diff --git a/.config/fish/functions/_fzf_report_file_type.fish b/.config/fish/functions/_fzf_report_file_type.fish new file mode 100644 index 0000000..49e02e1 --- /dev/null +++ b/.config/fish/functions/_fzf_report_file_type.fish @@ -0,0 +1,6 @@ +# helper function for _fzf_preview_file +function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file." + set_color red + echo "Cannot preview '$file_path': it is a $file_type." + set_color normal +end diff --git a/.config/fish/functions/_fzf_search_directory.fish b/.config/fish/functions/_fzf_search_directory.fish new file mode 100644 index 0000000..4541eec --- /dev/null +++ b/.config/fish/functions/_fzf_search_directory.fish @@ -0,0 +1,33 @@ +function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths." + # Directly use fd binary to avoid output buffering delay caused by a fd alias, if any. + # Debian-based distros install fd as fdfind and the fd package is something else, so + # check for fdfind first. Fall back to "fd" for a clear error message. + set -f fd_cmd (command -v fdfind || command -v fd || echo "fd") + set -f --append fd_cmd --color=always $fzf_fd_opts + + set -f fzf_arguments --multi --ansi $fzf_directory_opts + set -f token (commandline --current-token) + # expand any variables or leading tilde (~) in the token + set -f expanded_token (eval echo -- $token) + # unescape token because it's already quoted so backslashes will mess up the path + set -f unescaped_exp_token (string unescape -- $expanded_token) + + # If the current token is a directory and has a trailing slash, + # then use it as fd's base directory. + if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token" + set --append fd_cmd --base-directory=$unescaped_exp_token + # use the directory name as fzf's prompt to indicate the search is limited to that directory + set --prepend fzf_arguments --prompt="Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}" + set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) + else + set --prepend fzf_arguments --prompt="Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}' + set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) + end + + + if test $status -eq 0 + commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ') + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_search_git_log.fish b/.config/fish/functions/_fzf_search_git_log.fish new file mode 100644 index 0000000..aa54724 --- /dev/null +++ b/.config/fish/functions/_fzf_search_git_log.fish @@ -0,0 +1,36 @@ +function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_log: Not in a git repository.' >&2 + else + if not set --query fzf_git_log_format + # %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below + set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)' + end + + set -f preview_cmd 'git show --color=always --stat --patch {1}' + if set --query fzf_diff_highlighter + set preview_cmd "$preview_cmd | $fzf_diff_highlighter" + end + + set -f selected_log_lines ( + git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \ + _fzf_wrapper --ansi \ + --multi \ + --scheme=history \ + --prompt="Git Log> " \ + --preview=$preview_cmd \ + --query=(commandline --current-token) \ + $fzf_git_log_opts + ) + if test $status -eq 0 + for line in $selected_log_lines + set -f abbreviated_commit_hash (string split --field 1 " " $line) + set -f full_commit_hash (git rev-parse $abbreviated_commit_hash) + set -f --append commit_hashes $full_commit_hash + end + commandline --current-token --replace (string join ' ' $commit_hashes) + end + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_search_git_status.fish b/.config/fish/functions/_fzf_search_git_status.fish new file mode 100644 index 0000000..358f88c --- /dev/null +++ b/.config/fish/functions/_fzf_search_git_status.fish @@ -0,0 +1,41 @@ +function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_status: Not in a git repository.' >&2 + else + set -f preview_cmd '_fzf_preview_changed_file {}' + if set --query fzf_diff_highlighter + set preview_cmd "$preview_cmd | $fzf_diff_highlighter" + end + + set -f selected_paths ( + # Pass configuration color.status=always to force status to use colors even though output is sent to a pipe + git -c color.status=always status --short | + _fzf_wrapper --ansi \ + --multi \ + --prompt="Git Status> " \ + --query=(commandline --current-token) \ + --preview=$preview_cmd \ + --nth="2.." \ + $fzf_git_status_opts + ) + if test $status -eq 0 + # git status --short automatically escapes the paths of most files for us so not going to bother trying to handle + # the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping") + set -f cleaned_paths + + for path in $selected_paths + if test (string sub --length 1 $path) = R + # path has been renamed and looks like "R LICENSE -> LICENSE.md" + # extract the path to use from after the arrow + set --append cleaned_paths (string split -- "-> " $path)[-1] + else + set --append cleaned_paths (string sub --start=4 $path) + end + end + + commandline --current-token --replace -- (string join ' ' $cleaned_paths) + end + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_search_history.fish b/.config/fish/functions/_fzf_search_history.fish new file mode 100644 index 0000000..cafbce9 --- /dev/null +++ b/.config/fish/functions/_fzf_search_history.fish @@ -0,0 +1,39 @@ +function _fzf_search_history --description "Search command history. Replace the command line with the selected command." + # history merge incorporates history changes from other fish sessions + # it errors out if called in private mode + if test -z "$fish_private_mode" + builtin history merge + end + + if not set --query fzf_history_time_format + # Reference https://devhints.io/strftime to understand strftime format symbols + set -f fzf_history_time_format "%m-%d %H:%M:%S" + end + + # Delinate time from command in history entries using the vertical box drawing char (U+2502). + # Then, to get raw command from history entries, delete everything up to it. The ? on regex is + # necessary to make regex non-greedy so it won't match into commands containing the char. + set -f time_prefix_regex '^.*? │ ' + # Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line + set -f commands_selected ( + builtin history --null --show-time="$fzf_history_time_format │ " | + _fzf_wrapper --read0 \ + --print0 \ + --multi \ + --scheme=history \ + --prompt="History> " \ + --query=(commandline) \ + --preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \ + --preview-window="bottom:3:wrap" \ + $fzf_history_opts | + string split0 | + # remove timestamps from commands selected + string replace --regex $time_prefix_regex '' + ) + + if test $status -eq 0 + commandline --replace -- $commands_selected + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_search_processes.fish b/.config/fish/functions/_fzf_search_processes.fish new file mode 100644 index 0000000..133a880 --- /dev/null +++ b/.config/fish/functions/_fzf_search_processes.fish @@ -0,0 +1,32 @@ +function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process." + # Directly use ps command because it is often aliased to a different command entirely + # or with options that dirty the search results and preview output + set -f ps_cmd (command -v ps || echo "ps") + # use all caps to be consistent with ps default format + # snake_case because ps doesn't seem to allow spaces in the field names + set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command') + set -f processes_selected ( + $ps_cmd -A -opid,command | \ + _fzf_wrapper --multi \ + --prompt="Processes> " \ + --query (commandline --current-token) \ + --ansi \ + # first line outputted by ps is a header, so we need to mark it as so + --header-lines=1 \ + # ps uses exit code 1 if the process was not found, in which case show an message explaining so + --preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \ + --preview-window="bottom:4:wrap" \ + $fzf_processes_opts + ) + + if test $status -eq 0 + for process in $processes_selected + set -f --append pids_selected (string split --no-empty --field=1 -- " " $process) + end + + # string join to replace the newlines outputted by string split with spaces + commandline --current-token --replace -- (string join ' ' $pids_selected) + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_search_variables.fish b/.config/fish/functions/_fzf_search_variables.fish new file mode 100644 index 0000000..52a7c70 --- /dev/null +++ b/.config/fish/functions/_fzf_search_variables.fish @@ -0,0 +1,47 @@ +# This function expects the following two arguments: +# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables +# argument 2 = output of (set --names | psub), i.e. a file with all variable names +function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable." + if test -z "$set_names_output" + printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2 + + commandline --function repaint + return 22 # 22 means invalid argument in POSIX + end + + # Exclude the history variable from being piped into fzf because + # 1. it's not included in $set_names_output + # 2. it tends to be a very large value => increases computation time + # 3._fzf_search_history is a much better way to examine history anyway + set -f all_variable_names (string match --invert history <$set_names_output) + + set -f current_token (commandline --current-token) + # Use the current token to pre-populate fzf's query. If the current token begins + # with a $, remove it from the query so that it will better match the variable names + set -f cleaned_curr_token (string replace -- '$' '' $current_token) + + set -f variable_names_selected ( + printf '%s\n' $all_variable_names | + _fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \ + --prompt="Variables> " \ + --preview-window="wrap" \ + --multi \ + --query=$cleaned_curr_token \ + $fzf_variables_opts + ) + + if test $status -eq 0 + # If the current token begins with a $, do not overwrite the $ when + # replacing the current token with the selected variable. + # Uses brace expansion to prepend $ to each variable name. + commandline --current-token --replace ( + if string match --quiet -- '$*' $current_token + string join " " \${$variable_names_selected} + else + string join " " $variable_names_selected + end + ) + end + + commandline --function repaint +end diff --git a/.config/fish/functions/_fzf_wrapper.fish b/.config/fish/functions/_fzf_wrapper.fish new file mode 100644 index 0000000..45556ce --- /dev/null +++ b/.config/fish/functions/_fzf_wrapper.fish @@ -0,0 +1,20 @@ +function _fzf_wrapper --description "Prepares some environment variables before executing fzf." + # Make sure fzf uses fish to execute preview commands, some of which + # are autoloaded fish functions so don't exist in other shells. + # Use --function so that it doesn't clobber SHELL outside this function. + set -f --export SHELL (command --search fish) + + # If FZF_DEFAULT_OPTS is not set, then set some sane defaults. + # See https://github.com/junegunn/fzf#environment-variables + if not set --query FZF_DEFAULT_OPTS + # cycle allows jumping between the first and last results, making scrolling faster + # layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env + # border shows where the fzf window begins and ends + # height=90% leaves space to see the current command and some scrollback, maintaining context of work + # preview-window=wrap wraps long lines in the preview window, making reading easier + # marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >) + set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"' + end + + fzf $argv +end diff --git a/.config/fish/functions/fzf_configure_bindings.fish b/.config/fish/functions/fzf_configure_bindings.fish new file mode 100644 index 0000000..4b4e7a2 --- /dev/null +++ b/.config/fish/functions/fzf_configure_bindings.fish @@ -0,0 +1,46 @@ +# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect +# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1 +function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options." + # no need to install bindings if not in interactive mode or running tests + status is-interactive || test "$CI" = true; or return + + set -f options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?' + argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null + if test $status -ne 0 + echo "Invalid option or a positional argument was provided." >&2 + _fzf_configure_bindings_help + return 22 + else if set --query _flag_help + _fzf_configure_bindings_help + return + else + # Initialize with default key sequences and then override or disable them based on flags + # index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables + set -f key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape + set --query _flag_directory && set key_sequences[1] "$_flag_directory" + set --query _flag_git_log && set key_sequences[2] "$_flag_git_log" + set --query _flag_git_status && set key_sequences[3] "$_flag_git_status" + set --query _flag_history && set key_sequences[4] "$_flag_history" + set --query _flag_processes && set key_sequences[5] "$_flag_processes" + set --query _flag_variables && set key_sequences[6] "$_flag_variables" + + # If fzf bindings already exists, uninstall it first for a clean slate + if functions --query _fzf_uninstall_bindings + _fzf_uninstall_bindings + end + + for mode in default insert + test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory + test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log + test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status + test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history + test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes + test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command" + end + + function _fzf_uninstall_bindings --inherit-variable key_sequences + bind --erase -- $key_sequences + bind --erase --mode insert -- $key_sequences + end + end +end diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini index 1033d23..47e044d 100644 --- a/.config/foot/foot.ini +++ b/.config/foot/foot.ini @@ -11,8 +11,7 @@ # font=JetBrainsMono Nerd Font Mono:size=13 include=~/.cache/wal/foot.ini -font=FiraCode Nerd Font:size=13 - +font=FiraCode Nerd Font:size=11 # font=monospace:size=8 # font-bold= # font-italic= @@ -73,7 +72,6 @@ alternate-scroll-mode=yes [colors] alpha = 0.85 - # foreground = #d8dee9 # background = #2e3440 diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 65488a8..095d988 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,178 +1,211 @@ # This is an example Hyprland config file. -# # Refer to the wiki for more information. +# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ -# # Please note not all available settings / options are set here. # For a full list, see the wiki -# +# You can split this configuration into multiple files +# Create your files separately and then link them to this file like this: +# source = ~/.config/hypr/myColors.conf + + +# Monitors # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor=,1920x1080,auto,1 -# See https://wiki.hyprland.org/Configuring/Keywords/ for more -# Execute your favorite apps at launch -# exec-once = waybar & hyprpaper & firefox +# My programs +# See https://wiki.hyprland.org/Configuring/Keywords/ +$terminal = foot +$menu = wofi --style ~/.cache/wal/style-wofi.css --show drun -I -i + + +# Set programs that you use +# $terminal = kitty +# $fileManager = dolphin +# $menu = wofi --show drun + + +# AUTOSTART +# Autostart necessary processes (like notifications daemons, status bars, etc.) +# Or execute your favorite apps at launch like this: + + +exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & exec-once = light -S 40 -exec-once = $HOME/bin/start-wallpaper exec-once = waybar exec-once = dunst -config ~/.config/dunst/dunstrc -exec-once = telegram-desktop -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 & +exec-once = telegram-desktop + + +# Environment variable +# See https://wiki.hyprland.org/Configuring/Environment-variables/ + +env = XCURSOR_SIZE,24 +env = HYPRCURSOR_SIZE,24 + + +# Look and feel +# Refer to https://wiki.hyprland.org/Configuring/Variables/ + +# https://wiki.hyprland.org/Configuring/Variables/#general -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf -# source = ~/.config/wal/templates/colors-hyprland.conf source = ~/.cache/wal/colors-hyprland.conf -# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ -input { - kb_layout = us,ru,ua - kb_variant = - kb_model = - kb_options = grp:caps_toggle - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = no - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. -} - general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 2 - gaps_out = 8 - border_size = 2 - - col.active_border = $color11 - col.inactive_border = $color0 - - # col.active_border = rgb(A7c080) 45deg - # col.inactive_border = rgb(2d353b) + gaps_in = 1 + gaps_out = 1 + border_size = 2 - # layout = dwindle + # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors + col.active_border = $color11 + col.inactive_border = $color0 + # col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + # col.inactive_border = rgba(595959aa) + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false + + layout = dwindle } +# https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - rounding = 10 - blur: 3 + rounding = 7 - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) - - dim_inactive = 1 - dim_strength = 0.4 + # Change transparency of focused and unfocused windows + active_opacity = 1 + inactive_opacity = 1 + + # drop_shadow = true + # shadow_range = 4 + # shadow_render_power = 3 + # col.shadow = rgba(1a1a1aee) + + # https://wiki.hyprland.org/Configuring/Variables/#blur + # blur { + # enabled = true + # size = 3 + # passes = 1 + # + # vibrancy = 0.1696 + # } } +# https://wiki.hyprland.org/Configuring/Variables/#animations animations { - enabled = yes + enabled = true - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default } +# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this + pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # You probably want this } +# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true + new_status = master } +# https://wiki.hyprland.org/Configuring/Variables/#misc +misc { + force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( +} + + +# Input +# https://wiki.hyprland.org/Configuring/Variables/#input + +input { + kb_layout = us,ru,ua + kb_variant = + kb_model = + kb_options = grp:caps_toggle + kb_rules = + + follow_mouse = 1 + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + + touchpad { + natural_scroll = false + } +} + +# https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = off + workspace_swipe = false } # Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic mouse V1 { - sensitivity = -0.5 +# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more +device { + name = epic-mouse-v1 + sensitivity = -0.5 } -# Example windowrule v1 -# windowrule = float, ^(kitty)$ -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -windowrulev2 = float,class:^(xdg-desktop-portal-gtk)$ -windowrulev2 = move 196 127,class:^(xdg-desktop-portal-gtk)$ -windowrulev2 = size 791 667,class:^(xdg-desktop-portal-gtk)$ +# Keybindings +# See https://wiki.hyprland.org/Configuring/Keywords/ - -windowrulev2 = float,title:^(Telegram)$ -windowrulev2 = workspace 2 silent,title:^(Telegram)$ -windowrulev2 = size 641 1022,title:^(Telegram)$ -windowrulev2 = move 25 45,title:^(Telegram)$ - -windowrulev2 = workspace 1 silent,title:^(chromium-browser)$ - -$mainMod = SUPER - -bind = $mainMod SHIFT, S,exec, bin/w-screenrecord -bind = $mainMod SHIFT, b, exec, chromium-browser-stable --disable-gpu --disable-software-rasterizer - -# bindl=,switch:[switch name],exec,$HOME/bin/lockscreen - - -bind = $mainMod, C, killactive, -bind = $mainMod, X, exit, -bind = $mainMod, F, fullscreen, 2 -bind = $mainMod, S, togglefloating, -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod ALT, J, togglesplit, # dwindle +$mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -# Example volume button that allows press and hold +bind = $mainMod, RETURN, exec, $terminal +bind = $mainMod, C, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, V, togglefloating, +bind = $mainMod, F, fullscreen, 2 +bind = $mainMod, D, exec, $menu +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle + +# My utils +bind = $mainMod, N, exec, $terminal -e lf +bind = $mainMod, Shift m, exec, $terminal -e cmus +bind = $mainMod, b, exec, $terminal -e bluetuith + binde= ,F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -1% binde= ,F3, exec, pactl set-sink-volume @DEFAULT_SINK@ +1% -bind = $mainMod, b, exec, foot -e bluetuith -bind = $mainMod, RETURN, exec, foot -bind = $mainMod, N, exec, foot -e lf -bind = $mainMod, M, exec, foot -e cmus -bind = $mainMod, d, exec, wofi --style ~/.cache/wal/style-wofi.css --show drun -I i +bind = $mainMod, l, exec, lockscreen + +bind = $mainMod SHIFT, S,exec, bin/w-screenrecord bind = ,Print, exec, hyprshot -c --mode output --clipboard-only -bind = SHIFT, Print, exec, hyprshot -c --mode output -o $HOME/Pictures/screenshots --filename "$(date +"%Y-%m-%d_%H-%M-%S").png" - bind = CONTROL, Print, exec, hyprshot -c --mode region --clipboard-only -bind = CONTROL SHIFT, Print, exec, hyprshot -c --mode region -o $HOME/Pictures/screenshots --filename "$(date +"%Y-%m-%d_%H-%M-%S").png" -bind = $mainMod, Print, exec, hyprshot -c --mode window --clipboard-only +bind = SHIFT, Print, exec, hyprshot -c --mode output -o $HOME/Pictures/screenshots --filename "$(date +"%Y-%m-%d_%H-%M-%S").png" +bind = CONTROL SHIFT, Print, exec, hyprshot -c --mode region -o $HOME/Pictures/screenshots --filename "$(date +"%Y-%m-%d_%H-%M-%S").png" bind = $mainMod SHIFT, Print, exec, hyprshot -c --mode window -o $HOME/Pictures/screenshots --filename "$(date +"%Y-%m-%d_%H-%M-%S").png" +# not forget to install xdg-desktop-portal 1.14.6 +# Modify file /usr/share/xdg-desktop-portal/portals/{}.portal UserIn=sway;wlroots bind = ALT, Print, exec, flameshot-makescreenshot-to-clipboard bind = ALT SHIFT, Print, exec, flameshot-makescreenshot -# 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 # Move focus with mainMod + kjlh bind = $mainMod, k, movefocus,u @@ -180,6 +213,12 @@ bind = $mainMod, j, movefocus,d bind = $mainMod, l, movefocus,r bind = $mainMod, h, movefocus,l +# Move windows +bind = $mainMod SHIFT, k, movewindow, u +bind = $mainMod SHIFT, j, movewindow, d +bind = $mainMod SHIFT, l, movewindow, r +bind = $mainMod SHIFT, h, movewindow, l + # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 @@ -204,20 +243,33 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# Example special workspace (scratchpad) +bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod SHIFT, S, movetoworkspace, special:magic + # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 -# Move windows -bind = $mainMod SHIFT,k, movewindow, u -bind = $mainMod SHIFT,j, movewindow, d -bind = $mainMod SHIFT,l, movewindow, r -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 -} + +# Windows and workspaces +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules + +windowrulev2 = float,class:^(xdg-desktop-portal-gtk)$ +windowrulev2 = move 196 127,class:^(xdg-desktop-portal-gtk)$ +windowrulev2 = size 791 667,class:^(xdg-desktop-portal-gtk)$ + + +windowrulev2 = float,title:^(Telegram)$ +windowrulev2 = workspace 2 silent,title:^(Telegram)$ +windowrulev2 = size 644 1011,title:^(Telegram)$ +windowrulev2 = move 15 56,title:^(Telegram)$ + +windowrulev2 = workspace 1 silent,title:^(chromium-browser)$ + +# windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. diff --git a/.config/lf/lfrc b/.config/lf/lfrc index bcccc46..c2fb7f8 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -16,6 +16,18 @@ cmd edit-config ${{ lf -remote "send $id source ~/.config/lf/lfrc" }} +cmd remove ${{ + if [ -z $fs ]; then + rm -fr $f + else + IFS=':'; echo $fs | tr " " "\n" + echo 'delete? [y/n]' + read ans + + [ $ans = 'y' ] && (echo 'deleting files...' && rm -fr $fs) || (echo 'cancelled...') + fi +}} + cmd open &{{ case $(file --mime-type "$f" -bL) in text/*|application/json) lf -remote "send $id \$$EDITOR \"$fx\"";; @@ -178,6 +190,7 @@ map t map u map a map b +map d map ua unarchive @@ -203,7 +216,7 @@ map mt move-to-trash map dt delete-from-trash map tr restore-from-trash map trl trash-restore-list - +map dD $IFS=':'; rm -rf $fx map R reload diff --git a/.config/nvim/.jukit/.jukit_info.json b/.config/nvim/.jukit/.jukit_info.json new file mode 100644 index 0000000..92c7342 --- /dev/null +++ b/.config/nvim/.jukit/.jukit_info.json @@ -0,0 +1 @@ +{"terminal": "nvimterm"} \ No newline at end of file diff --git a/.config/nvim/lua/core/autocmds.lua b/.config/nvim/lua/core/autocmds.lua index 06edd4b..8bb693d 100644 --- a/.config/nvim/lua/core/autocmds.lua +++ b/.config/nvim/lua/core/autocmds.lua @@ -1,13 +1,27 @@ -vim.api.nvim_create_autocmd({"WinEnter","BufEnter"},{ - callback = function() - vim.opt.statusline = "%F" - end +vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{ + callback = function() + if vim.fn.expand("%") == "NvimTree_1" then + vim.opt.statusline = " NvimTree" + return "" + end + + local ok, statusline_output = pcall(require, "core.statusline") + if ok then + vim.opt.statusline = statusline_output + else + local ok, notify = pcall(require, "notify") + if not ok then + return + end + + print(statusline_output) + notify("Error loading status line") + end + end }) -vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{ - callback = function() - if vim.fn.expand("%") == "NvimTree_1" then - vim.opt.statusline = " NvimTree" - end - end, -}) +-- vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{ +-- callback = function() +-- +-- end, +-- }) diff --git a/.config/nvim/lua/core/keybinds.lua b/.config/nvim/lua/core/keybinds.lua index 38bfea2..4e92ef3 100644 --- a/.config/nvim/lua/core/keybinds.lua +++ b/.config/nvim/lua/core/keybinds.lua @@ -18,3 +18,11 @@ keymap('n', 'gwl', 'l') keymap("n", "bf", ":bfirst",{desc = "[G]oto first buffer"}) keymap("n", "bl", ":blast", {desc = "[G]oto last buffer"}) keymap("n", "bn", ":bnext", {desc = "[G]oto next buffer"}) + +vim.keymap.set('t', '', [[]], opts) +vim.keymap.set('t', 'jk', [[]], opts) +vim.keymap.set('t', '', [[wincmd h]], opts) +vim.keymap.set('t', '', [[wincmd j]], opts) +vim.keymap.set('t', '', [[wincmd k]], opts) +vim.keymap.set('t', '', [[wincmd l]], opts) +vim.keymap.set('t', '', [[]], opts) diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index 40fdbab..0beaf51 100644 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua @@ -7,30 +7,35 @@ end -- Setup colorscheme local ok, err = pcall(function() - - local colorscheme = "everforest" - + local colorscheme = "kanagawa-wave" if colorscheme == "nord" then - vim.g.diagnostic_sings = {"", "", "", ""} + vim.g.diagnostic_sings = {"", "", "", ""} end if colorscheme == "catppuccin-macchiato" then - vim.g.diagnostic_sings = {"", "", "", ""} + vim.g.diagnostic_sings = {"", "", "", ""} end + + vim.g.diagnostic_sings = {" ", " ", " ", " "} - if colorscheme == "everforest" then - vim.g.diagnostic_sings = {" ", " ", " ", " "} - end + -- if colorscheme == "everforest" then + -- vim.g.diagnostic_sings = {" ", " ", " ", " "} + -- end - -- vim.cmd('colorscheme catppuccin-macchiato') - -- vim.cmd('colorscheme aquarium') - opt.termguicolors = true + -- vim.cmd('colorscheme catppuccin-macchiato') + -- vim.cmd('colorscheme aquarium') + opt.termguicolors = true end) if not ok then - print(err) + print(err) end +-- vim.opt.statusline=statusline_output +-- if ok then +-- +-- end + opt.encoding = "utf-8" opt.swapfile = false opt.clipboard = "unnamedplus" @@ -43,7 +48,7 @@ vim.g.lsp_path = os.getenv("HOME") .. "/.local/share/nvim/mason/bin/" vim.g.mapleader = "," opt.list = true -opt.listchars = {tab = '| '} +opt.listchars = {multispace = "·", tab = "⬄ "} opt.splitbelow = true opt.splitright = true diff --git a/.config/nvim/lua/core/plugins.lua b/.config/nvim/lua/core/plugins.lua index 0952125..a755405 100644 --- a/.config/nvim/lua/core/plugins.lua +++ b/.config/nvim/lua/core/plugins.lua @@ -17,20 +17,17 @@ require("lazy").setup({ "lewis6991/impatient.nvim", config = function() require('impatient') end }, - - { - "neanias/everforest-nvim", + + {"rebelot/kanagawa.nvim", config = function() - vim.cmd.colorscheme "everforest" - require("everforest").setup() + vim.cmd.colorscheme"kanagawa" end - }, - - -- { "gbprod/nord.nvim" } - { "rebelot/kanagawa.nvim" }, + }, + {"neanias/everforest-nvim"}, + -- {"gbprod/nord.nvim"}, + {"catppuccin/nvim"}, -- { "ellisonleao/gruvbox.nvim" } -- { "ray-x/aurora" } - {"catppuccin/nvim"}, -- {"tiagovla/tokyodark.nvim"} -- {'Everblush/everblush.nvim'} -- {"frenzyexists/aquarium-vim"} @@ -59,34 +56,10 @@ require("lazy").setup({ opts = {}, }, - { - "lewis6991/gitsigns.nvim", - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - } - }, + { "lewis6991/gitsigns.nvim", opts = {} }, { "windwp/nvim-autopairs", opts = {} }, - -- { - -- "lukas-reineke/indent-blankline.nvim", - -- main = "ibl", - -- opts = { - -- -- indent = { highlight = {"CursorColumn", "Whitespace"}}, - -- -- whitespace = { - -- -- highlight = highlight, - -- -- remove_blankline_trail = false, - -- -- }, - -- -- scope = { enabled = false }, - -- } - -- }, - { "numToStr/Comment.nvim", opts = {} @@ -130,7 +103,7 @@ require("lazy").setup({ require("mason").setup() end }, - + { "hrsh7th/nvim-cmp", -- load cmp on InsertEnter @@ -157,36 +130,22 @@ require("lazy").setup({ preset = 'codicons', symbol_map = { - Text = "󰉿", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "", - }, + Text = "󰦨 ", Method = "󰅲 ", Function = "󰊕 ", Constructor = " ", Field = " ", + Variable = "󰫧 ", Class = "󰠱 ", Interface = " ", Module = " ", Property = " ", + Unit = " ", Value = "󰎠 ", Enum = " ", Keyword = "󰌋 ", Snippet = " ", + Color = "󰏘 ", File = "󰈙 ", Reference = "", Folder = "󰉋", EnumMember = " ", + Constant = "󰏿 ", Struct = " ", Event = " ", Operator = "󰆕 ", TypeParameter = " ", + } } end }, + { + 'akinsho/toggleterm.nvim', + version = "*", + config = true + }, + { "folke/which-key.nvim", opts = {}, lazy = true, @@ -197,6 +156,16 @@ require("lazy").setup({ end }, + { + 'quarto-dev/quarto-nvim', + 'jmbuhr/otter.nvim', + config = function() + local quarto = require"quarto" + quarto.setup() + vim.keymap.set('n', 'pq', quarto.quartoPreview, { silent = true, noremap = true }) + end + }, + { "L3MON4D3/LuaSnip", dependencies = {"rafamadriz/friendly-snippets"}, diff --git a/.config/nvim/lua/core/statusline.lua b/.config/nvim/lua/core/statusline.lua index 8b13789..418764d 100644 --- a/.config/nvim/lua/core/statusline.lua +++ b/.config/nvim/lua/core/statusline.lua @@ -1 +1,48 @@ +Statusline = {} +local modes = { + ["n"] = "NORMAL", + ["no"] = "NORMAL", + ["v"] = "VISUAL", + ["V"] = "VISUAL LINE", + [""] = "VISUAL BLOCK", + ["s"] = "SELECT", + ["S"] = "SELECT LINE", + [""] = "SELECT BLOCK", + ["i"] = "INSERT", + ["ic"] = "INSERT", + ["R"] = "REPLACE", + ["Rv"] = "VISUAL REPLACE", + ["c"] = "COMMAND", + ["cv"] = "VIM EX", + ["ce"] = "EX", + ["r"] = "PROMPT", + ["rm"] = "MOAR", + ["r?"] = "CONFIRM", + ["!"] = "SHELL", + ["t"] = "TERMINAL", +} +local function mode() + local current_mode = vim.api.nvim_get_mode().mode + return string.format(" %s ", modes[current_mode]):upper() +end + +local function filepath() + local fpath = vim.fn.fnamemodify(vim.fn.expand "%", ":~:.:h") + if fpath == "" or fpath == "." then + return " " + end + + return string.format(" %%<%s/", fpath) +end + +local function filename() + local fname = vim.fn.expand "%:t" + if fname == "" then + return "" + end + return fname .. " " +end + +statusline = mode() .. " " .. "%F" +return statusline diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua index d521abb..6fc9836 100644 --- a/.config/nvim/lua/lsp/init.lua +++ b/.config/nvim/lua/lsp/init.lua @@ -52,6 +52,7 @@ vim.g.lsp_on_attach = function(client, bufnr) end nmap('gd', vim.lsp.buf.definition, "[G]oto [D]efinition") + nmap("f", vim.lsp.buf.format(), "Format current buffer") nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') diff --git a/.config/nvim/lua/lsp/servers/pylsp.lua b/.config/nvim/lua/lsp/servers/pylsp.lua index cd0e347..55ddb35 100644 --- a/.config/nvim/lua/lsp/servers/pylsp.lua +++ b/.config/nvim/lua/lsp/servers/pylsp.lua @@ -8,6 +8,7 @@ return { settings = { pylsp = { + plugins = { pycodestyle = { ignore = {'W391','W293',"E128","E124"}, diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua index b7e1a98..2f977d3 100644 --- a/.config/nvim/lua/plugins/dap.lua +++ b/.config/nvim/lua/plugins/dap.lua @@ -10,10 +10,10 @@ keymap("n", "", dap.continue) keymap("n", "", dap.step_over) keymap("n", "", dap.step_into) keymap("n", "", dap.step_out) -keymap("n", "b", dap.toggle_breakpoint) -keymap("n", "B", function() - dap.set_breakpoint{vim.fn.input("Breakpoint condition: ")} -end) +-- keymap("n", "b", dap.toggle_breakpoint) +-- keymap("n", "B", function() +-- dap.set_breakpoint{vim.fn.input("Breakpoint condition: ")} +-- end) keymap("n", "lp", function() dap.set_breakpoint{nil, nil, vim.fn.input('Log point message: ')} end) diff --git a/.config/nvim/lua/plugins/snippets/c.lua b/.config/nvim/lua/plugins/snippets/c.lua index 7c1945e..92b2e3f 100644 --- a/.config/nvim/lua/plugins/snippets/c.lua +++ b/.config/nvim/lua/plugins/snippets/c.lua @@ -1,7 +1,7 @@ local ok, ls = pcall(require,"luasnip") if not ok then - vim.notify("Failed load luasnip\n") - return + vim.notify("Failed load luasnip\n") + return end local s = ls.s @@ -17,19 +17,19 @@ return { } -- ls.add_snippets("lua", { --- s( --- "reqm", --- fmt( --- [[ --- local ok, {} = pcall(require,"{}") --- if not ok then --- vim.notify("Failed load {}\n") --- end --- ]], { --- i(1, "mod"), --- i(2), --- rep(2), --- } --- ) --- ) +-- s( +-- "reqm", +-- fmt( +-- [[ +-- local ok, {} = pcall(require,"{}") +-- if not ok then +-- vim.notify("Failed load {}\n") +-- end +-- ]], { +-- i(1, "mod"), +-- i(2), +-- rep(2), +-- } +-- ) +-- ) -- }) diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index b403eb1..d30ae79 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -5,63 +5,78 @@ if not ok then end nvim_treesitter_configs.setup { - highlight = { - enable = true, - disable = {}, - }, - indent = { - enable = false, - disable = {}, - }, + highlight = { + enable = true, + disable = {}, + }, + indent = { + enable = false, + disable = {}, + }, - textobjects = { - select = { - enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - } - }, - move = { - enable = true, - set_jumps = true, - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer' - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer' - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer' - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer' - } - } - }, + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" }, + ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" }, + ["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" }, + ["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" }, - ensure_installed = { - "lua", - "fish", - "python", - "go", - "javascript", - "css", - "html", - "c", - "cpp" + -- works for javascript/typescript files (custom captures I created in after/queries/ecma/textobjects.scm) + ["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" }, + ["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" }, + ["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" }, + ["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" }, + + ["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" }, + ["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" }, + + ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" }, + ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" }, + + ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" }, + ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" }, + + ["af"] = { query = "@call.outer", desc = "Select outer part of a function call" }, + ["if"] = { query = "@call.inner", desc = "Select inner part of a function call" }, + + ["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" }, + ["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" }, + + ["ac"] = { query = "@class.outer", desc = "Select outer part of a class" }, + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class" }, + + ["a/"] = { query = "@comment.outer", desc = "Select outer part of a comment" }, + ["i/"] = { query = "@comment.inner", desc = "Select inner part of a comment" }, + } }, + move = { + enable = true, + set_jumps = true, + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer' + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer' + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer' + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer' + } + } + }, + + ensure_installed = {"lua","go","python","html","css","javascript","c","cpp","fish"}, } local parser_config = require "nvim-treesitter.parsers".get_parser_configs() diff --git a/.config/waybar/colors.css b/.config/waybar/colors.css index d7afecb..7e36b2f 100644 --- a/.config/waybar/colors.css +++ b/.config/waybar/colors.css @@ -1,9 +1,9 @@ @define-color bg #2d353b; /* @define-color white #e5e9f0; */ -@define-color fg #d3c6aa; +@define-color fg #d3c6aa; @define-color black #3b4252; @define-color red #e67e80; @define-color blue #7fbbb3; @define-color green #a7c080; -@define-color yellow #dbbc7f; -@define-color orange #e69875; +@define-color yellow #dbbc7f; +@define-color orange #e69875; diff --git a/.config/waybar/config b/.config/waybar/config index 6e08d21..fc07e7d 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -2,9 +2,9 @@ "layer": "top", // Waybar at top layer "position": "top", - "height": 39, + "height": 47, "width": 1895, - "spacing": 3, + "spacing": 5, "modules-left": ["hyprland/window", "pulseaudio","tray"], "modules-center": ["hyprland/workspaces"], diff --git a/.config/waybar/openweathermap-simple.sh b/.config/waybar/openweathermap-simple.sh old mode 100644 new mode 100755 index 4f5d77b..abb1731 --- a/.config/waybar/openweathermap-simple.sh +++ b/.config/waybar/openweathermap-simple.sh @@ -42,7 +42,7 @@ get_icon() { } KEY="e434b5435a979de6e155570590bee89b" -CITY="Novosibirsk" +CITY="Yuzhnoukrainsk" UNITS="metric" SYMBOL="°" diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 6c69b1c..87092ba 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,25 +1,25 @@ * { /* `otf-font-awesome` is required to be installed for icons */ font-family: FontAwesome, JetBrainsMono, sans-serif; - font-size: 13px; + font-size: 14px; } @import "./colors.css"; window#waybar { background-color: rgba(43, 48, 59, 0.0); - color: @fg; + color: @fg; transition-property: background-color; transition-duration: .5s; padding: 0; margin: 0; } -.modules-left > widget:first-child > #workspaces { +.modules-left>widget:first-child>#workspaces { margin-left: 0; } -.modules-right > widget:last-child > #workspaces { +.modules-right>widget:last-child>#workspaces { margin-right: 0; } @@ -87,11 +87,11 @@ button:focus { border-radius: 10px; } -#tray > .passive { +#tray>.passive { -gtk-icon-effect: dim; } -#tray > .needs-attention { +#tray>.needs-attention { -gtk-icon-effect: highlight; } @@ -144,7 +144,7 @@ label:focus { } #custom-language { - background-color: @bg; + background-color: @bg; padding: 0 15px 0 15px; margin: 5px 0 5px 0; border-radius: 8px; @@ -152,14 +152,14 @@ label:focus { #pulseaudio { - background-color: @bg; + background-color: @bg; padding: 0 15px 0 15px; margin: 5px 0 5px 0; border-radius: 8px; } #bluetooth { - background-color: @bg; + background-color: @bg; padding: 0 15px 0 15px; margin: 5px 0 5px 0; border-radius: 8px; @@ -168,20 +168,21 @@ label:focus { #battery { padding: 0 15px 0 15px; margin: 5px 0 5px 0; - border-radius: 8px; - color: @green; - background: @bg; + border-radius: 8px; + color: @green; + background: @bg; } -#battery.charging, #battery.plugged { - color: @green; +#battery.charging, +#battery.plugged { + color: @green; background-color: @bg; } #battery.warning:not(.charging) { background-color: @bg; color: @orange; -} +} #battery.critical:not(.charging) { background-color: @barkground; diff --git a/Pictures/wallpapers/Anime/00016.png b/Pictures/wallpapers/Anime/00016.png new file mode 100644 index 0000000..02932e3 Binary files /dev/null and b/Pictures/wallpapers/Anime/00016.png differ diff --git a/Pictures/wallpapers/Anime/00033.png b/Pictures/wallpapers/Anime/00033.png new file mode 100644 index 0000000..502d89f Binary files /dev/null and b/Pictures/wallpapers/Anime/00033.png differ diff --git a/Pictures/wallpapers/Anime/00067.png b/Pictures/wallpapers/Anime/00067.png new file mode 100644 index 0000000..a246a2b Binary files /dev/null and b/Pictures/wallpapers/Anime/00067.png differ diff --git a/Pictures/wallpapers/Anime/00092.png b/Pictures/wallpapers/Anime/00092.png new file mode 100644 index 0000000..5f33942 Binary files /dev/null and b/Pictures/wallpapers/Anime/00092.png differ diff --git a/Pictures/wallpapers/Anime/00108.png b/Pictures/wallpapers/Anime/00108.png new file mode 100644 index 0000000..fa1566f Binary files /dev/null and b/Pictures/wallpapers/Anime/00108.png differ diff --git a/Pictures/wallpapers/Anime/00111.png b/Pictures/wallpapers/Anime/00111.png new file mode 100644 index 0000000..f332e65 Binary files /dev/null and b/Pictures/wallpapers/Anime/00111.png differ diff --git a/Pictures/wallpapers/Anime/00138.png b/Pictures/wallpapers/Anime/00138.png new file mode 100644 index 0000000..8e9fd46 Binary files /dev/null and b/Pictures/wallpapers/Anime/00138.png differ diff --git a/Pictures/wallpapers/Anime/00140.png b/Pictures/wallpapers/Anime/00140.png new file mode 100644 index 0000000..189067e Binary files /dev/null and b/Pictures/wallpapers/Anime/00140.png differ diff --git a/Pictures/wallpapers/Anime/00146.png b/Pictures/wallpapers/Anime/00146.png new file mode 100644 index 0000000..2a21953 Binary files /dev/null and b/Pictures/wallpapers/Anime/00146.png differ diff --git a/Pictures/wallpapers/Anime/00149.png b/Pictures/wallpapers/Anime/00149.png new file mode 100644 index 0000000..d713268 Binary files /dev/null and b/Pictures/wallpapers/Anime/00149.png differ diff --git a/Pictures/wallpapers/Anime/00178.png b/Pictures/wallpapers/Anime/00178.png new file mode 100644 index 0000000..a43b6b5 Binary files /dev/null and b/Pictures/wallpapers/Anime/00178.png differ diff --git a/Pictures/wallpapers/Anime/00179.png b/Pictures/wallpapers/Anime/00179.png new file mode 100644 index 0000000..ddc42a1 Binary files /dev/null and b/Pictures/wallpapers/Anime/00179.png differ diff --git a/Pictures/wallpapers/Anime/00180.png b/Pictures/wallpapers/Anime/00180.png new file mode 100644 index 0000000..fd40269 Binary files /dev/null and b/Pictures/wallpapers/Anime/00180.png differ diff --git a/Pictures/wallpapers/Anime/00183.png b/Pictures/wallpapers/Anime/00183.png new file mode 100644 index 0000000..5c6ee64 Binary files /dev/null and b/Pictures/wallpapers/Anime/00183.png differ diff --git a/Pictures/wallpapers/Anime/00226.jpg b/Pictures/wallpapers/Anime/00226.jpg new file mode 100644 index 0000000..ae16232 Binary files /dev/null and b/Pictures/wallpapers/Anime/00226.jpg differ diff --git a/Pictures/wallpapers/Anime/00248.png b/Pictures/wallpapers/Anime/00248.png new file mode 100644 index 0000000..562e977 Binary files /dev/null and b/Pictures/wallpapers/Anime/00248.png differ diff --git a/Pictures/wallpapers/Anime/00294.png b/Pictures/wallpapers/Anime/00294.png new file mode 100644 index 0000000..b7ef808 Binary files /dev/null and b/Pictures/wallpapers/Anime/00294.png differ diff --git a/Pictures/wallpapers/Anime/00320.jpg b/Pictures/wallpapers/Anime/00320.jpg new file mode 100644 index 0000000..47c8cf1 Binary files /dev/null and b/Pictures/wallpapers/Anime/00320.jpg differ diff --git a/Pictures/wallpapers/Anime/00332.jpg b/Pictures/wallpapers/Anime/00332.jpg new file mode 100644 index 0000000..484b4a2 Binary files /dev/null and b/Pictures/wallpapers/Anime/00332.jpg differ diff --git a/Pictures/wallpapers/Anime/00333.jpg b/Pictures/wallpapers/Anime/00333.jpg new file mode 100644 index 0000000..74daf0b Binary files /dev/null and b/Pictures/wallpapers/Anime/00333.jpg differ diff --git a/Pictures/wallpapers/Anime/00335.jpg b/Pictures/wallpapers/Anime/00335.jpg new file mode 100644 index 0000000..32a8c00 Binary files /dev/null and b/Pictures/wallpapers/Anime/00335.jpg differ diff --git a/Pictures/wallpapers/Anime/00360.jpg b/Pictures/wallpapers/Anime/00360.jpg new file mode 100644 index 0000000..4ce4896 Binary files /dev/null and b/Pictures/wallpapers/Anime/00360.jpg differ diff --git a/Pictures/wallpapers/Anime/00367.png b/Pictures/wallpapers/Anime/00367.png new file mode 100644 index 0000000..161dbe2 Binary files /dev/null and b/Pictures/wallpapers/Anime/00367.png differ diff --git a/Pictures/wallpapers/Anime/00370.jpg b/Pictures/wallpapers/Anime/00370.jpg new file mode 100644 index 0000000..73ad88d Binary files /dev/null and b/Pictures/wallpapers/Anime/00370.jpg differ diff --git a/Pictures/wallpapers/Anime/154ov.png b/Pictures/wallpapers/Anime/154ov.png new file mode 100644 index 0000000..1c32de7 Binary files /dev/null and b/Pictures/wallpapers/Anime/154ov.png differ diff --git a/Pictures/wallpapers/Anime/43262-nisekoi-nisekoi.jpg b/Pictures/wallpapers/Anime/43262-nisekoi-nisekoi.jpg new file mode 100644 index 0000000..fc8a0df Binary files /dev/null and b/Pictures/wallpapers/Anime/43262-nisekoi-nisekoi.jpg differ diff --git a/Pictures/wallpapers/Anime/cat-girl-II.jpg b/Pictures/wallpapers/Anime/cat-girl-II.jpg deleted file mode 100644 index 6be5dce..0000000 Binary files a/Pictures/wallpapers/Anime/cat-girl-II.jpg and /dev/null differ diff --git a/Pictures/wallpapers/Anime/danny-and-the-franks-2.jpg b/Pictures/wallpapers/Anime/danny-and-the-franks-2.jpg deleted file mode 100644 index fae99fc..0000000 Binary files a/Pictures/wallpapers/Anime/danny-and-the-franks-2.jpg and /dev/null differ diff --git a/Pictures/wallpapers/Anime/image_2024-01-13_23-08-09.png b/Pictures/wallpapers/Anime/image_2024-01-13_23-08-09.png new file mode 100644 index 0000000..0c14e6a Binary files /dev/null and b/Pictures/wallpapers/Anime/image_2024-01-13_23-08-09.png differ diff --git a/Pictures/wallpapers/Anime/plastic_memories___isla_by_krukmeister-d8ylwbc.png b/Pictures/wallpapers/Anime/plastic_memories___isla_by_krukmeister-d8ylwbc.png new file mode 100644 index 0000000..09e68ca Binary files /dev/null and b/Pictures/wallpapers/Anime/plastic_memories___isla_by_krukmeister-d8ylwbc.png differ diff --git a/Pictures/wallpapers/Anime/reach-for-the-stars-girl.jpg b/Pictures/wallpapers/Anime/reach-for-the-stars-girl.jpg deleted file mode 100644 index 51f5816..0000000 Binary files a/Pictures/wallpapers/Anime/reach-for-the-stars-girl.jpg and /dev/null differ diff --git a/Pictures/wallpapers/Anime/some-girl.jpg b/Pictures/wallpapers/Anime/some-girl.jpg deleted file mode 100644 index 0d6fcc2..0000000 Binary files a/Pictures/wallpapers/Anime/some-girl.jpg and /dev/null differ diff --git a/Pictures/wallpapers/Anime/stretched-1920-1080-203113.jpg b/Pictures/wallpapers/Anime/stretched-1920-1080-203113.jpg new file mode 100644 index 0000000..ff3c315 Binary files /dev/null and b/Pictures/wallpapers/Anime/stretched-1920-1080-203113.jpg differ diff --git a/Pictures/wallpapers/Anime/stretched-1920-1080-328130.jpg b/Pictures/wallpapers/Anime/stretched-1920-1080-328130.jpg new file mode 100644 index 0000000..d37af83 Binary files /dev/null and b/Pictures/wallpapers/Anime/stretched-1920-1080-328130.jpg differ diff --git a/Pictures/wallpapers/Anime/stretched-1920-1080-657895.png b/Pictures/wallpapers/Anime/stretched-1920-1080-657895.png new file mode 100644 index 0000000..5a0cf56 Binary files /dev/null and b/Pictures/wallpapers/Anime/stretched-1920-1080-657895.png differ diff --git a/Pictures/wallpapers/Anime/stretched-1920-1080-956383.jpg b/Pictures/wallpapers/Anime/stretched-1920-1080-956383.jpg new file mode 100644 index 0000000..57d39cf Binary files /dev/null and b/Pictures/wallpapers/Anime/stretched-1920-1080-956383.jpg differ diff --git a/Pictures/wallpapers/Anime/stretched-1920-1080-972409.jpg b/Pictures/wallpapers/Anime/stretched-1920-1080-972409.jpg new file mode 100644 index 0000000..1cf72c1 Binary files /dev/null and b/Pictures/wallpapers/Anime/stretched-1920-1080-972409.jpg differ diff --git a/Pictures/wallpapers/Catppuccin/premonition.jpg b/Pictures/wallpapers/Catppuccin/premonition.jpg deleted file mode 100644 index 6ecbc44..0000000 Binary files a/Pictures/wallpapers/Catppuccin/premonition.jpg and /dev/null differ diff --git a/Pictures/wallpapers/Nature/agung-pratamah-1430085-unsplash.jpg b/Pictures/wallpapers/Nature/agung-pratamah-1430085-unsplash.jpg new file mode 100644 index 0000000..b39e12c Binary files /dev/null and b/Pictures/wallpapers/Nature/agung-pratamah-1430085-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/arnaud-steckle-1401766-unsplash.jpg b/Pictures/wallpapers/Nature/arnaud-steckle-1401766-unsplash.jpg new file mode 100644 index 0000000..34cef88 Binary files /dev/null and b/Pictures/wallpapers/Nature/arnaud-steckle-1401766-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/forest_stream_landscape_165405_1920x1080.jpg b/Pictures/wallpapers/Nature/forest_stream_landscape_165405_1920x1080.jpg new file mode 100644 index 0000000..a90a345 Binary files /dev/null and b/Pictures/wallpapers/Nature/forest_stream_landscape_165405_1920x1080.jpg differ diff --git a/Pictures/wallpapers/Nature/hoodh-ahmed-1325762-unsplash.jpg b/Pictures/wallpapers/Nature/hoodh-ahmed-1325762-unsplash.jpg new file mode 100644 index 0000000..5a6f2c0 Binary files /dev/null and b/Pictures/wallpapers/Nature/hoodh-ahmed-1325762-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/hoodh-ahmed-1349469-unsplash.jpg b/Pictures/wallpapers/Nature/hoodh-ahmed-1349469-unsplash.jpg new file mode 100644 index 0000000..f71e1f3 Binary files /dev/null and b/Pictures/wallpapers/Nature/hoodh-ahmed-1349469-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/ivan-bandura-1584479-unsplash.jpg b/Pictures/wallpapers/Nature/ivan-bandura-1584479-unsplash.jpg new file mode 100644 index 0000000..dfc0264 Binary files /dev/null and b/Pictures/wallpapers/Nature/ivan-bandura-1584479-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/jakub-gorajek-1542744-unsplash.jpg b/Pictures/wallpapers/Nature/jakub-gorajek-1542744-unsplash.jpg new file mode 100644 index 0000000..3cafafc Binary files /dev/null and b/Pictures/wallpapers/Nature/jakub-gorajek-1542744-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/maria-duda-1583436-unsplash.jpg b/Pictures/wallpapers/Nature/maria-duda-1583436-unsplash.jpg new file mode 100644 index 0000000..c7a7b03 Binary files /dev/null and b/Pictures/wallpapers/Nature/maria-duda-1583436-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/marius-badstuber-1578567-unsplash.jpg b/Pictures/wallpapers/Nature/marius-badstuber-1578567-unsplash.jpg new file mode 100644 index 0000000..c71d400 Binary files /dev/null and b/Pictures/wallpapers/Nature/marius-badstuber-1578567-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/mike-erskine-98419-unsplash.jpg b/Pictures/wallpapers/Nature/mike-erskine-98419-unsplash.jpg new file mode 100644 index 0000000..c182a18 Binary files /dev/null and b/Pictures/wallpapers/Nature/mike-erskine-98419-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/oliver-ash-1279413-unsplash.jpg b/Pictures/wallpapers/Nature/oliver-ash-1279413-unsplash.jpg new file mode 100644 index 0000000..551161e Binary files /dev/null and b/Pictures/wallpapers/Nature/oliver-ash-1279413-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/piano_silhouette_space_156662_1920x1080.jpg b/Pictures/wallpapers/Nature/piano_silhouette_space_156662_1920x1080.jpg new file mode 100644 index 0000000..9f781b1 Binary files /dev/null and b/Pictures/wallpapers/Nature/piano_silhouette_space_156662_1920x1080.jpg differ diff --git a/Pictures/wallpapers/Nature/ren-ran-232079-unsplash.jpg b/Pictures/wallpapers/Nature/ren-ran-232079-unsplash.jpg new file mode 100644 index 0000000..146ed4f Binary files /dev/null and b/Pictures/wallpapers/Nature/ren-ran-232079-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/renemari-padillo-1463252-unsplash.jpg b/Pictures/wallpapers/Nature/renemari-padillo-1463252-unsplash.jpg new file mode 100644 index 0000000..536d85e Binary files /dev/null and b/Pictures/wallpapers/Nature/renemari-padillo-1463252-unsplash.jpg differ diff --git a/Pictures/wallpapers/Nature/turn_trees_rocks_119734_1920x1080.jpg b/Pictures/wallpapers/Nature/turn_trees_rocks_119734_1920x1080.jpg new file mode 100644 index 0000000..284acd3 Binary files /dev/null and b/Pictures/wallpapers/Nature/turn_trees_rocks_119734_1920x1080.jpg differ diff --git a/Pictures/wallpapers/Nature/waterfall_stream_forest_138760_1920x1080.jpg b/Pictures/wallpapers/Nature/waterfall_stream_forest_138760_1920x1080.jpg new file mode 100644 index 0000000..4681da6 Binary files /dev/null and b/Pictures/wallpapers/Nature/waterfall_stream_forest_138760_1920x1080.jpg differ diff --git a/Pictures/wallpapers/Nature/will-turner-1315729-unsplash.jpg b/Pictures/wallpapers/Nature/will-turner-1315729-unsplash.jpg new file mode 100644 index 0000000..d8f57dc Binary files /dev/null and b/Pictures/wallpapers/Nature/will-turner-1315729-unsplash.jpg differ