commit 5eae1ef498813a333359cd8f8b08549a6b32cbac Author: candle Date: Mon Mar 9 00:07:31 2026 -0400 update diff --git a/.config/candle b/.config/candle new file mode 100644 index 0000000..2e55859 --- /dev/null +++ b/.config/candle @@ -0,0 +1,28 @@ +              ...                        +          ...........                    +        .......'.......                  +       .....'',,,,''....                 +      ....'',;;;;;;,'....                +      ....',;::x::;,;'...                +      ...'',;:d0o:;:,'....               +      ....',;:XXK:;,,;...                +       ...',,kKK0d,,'....                +       .....'dkOkl''....                 +         .....lol......                  +       XNNNNNWXkXWWW,                    +       KWNNNNNNONNNNNNNc                 +       ONNNNNNNNNNNNNNN,                 +      cNNXNNNNXNNXXXXN;                  +      dNXNNNNNXXXNNNNX'                  +        cNNNNNXXXNNNNX,                  +        :NNNNNXXXNNNNXW'                 +        ,NNNNXXXXNNNNXN                  +        'NNNNXNNXNNNNk                   +        .NWNNNXXXNNNNk       .N0OxxOx    +    dNXKKNWWWNNNNNNNNKkO0Xd kK.     d0.  + kkooxO00NWWWWNNNNNNNXlc;'';ld       xd  + ,:ldk0koOXNNNNNNNNXKOlc:,'...       ol  +    'l:cldxk0KKXKK0kxdlc;'          dx;  +       .;:ldxO0K0Okdl:;'        .WKxo.   +        ldxk0KNWNK0kxdoKXXNWWN0kd        +        'lxOKXNWNXKOxl'                  diff --git a/.config/fastfetch/big.jsonc b/.config/fastfetch/big.jsonc new file mode 100644 index 0000000..2550c37 --- /dev/null +++ b/.config/fastfetch/big.jsonc @@ -0,0 +1,69 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "separator": "  ", + "constants": [ + "────────────────────────" // {$1}, used in Custom module + ], + "key": { + "type": "icon", + "paddingLeft": 2 + } + }, + "modules": [ + { + "type": "colors", + "symbol": "circle", + "paddingLeft": 23, + }, + { + "type": "custom", // HardwareStart + // {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m` + "format": "┌{$1} {#1}Hardware{#} {$1}┐" + }, + "host", + "cpu", + "gpu", + "disk", + "memory", + "display", + "brightness", + "battery", + "poweradapter", + "bluetooth", + "sound", + "gamepad", + { + "type": "custom", // SoftwareStart + "format": "├{$1} {#1}Software{#} {$1}┤" + }, + { + "type": "title", + "keyIcon": "", + "key": "Title", // Title module has no key by default, so that icon is not displayed + "format": "{user-name}@{host-name}" + }, + "os", + "kernel", + "lm", + "de", + "wm", + "shell", + "terminal", + "terminalfont", + "theme", + "icons", + "wallpaper", + "packages", + "uptime", + { + "type": "custom", // InformationEnd + "format": "└{$1}──────────{$1}┘" + }, + { + "type": "colors", + "symbol": "circle", + "paddingLeft": 23, + } + ] +} diff --git a/.config/fastfetch/small.jsonc b/.config/fastfetch/small.jsonc new file mode 100644 index 0000000..912ab7f --- /dev/null +++ b/.config/fastfetch/small.jsonc @@ -0,0 +1,77 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "small" + }, + "display": { + "separator": "  ", + "color": { + "keys": "white" + }, + "size": { + "ndigits": 1, + "maxPrefix": "GB" + }, + "key": { + "type": "icon" + }, + "bar": { + "charelapsed": "=", + "chartotal": "-", + "width": 14 + }, + "percent": { + "type": 2 + } + }, + "modules": [ + { + "type": "title", + "color": { + "user": "green", + "at": "red", + "host": "blue" + } + }, + { + "type": "os", + "keyIcon": "╭─󰗢", + "keyColor": "blue" + }, + // { + // "type": "kernel", + // "keyIcon": "├─", + // "keyColor": "blue" + // }, + { + "type": "memory", + "keyIcon": "├─", + "keyColor": "blue" + }, + { + "type": "packages", + "keyIcon": "├─󰏖", + "keyColor": "red" + }, + { + "type": "uptime", + "keyIcon": "├─", + "keyColor": "red" + }, + { + "keyIcon": "Weather", + "keyType": "string", + "keyColor": "green", + "type": "command", + "keyIcon": "├─${CONDITION}", + "text": "cat /tmp/wttr.in | tail -n +2 | xargs", + "paddingLeft": -1 + }, + { + "type": "colors", + "key": "Colors", // For printing icon + "keyIcon": "╰─", + "symbol": "circle" + } + ] +} diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..9551f9a --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,33 @@ +if status is-interactive + # Commands to run in interactive sessions can go here + # /bin/cat /home/$USER/.cache/wal/sequences + if test $fish_pid = (pgrep fish | sed -n '2p') + if test -e /tmp/small.jsonc + fastfetch -c /tmp/small.jsonc + else + fastfetch -c $XDG_CONFIG_HOME/fastfetch/small.jsonc + end + motd + end + function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if read -z cwd <"$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" + end + source /usr/share/wikiman/widgets/widget.fish + set --erase FZF_DEFAULT_OPTS + set -Ux FZF_DEFAULT_OPTS (cat $XDG_CACHE_HOME/wal/colors-fzf) --preview \'fzfp {}\' --bind \'enter:execute\(open \{\}\)\' + fzf_key_bindings + abbr -a !! --position anywhere --function last_history_item + abbr -a dotdot --regex '^\.\.+$' --function multicd + abbr -a cr cargo run +end + +set -Ux FZF_DEFAULT_COMMAND 'fd --type f --strip-cwd-prefix --follow' + +# fish_add_path /home/candle/.spicetify + +zoxide init --cmd cd fish | source diff --git a/.config/fish/functions/cat.fish b/.config/fish/functions/cat.fish new file mode 100644 index 0000000..07d2248 --- /dev/null +++ b/.config/fish/functions/cat.fish @@ -0,0 +1,4 @@ +function cat --wraps=bat --wraps=catbat --description 'alias cat bat' + bat $argv + +end diff --git a/.config/fish/functions/cleanpackages.fish b/.config/fish/functions/cleanpackages.fish new file mode 100644 index 0000000..474226b --- /dev/null +++ b/.config/fish/functions/cleanpackages.fish @@ -0,0 +1,4 @@ +function cleanpackages --wraps='pacman -Qqdt | sudo pacman -Rns -' --description 'alias cleanpackages pacman -Qqdt | sudo pacman -Rns -' + pacman -Qqdt | sudo pacman -Rns - $argv + +end diff --git a/.config/fish/functions/dotfiles.fish b/.config/fish/functions/dotfiles.fish new file mode 100644 index 0000000..66d1bc0 --- /dev/null +++ b/.config/fish/functions/dotfiles.fish @@ -0,0 +1,3 @@ +function dotfiles --wraps='/usr/bin/git --git-dir=/home/candle/.dotfiles/ --work-tree=/home/candle' --description 'alias dotfiles /usr/bin/git --git-dir=/home/candle/.dotfiles/ --work-tree=/home/candle' + /usr/bin/git --git-dir=/home/candle/.dotfiles/ --work-tree=/home/candle $argv +end diff --git a/.config/fish/functions/ff.fish b/.config/fish/functions/ff.fish new file mode 100644 index 0000000..c628de7 --- /dev/null +++ b/.config/fish/functions/ff.fish @@ -0,0 +1,4 @@ +function ff --wraps='fastfetch -c /home/candle/.config/fastfetch/big.jsonc --logo /home/candle/.config/candle' --description 'alias ff fastfetch --logo /home/candle/.config/candle' + fastfetch -c /home/candle/.config/fastfetch/big.jsonc --logo /home/candle/.config/candle $argv + +end diff --git a/.config/fish/functions/fish_mode_prompt.fish b/.config/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..f37cf7d --- /dev/null +++ b/.config/fish/functions/fish_mode_prompt.fish @@ -0,0 +1 @@ +# Disable default vi prompt diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..3b58b7b --- /dev/null +++ b/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,171 @@ +function fish_prompt +end # In case this file gets loaded non-interactively, e.g by conda +status is-interactive || exit + +_tide_remove_unusable_items +_tide_cache_variables +_tide_parent_dirs +source (functions --details _tide_pwd) + +set -l prompt_var _tide_prompt_$fish_pid +set -U $prompt_var # Set var here so if we erase $prompt_var, bg job won't set a uvar + +set_color normal | read -l color_normal +status fish-path | read -l fish_path + +# _tide_repaint prevents us from creating a second background job +function _tide_refresh_prompt --on-variable $prompt_var --on-variable COLUMNS + set -g _tide_repaint + commandline -f repaint +end + +if contains newline $_tide_left_items # two line prompt initialization + test "$tide_prompt_add_newline_before" = true && set -l add_newline '\n' + + set_color $tide_prompt_color_frame_and_connection -b normal | read -l prompt_and_frame_color + + set -l column_offset 5 + test "$tide_left_prompt_frame_enabled" = true && + set -l top_left_frame "$prompt_and_frame_color╭─" && + set -l bot_left_frame "$prompt_and_frame_color╰─" && + set column_offset (math $column_offset-2) + test "$tide_right_prompt_frame_enabled" = true && + set -l top_right_frame "$prompt_and_frame_color─╮" && + set -l bot_right_frame "$prompt_and_frame_color─╯" && + set column_offset (math $column_offset-2) + + if test "$tide_prompt_transient_enabled" = true + eval " +function fish_prompt + _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint + jobs -q && jobs -p | count | read -lx _tide_jobs + $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus +set _tide_parent_dirs \$_tide_parent_dirs +PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" & + builtin disown + + command kill \$_tide_last_pid 2>/dev/null + set -g _tide_last_pid \$last_pid + end + + if not set -q _tide_transient + math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][3]\")+$column_offset | read -lx dist_btwn_sides + + echo -n $add_newline'$top_left_frame'(string replace @PWD@ (_tide_pwd) \"\$$prompt_var[1][1]\")'$prompt_and_frame_color' + string repeat -Nm(math max 0, \$dist_btwn_sides-\$_tide_pwd_len) '$tide_prompt_icon_connection' + + echo \"\$$prompt_var[1][3]$top_right_frame\" + end + echo -n \e\[0J\"$bot_left_frame\$$prompt_var[1][2]$color_normal \" +end + +function fish_right_prompt + set -e _tide_transient || string unescape \"\$$prompt_var[1][4]$bot_right_frame$color_normal\" +end" + else + eval " +function fish_prompt + _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint + jobs -q && jobs -p | count | read -lx _tide_jobs + $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus +set _tide_parent_dirs \$_tide_parent_dirs +PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" & + builtin disown + + command kill \$_tide_last_pid 2>/dev/null + set -g _tide_last_pid \$last_pid + end + + math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][3]\")+$column_offset | read -lx dist_btwn_sides + + echo -ns $add_newline'$top_left_frame'(string replace @PWD@ (_tide_pwd) \"\$$prompt_var[1][1]\")'$prompt_and_frame_color' + string repeat -Nm(math max 0, \$dist_btwn_sides-\$_tide_pwd_len) '$tide_prompt_icon_connection' + echo -ns \"\$$prompt_var[1][3]$top_right_frame\"\n\"$bot_left_frame\$$prompt_var[1][2]$color_normal \" +end + +function fish_right_prompt + string unescape \"\$$prompt_var[1][4]$bot_right_frame$color_normal\" +end" + end +else # one line prompt initialization + test "$tide_prompt_add_newline_before" = true && set -l add_newline '\0' + + math 5 -$tide_prompt_min_cols | read -l column_offset + test $column_offset -ge 0 && set column_offset "+$column_offset" + + if test "$tide_prompt_transient_enabled" = true + eval " +function fish_prompt + set -lx _tide_status \$status + _tide_pipestatus=\$pipestatus if not set -e _tide_repaint + jobs -q && jobs -p | count | read -lx _tide_jobs + $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus +set _tide_parent_dirs \$_tide_parent_dirs +PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" & + builtin disown + + command kill \$_tide_last_pid 2>/dev/null + set -g _tide_last_pid \$last_pid + end + + if set -q _tide_transient + echo -n \e\[0J + add_prefix= _tide_item_character + echo -n '$color_normal ' + else + math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][2]\")$column_offset | read -lx dist_btwn_sides + string replace @PWD@ (_tide_pwd) $add_newline \$$prompt_var[1][1]'$color_normal ' + end +end + +function fish_right_prompt + set -e _tide_transient || string unescape \"\$$prompt_var[1][2]$color_normal\" +end" + else + eval " +function fish_prompt + _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint + jobs -q && jobs -p | count | read -lx _tide_jobs + $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus +set _tide_parent_dirs \$_tide_parent_dirs +PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" & + builtin disown + + command kill \$_tide_last_pid 2>/dev/null + set -g _tide_last_pid \$last_pid + end + + math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][2]\")$column_offset | read -lx dist_btwn_sides + string replace @PWD@ (_tide_pwd) $add_newline \$$prompt_var[1][1]'$color_normal ' +end + +function fish_right_prompt + string unescape \"\$$prompt_var[1][2]$color_normal\" +end" + end +end + +eval "function _tide_on_fish_exit --on-event fish_exit + set -e $prompt_var +end" + +if test "$tide_prompt_transient_enabled" = true + function _tide_enter_transient + # If the commandline will be executed, or is empty + if commandline --is-valid || test -z "$(commandline)" + # Pager open usually means selecting, not running + # Can be untrue, but it's better than the alternative + if not commandline --paging-mode + set -g _tide_transient + set -g _tide_repaint + commandline -f repaint + end + end + commandline -f execute + end + + bind \r _tide_enter_transient + bind \n _tide_enter_transient + bind -M insert \r _tide_enter_transient + bind -M insert \n _tide_enter_transient +end diff --git a/.config/fish/functions/fuck.fish b/.config/fish/functions/fuck.fish new file mode 100644 index 0000000..503c618 --- /dev/null +++ b/.config/fish/functions/fuck.fish @@ -0,0 +1,9 @@ +function fuck -d "Correct your previous console command" + set -l fucked_up_command $history[1] + env TF_SHELL=fish TF_ALIAS=fuck PYTHONIOENCODING=utf-8 thefuck $fucked_up_command THEFUCK_ARGUMENT_PLACEHOLDER $argv | read -l unfucked_command + if [ "$unfucked_command" != "" ] + eval $unfucked_command + builtin history delete --exact --case-sensitive -- $fucked_up_command + builtin history merge + end +end diff --git a/.config/fish/functions/fzf_key_bindings.fish b/.config/fish/functions/fzf_key_bindings.fish new file mode 100644 index 0000000..1a53536 --- /dev/null +++ b/.config/fish/functions/fzf_key_bindings.fish @@ -0,0 +1,232 @@ +### key-bindings.fish ### +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.fish +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + +# Key bindings +# ------------ +# The oldest supported fish version is 3.1b1. To maintain compatibility, the +# command substitution syntax $(cmd) should never be used, even behind a version +# check, otherwise the source command will fail on fish versions older than 3.4.0. +function fzf_key_bindings + + # Check fish version + set -l fish_ver (string match -r '^(\d+).(\d+)' $version 2> /dev/null; or echo 0\n0\n0) + if test \( "$fish_ver[2]" -lt 3 \) -o \( "$fish_ver[2]" -eq 3 -a "$fish_ver[3]" -lt 1 \) + echo "This script requires fish version 3.1b1 or newer." >&2 + return 1 + else if not type -q fzf + echo "fzf was not found in path." >&2 + return 1 + end + + function __fzf_defaults + # $argv[1]: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS + # $argv[2..]: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS + test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% + string join ' ' -- \ + "--height $FZF_TMUX_HEIGHT --min-height=20+ --bind=ctrl-z:ignore" $argv[1] \ + (test -r "$FZF_DEFAULT_OPTS_FILE"; and string join -- ' ' <$FZF_DEFAULT_OPTS_FILE) \ + $FZF_DEFAULT_OPTS $argv[2..-1] + end + + function __fzfcmd + test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% + if test -n "$FZF_TMUX_OPTS" + echo "fzf-tmux $FZF_TMUX_OPTS -- " + else if test "$FZF_TMUX" = 1 + echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " + else + echo fzf + end + end + + function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix' + set -l fzf_query '' + set -l prefix '' + set -l dir '.' + + # Set variables containing the major and minor fish version numbers, using + # a method compatible with all supported fish versions. + set -l -- fish_major (string match -r -- '^\d+' $version) + set -l -- fish_minor (string match -r -- '^\d+\.(\d+)' $version)[2] + + # fish v3.3.0 and newer: Don't use option prefix if " -- " is preceded. + set -l -- match_regex '(?[\s\S]*?(?=\n?$)$)' + set -l -- prefix_regex '^-[^\s=]+=|^-(?!-)\S' + if test "$fish_major" -eq 3 -a "$fish_minor" -lt 3 + or string match -q -v -- '* -- *' (string sub -l (commandline -Cp) -- (commandline -p)) + set -- match_regex "(?$prefix_regex)?$match_regex" + end + + # Set $prefix and expanded $fzf_query with preserved trailing newlines. + if test "$fish_major" -ge 4 + # fish v4.0.0 and newer + string match -q -r -- $match_regex (commandline --current-token --tokens-expanded | string collect -N) + else if test "$fish_major" -eq 3 -a "$fish_minor" -ge 2 + # fish v3.2.0 - v3.7.1 (last v3) + string match -q -r -- $match_regex (commandline --current-token --tokenize | string collect -N) + eval set -- fzf_query (string escape -n -- $fzf_query | string replace -r -a '^\\\(?=~)|\\\(?=\$\w)' '') + else + # fish older than v3.2.0 (v3.1b1 - v3.1.2) + set -l -- cl_token (commandline --current-token --tokenize | string collect -N) + set -- prefix (string match -r -- $prefix_regex $cl_token) + set -- fzf_query (string replace -- "$prefix" '' $cl_token | string collect -N) + eval set -- fzf_query (string escape -n -- $fzf_query | string replace -r -a '^\\\(?=~)|\\\(?=\$\w)|\\\n\\\n$' '') + end + + if test -n "$fzf_query" + # Normalize path in $fzf_query, set $dir to the longest existing directory. + if test \( "$fish_major" -ge 4 \) -o \( "$fish_major" -eq 3 -a "$fish_minor" -ge 5 \) + # fish v3.5.0 and newer + set -- fzf_query (path normalize -- $fzf_query) + set -- dir $fzf_query + while not path is -d $dir + set -- dir (path dirname $dir) + end + else + # fish older than v3.5.0 (v3.1b1 - v3.4.1) + if test "$fish_major" -eq 3 -a "$fish_minor" -ge 2 + # fish v3.2.0 - v3.4.1 + string match -q -r -- '(?^[\s\S]*?(?=\n?$)$)' \ + (string replace -r -a -- '(?<=/)/|(?[\s\S]*)' $fzf_query + else if test "$fish_major" -eq 3 -a "$fish_minor" -ge 2 + # fish v3.2.0 - v3.7.1 (last v3) + string match -q -r -- '^/?(?[\s\S]*?(?=\n?$)$)' \ + (string replace -- "$dir" '' $fzf_query | string collect -N) + else + # fish older than v3.2.0 (v3.1b1 - v3.1.2) + set -- fzf_query (string replace -- "$dir" '' $fzf_query | string collect -N) + eval set -- fzf_query (string escape -n -- $fzf_query | string replace -r -a '^/?|\\\n$' '') + end + end + end + + string escape -n -- "$dir" "$fzf_query" "$prefix" + end + + # Store current token in $dir as root for the 'find' command + function fzf-file-widget -d "List files and folders" + set -l commandline (__fzf_parse_commandline) + set -lx dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + set -lx FZF_DEFAULT_OPTS (__fzf_defaults \ + "--reverse --walker=file,dir,follow,hidden --scheme=path" \ + "$FZF_CTRL_T_OPTS --multi --print0") + + set -lx FZF_DEFAULT_COMMAND "$FZF_CTRL_T_COMMAND" + set -lx FZF_DEFAULT_OPTS_FILE + + set -l result (eval (__fzfcmd) --walker-root=$dir --query=$fzf_query | string split0) + and commandline -rt -- (string join -- ' ' $prefix(string escape -- $result))' ' + + commandline -f repaint + end + + function fzf-history-widget -d "Show command history" + set -l -- command_line (commandline) + set -l -- current_line (commandline -L) + set -l -- total_lines (count $command_line) + set -l -- fzf_query (string escape -- $command_line[$current_line]) + + set -lx FZF_DEFAULT_OPTS (__fzf_defaults '' \ + '--nth=2..,.. --scheme=history --multi --wrap-sign="\t↳ "' \ + '--bind=\'shift-delete:execute-silent(eval history delete --exact --case-sensitive -- (string escape -n -- {+} | string replace -r -a "^\d*\\\\\\t|(?<=\\\\\\n)\\\\\\t" ""))+reload(eval $FZF_DEFAULT_COMMAND)\'' \ + "--bind=ctrl-r:toggle-sort --highlight-line $FZF_CTRL_R_OPTS" \ + '--accept-nth=2.. --read0 --print0 --with-shell='(status fish-path)\\ -c) + + set -lx FZF_DEFAULT_OPTS_FILE + set -lx FZF_DEFAULT_COMMAND + + if type -q perl + set -a FZF_DEFAULT_OPTS --tac + set FZF_DEFAULT_COMMAND 'builtin history -z --reverse | command perl -0 -pe \'s/^/$.\t/g; s/\n/\n\t/gm\'' + else + set FZF_DEFAULT_COMMAND \ + 'set -l h (builtin history -z --reverse | string split0);' \ + 'for i in (seq (count $h) -1 1);' \ + 'string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect);' \ + end + end + + # Merge history from other sessions before searching + test -z "$fish_private_mode"; and builtin history merge + + if set -l result (eval $FZF_DEFAULT_COMMAND \| (__fzfcmd) --query=$fzf_query | string split0) + if test "$total_lines" -eq 1 + commandline -- (string replace -a -- \n\t \n $result) + else + set -l a (math $current_line - 1) + set -l b (math $current_line + 1) + commandline -- $command_line[1..$a] (string replace -a -- \n\t \n $result) + commandline -a -- '' $command_line[$b..-1] + end + end + + commandline -f repaint + end + + function fzf-cd-widget -d "Change directory" + set -l commandline (__fzf_parse_commandline) + set -lx dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + set -lx FZF_DEFAULT_OPTS (__fzf_defaults \ + "--reverse --walker=dir,follow,hidden --scheme=path" \ + "$FZF_ALT_C_OPTS --no-multi --print0") + + set -lx FZF_DEFAULT_OPTS_FILE + set -lx FZF_DEFAULT_COMMAND "$FZF_ALT_C_COMMAND" + + if set -l result (eval (__fzfcmd) --query=$fzf_query --walker-root=$dir | string split0) + cd -- $result + commandline -rt -- $prefix + end + + commandline -f repaint + end + + bind \cr fzf-history-widget + bind -M insert \cr fzf-history-widget + + if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND" + bind \ct fzf-file-widget + bind -M insert \ct fzf-file-widget + end + + if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND" + bind \ec fzf-cd-widget + bind -M insert \ec fzf-cd-widget + end + +end +### end: key-bindings.fish ### +fzf_key_bindings diff --git a/.config/fish/functions/icat.fish b/.config/fish/functions/icat.fish new file mode 100644 index 0000000..77d4922 --- /dev/null +++ b/.config/fish/functions/icat.fish @@ -0,0 +1,4 @@ +function icat --description 'alias icat kitty +kitten icat' + kitty +kitten icat $argv + +end diff --git a/.config/fish/functions/last_history_item.fish b/.config/fish/functions/last_history_item.fish new file mode 100644 index 0000000..c3e43ae --- /dev/null +++ b/.config/fish/functions/last_history_item.fish @@ -0,0 +1,3 @@ +function last_history_item + echo $history[1] +end diff --git a/.config/fish/functions/logs.fish b/.config/fish/functions/logs.fish new file mode 100644 index 0000000..1e6252e --- /dev/null +++ b/.config/fish/functions/logs.fish @@ -0,0 +1,4 @@ +function logs --wraps='journalctl --since today | bat --color=always --language=log --paging auto --style=numbers,grid -' --description 'alias logs journalctl --since today | bat --color=always --language=log --paging auto --style=numbers,grid -' + journalctl --since today | bat --color=always --language=log --paging auto --style=numbers,grid - $argv + +end diff --git a/.config/fish/functions/ls.fish b/.config/fish/functions/ls.fish new file mode 100644 index 0000000..31d1675 --- /dev/null +++ b/.config/fish/functions/ls.fish @@ -0,0 +1,4 @@ +function ls --wraps='eza --color=always --time-style=relative --no-user --no-permissions --no-quotes --long --icons=auto' --description 'List Files' + eza --color=always --time-style=relative --no-user --no-permissions --no-quotes --long --icons=auto $argv + +end diff --git a/.config/fish/functions/lsa.fish b/.config/fish/functions/lsa.fish new file mode 100644 index 0000000..f974641 --- /dev/null +++ b/.config/fish/functions/lsa.fish @@ -0,0 +1,4 @@ +function lsa --wraps='eza --color=always --time-style=default --no-quotes --long --icons=auto' --description 'alias lsa eza --color=always --time-style=default --no-quotes --long --icons=auto' + eza --color=always --time-style=default --no-quotes --long --icons=auto $argv + +end diff --git a/.config/fish/functions/lsl.fish b/.config/fish/functions/lsl.fish new file mode 100644 index 0000000..b7c1a0c --- /dev/null +++ b/.config/fish/functions/lsl.fish @@ -0,0 +1,4 @@ +function lsl --wraps='eza --color=always --time-style=relative --no-user --no-permissions --no-quotes' --description 'List Files Block' + eza --color=always --time-style=relative --no-user --no-permissions --no-quotes $argv + +end diff --git a/.config/fish/functions/multicd.fish b/.config/fish/functions/multicd.fish new file mode 100644 index 0000000..35cab8e --- /dev/null +++ b/.config/fish/functions/multicd.fish @@ -0,0 +1,3 @@ +function multicd + echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../) +end diff --git a/.config/fish/functions/packages.fish b/.config/fish/functions/packages.fish new file mode 100644 index 0000000..1f9b729 --- /dev/null +++ b/.config/fish/functions/packages.fish @@ -0,0 +1,4 @@ +function packages --wraps="yay -Slq | fzf --preview 'yay -Si {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(yay -S {})+accept'" --description "alias packages yay -Slq | fzf --preview 'yay -Si {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(yay -S {})+accept'" + yay -Slq | fzf --preview 'yay -Si {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(yay -S {})+accept' $argv + +end diff --git a/.config/fish/functions/pacls.fish b/.config/fish/functions/pacls.fish new file mode 100644 index 0000000..ae09d73 --- /dev/null +++ b/.config/fish/functions/pacls.fish @@ -0,0 +1,4 @@ +function pacls --wraps="pacman -Qqe | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept'" --description "alias pacls pacman -Qqe | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept'" + pacman -Qqe | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept' $argv + +end diff --git a/.config/fish/functions/paclsa.fish b/.config/fish/functions/paclsa.fish new file mode 100644 index 0000000..99bdc45 --- /dev/null +++ b/.config/fish/functions/paclsa.fish @@ -0,0 +1,4 @@ +function paclsa --wraps="pacman -Qq | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept'" --description "alias paclsa pacman -Qq | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept'" + pacman -Qq | fzf --preview 'pacman -Qil {} | bat --color=always --language=yaml --style=grid --plain' --layout=reverse --bind 'enter:execute(printf %s {} | wl-copy && pacman -Qil {} | bat --color=always --language=yaml --style=grid,numbers)+accept' $argv + +end diff --git a/.config/fish/functions/refreshmirrors.fish b/.config/fish/functions/refreshmirrors.fish new file mode 100644 index 0000000..b527bcb --- /dev/null +++ b/.config/fish/functions/refreshmirrors.fish @@ -0,0 +1,4 @@ +function refreshmirrors --wraps='sudo reflector -c US -a 12 --sort rate --save /etc/pacman.d/mirrorlist' --description 'alias refreshmirrors reflector -c US -a 12 --sort rate --save /etc/pacman.d/mirrorlist' + sudo reflector -c US -a 12 --sort rate --save /etc/pacman.d/mirrorlist $argv + +end diff --git a/.config/fish/functions/rm.fish b/.config/fish/functions/rm.fish new file mode 100644 index 0000000..e210a71 --- /dev/null +++ b/.config/fish/functions/rm.fish @@ -0,0 +1,4 @@ +function rm --wraps=trash-put --description 'alias rm trash-put' + trash-put $argv + +end diff --git a/.config/fish/functions/tp.fish b/.config/fish/functions/tp.fish new file mode 100644 index 0000000..c47ddbe --- /dev/null +++ b/.config/fish/functions/tp.fish @@ -0,0 +1,4 @@ +function tp --wraps=trash-put --description 'alias tp trash-put' + trash-put $argv + +end diff --git a/.config/fish/functions/wget.fish b/.config/fish/functions/wget.fish new file mode 100644 index 0000000..05fa615 --- /dev/null +++ b/.config/fish/functions/wget.fish @@ -0,0 +1,4 @@ +function wget --description 'alias wget wget --hsts-file="$XDG_DATA_HOME/wget-hsts"' + command wget --hsts-file="$XDG_DATA_HOME/wget-hsts" $argv + +end diff --git a/.config/fish/functions/yazi.fish b/.config/fish/functions/yazi.fish new file mode 100644 index 0000000..a846c63 --- /dev/null +++ b/.config/fish/functions/yazi.fish @@ -0,0 +1,8 @@ +function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if read -z cwd <"$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end diff --git a/.config/helix/config.toml b/.config/helix/config.toml new file mode 100644 index 0000000..d1e62a3 --- /dev/null +++ b/.config/helix/config.toml @@ -0,0 +1,14 @@ +theme = "base16_default" + +[editor.cursor-shape] +insert = "bar" +normal = "block" +select = "underline" + +[keys.normal] +C-s = ":w" +"ret" = ["open_below", "normal_mode"] +# "C-S-C" = ":clipboard-yank" + +[editor] +bufferline = "multiple" diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml new file mode 100644 index 0000000..9acf7da --- /dev/null +++ b/.config/helix/languages.toml @@ -0,0 +1,26 @@ +# See: +# https://docs.helix-editor.com/master/languages.html +# https://github.com/helix-editor/helix/blob/master/languages.toml + + +# rust +[[language]] +name = "rust" +auto-format = true + +[language-server.rust-analyzer] +command = "rust-analyzer" + +[language-server.rust-analyzer.config.check] +command = "clippy" + +# cpp +[[language]] +name = "cpp" + +[language-server.clangd] +command = "clangd" +args = ["--compile-commands-dir", ".cmake"] + +[[language]] +name = "python" diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..3f0b8d4 --- /dev/null +++ b/.config/hypr/hyprland.conf @@ -0,0 +1,462 @@ +# ======== +# ======== +# !!MONITORS!! # +# --------------------------------------------------------------------------------- # +# !!MONITORS!! # +# run `hyprctl monitors all` to see all your monitors!!! +source = $XDG_CACHE_HOME/wal/colors-hyprland +source = $XDG_CONFIG_HOME/hypr/monitors.conf +source = $XDG_CONFIG_HOME/hypr/wallpaper.conf + +exec-once = systemd-timer-notify & +exec-once = [workspace special:magic silent] discord + +$fileManager = thunar +$menu = rofi -combi-modi window,drun -show combi -show-icons -theme-str 'window {width: 15%; height: 42%;}' +$browser = rofi -show file-browser-extended -show-icons -theme-str 'window {width: 20%; height: 32%;}' +# $emoji = rofi -modi "emoji:rofimoji" -show emoji -theme-str 'window {width: 20%; height: 12%;}' +# $calc = rofi -show calc -no-show-match -no-sort -theme-str 'window {width: 20%; height: 10%;}' +$screenshot = slurp | grim -g - - | wl-copy +$scripts = $XDG_CONFIG_HOME/hypr/scripts +$power = $scripts/power.sh +$notes = $scripts/notes.sh +$move = $scripts/move.sh +$actions = $scripts/actions.sh +# $picker = hyprpicker -a 2>/dev/null +$notifications = swaync-client -t + +# Environment variables +env = ELECTRON_OZONE_PLATFORM_HINT,auto +env = XCURSOR_SIZE,24 +env = XCURSOR_THEME,Posy_Cursor +env = HYPRCURSOR_SIZE,24 +env = HYPRCURSOR_THEME,Posy_Cursor + + +$swpw_name = `(echo -n '90' && (hyprctl activeworkspace -j | jq -r '.name')) | sed 's/9090//g' | tr -d '\n'` +$special_workspace_per_workspace = hyprctl dispatch workspace $swpw_name +$move_to_special_workspace_per_workspace = hyprctl dispatch movetoworkspace $swpw_name + +# Special Workspace per Workspace bindings + +# !!INPUT!! # +# --------------------------------------------------------------------------------- # +# !!INPUT!! # +render = {direct_scanout=1} +# READ https://wiki.hyprland.org/Configuring/Variables/#input IF CONFUSED! +# Example keyboard/mouse input settings. +input { + kb_layout = us + + # Set as needed + kb_rules = + kb_variant = + kb_model = + accel_profile = flat + follow_mouse = 1 + force_no_accel = true + + # Range is -1.0 to 1.0 | 0 means no modification to sensitivity. + sensitivity = 0 + + touchpad { + natural_scroll = false + } +} + +cursor { + no_hardware_cursors = true +} + + +# !!DESIGN!! # +# --------------------------------------------------------------------------------- # +# !!DESIGN!! # + +animations { + enabled = true + + bezier = myBezier, 0, 1, 0.18, 1.0 + + animation = windows, 1, 1.5, myBezier + animation = windowsOut, 1, 2, myBezier, popin 95% + animation = border, 1, 12, myBezier + animation = borderangle, 1, 5, default + animation = fade, 1, 6, default + animation = workspaces, 1, 6, default +} + +# The gaps between windows, as well as border colors. +# proportional to the taskbar values. +general { + # Inner and Outer gaps between windows. + gaps_in = 5 + gaps_out = 20 14 20 20 + + # I prefer a thin border + border_size = 2 + + # Border colors. + col.active_border = $color0 + col.inactive_border = $color1 + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = true + + layout = dwindle + + # READ https://wiki.hyprland.org/Configuring/Tearing/ BEFORE TURNING ON! + allow_tearing = false +} + +# Window Decorations! Shadow, Blur, etc. +decoration { + rounding = 12 + + active_opacity = 1 + inactive_opacity = 1 + + # Window Shadow + shadow:enabled = true + shadow:range = 16 + shadow:render_power = 5 + shadow:color = rgba(0,0,0,0.35) + + # Transparent Window Blur + blur{ + enabled = true + size = 2 + passes = 3 + vibrancy = 0.1696 + } +} + +# Read https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more info on dwindle layout. +dwindle { + pseudotile = true + preserve_split = true +} + +# Read https://wiki.hyprland.org/Configuring/Master-Layout/ for more info on master layout. +master { + new_status = master +} + +misc { + force_default_wallpaper = 0 + disable_hyprland_logo = true + enable_anr_dialog = false +} + +# No need for gestures unless you have a touch display. +gestures { +} + +# !!KEYBINDS!! # +# --------------------------------------------------------------------------------- # +# !!KEYBINDS!! # +$mainMod = SUPER + +bind = $mainMod Shift, L, exit +bind = $mainMod, Return, exec, $TERMINAL +bind = $mainMod, Q, killactive, +bind = $mainMod, G, exec, $screenshot +bind = $mainMod SHIFT, E, exec, $fileManager +bind = $mainMod, V, togglefloating +bind = $mainMod, F, fullscreen +bind = $mainMod, P, pseudo +bind = $mainMod, T, togglesplit +bindr = $mainMod, Tab, exec, pkill rofi || $menu +# bindr = $mainMod Shift, P, exec, pkill hyprpicker || $picker +# bindr = $mainMod Shift, C, exec, pkill rofi || $calc +bindr = $mainMod Shift, T, exec, pkill rofi || $toggles +bindr = $mainMod Shift, R, exec, pkill rofi || $power +bindr = $mainMod, E, exec, pkill rofi || $browser +bindr = $mainMod, N, exec, pkill rofi || $notes +# bindr = $mainMod Shift, M, exec, pkill rofi || $emoji + +bindr = $mainMod Shift, Y, exec, pkill rofi || $scripts/runner +bindr = $mainMod, D, exec, pkill rofi || $actions + +bindr = $mainMod Shift, W, exec, $move +bindr = $mainMod, W, exec, $move --same + +bind = $mainMod, M, exec, pkill rmpc || kitty +kitten panel --edge center --layer overlay --focus-policy on-demand --margin-top 60 --margin-bottom 800 --margin-right 1200 --margin-left 22 rmpc + +bind = $mainMod Shift, N, exec, $notifications + +bind = $mainMod, A, exec, $special_workspace_per_workspace +bind = $mainMod SHIFT, A, exec, $move_to_special_workspace_per_workspace + +# Switch current workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move a focused window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d +bind = $mainMod, h, movefocus, l +bind = $mainMod, j, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, l, movefocus, d + +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 and Resize windows with mainMod + LMB/RMB and dragging, drag on edges to resize. +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Laptop multimedia keys for volume and LCD brightness +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ +bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- + +# !!WINDOW RULES!! # +# --------------------------------------------------------------------------------- # +# !!WINDOW RULES!! # +# Read https://wiki.hyprland.org/Configuring/Window-Rules/ for more info +# Read https://wiki.hyprland.org/Configuring/Workspace-Rules/ for more info + +layerrule { + name = layerrule-1 + blur = on + match:namespace = rofi +} + +layerrule { + name = layerrule-2 + ignore_alpha = 0.01 + match:namespace = rofi # This is so entirely transparent things aren't blurred. +} + + +# Add blur to waybar, for same reason as above. Since we have two versions +# of the waybar design, one with translucency. +layerrule { + name = layerrule-3 + blur = on + blur_popups = on + match:namespace = waybar +} + +layerrule { + name = layerrule-4 + ignore_alpha = 1.0 + match:namespace = waybar # this is so entirely transparent things aren't blurred. +} + + +# Add blur to eww widgets +layerrule { + name = layerrule-5 + blur = on + blur_popups = on + ignore_alpha = 0.01 + match:namespace = eww +} + +# Fix dragging issues with XWayland +windowrule { + name = windowrule-1 + no_focus = on + match:class = ^$ + match:title = ^$ + match:xwayland = 1 + match:float = 1 + match:fullscreen = 0 + match:pin = 0 +} + + +# -------------CUSTOMIZE BELOW------------------------ + +# Discord +windowrule { + name = windowrule-2 + float = on + size = 1200 800 + move = (200) (100) + workspace = special:magic + no_screen_share = on + match:class = ^(discord)$ +} + + +# File manager + archiver +windowrule { + name = windowrule-3 + float = on + center = on + size = 971 670 + opacity = 0.8 0.7 + match:class = .*(?i)(thunar)$ +} + +windowrule { + name = windowrule-4 + float = on + center = on + size = 971 670 + opacity = 0.8 0.7 + match:class = ^(xarchiver)$ +} + +windowrule { + name = windowrule-5 + float = on + center = on + size = 568 138 + match:title = ^(File\ Operation\ Progress)$ +} + +windowrule { + name = windowrule-6 + float = on + center = on + size = 971 670 + opacity = 0.8 0.7 + match:title = ^(Open.*)$ +} + + +# XDG Portal +windowrule { + name = windowrule-7 + float = on + center = on + size = 971 670 + opacity = 0.8 0.7 + match:class = ^(xdg-desktop-portal-gtk)$ +} + + +# Runelite +windowrule { + name = windowrule-8 + float = on + match:title = ^(RuneLite)$ +} + + +# Notes dmenu app +windowrule { + name = windowrule-9 + float = on + center = on + size = (monitor_w*0.2) (monitor_h*0.25) + opacity = 0.8 0.7 + match:class = ^(notes)$ +} + + +# Opacity rules +windowrule { + name = windowrule-10 + opacity = 0.8 0.7 + match:class = ^(kitty)$ +} + +windowrule { + name = windowrule-11 + opacity = 0.8 0.7 + match:class = ^(steam)$ +} + + +windowrule { + name = windowrule-12 + opacity = 0.8 0.7 + match:class = ^(PrismLauncher)$ +} + + +windowrule { + name = windowrule-13 + float = on + match:class = ^(steam)$ + match:title = ^(Friends\ List)$ +} + + +windowrule { + name = windowrule-14 + float = on + opacity = 0.8 0.7 + match:class = ^(io.lampnet.*)$ +} + + +windowrule { + name = windowrule-15 + float = on + size = 1496 790 + match:title = ^(System Update)$ +} + + +windowrule { + name = windowrule-16 + float = on + match:class = ^(mpv)$ +} + +windowrule { + name = windowrule-17 + float = on + match:class = ^(feh)$ +} + + +windowrule { + name = windowrule-18 + border_size = 0 + no_blur = on + no_shadow = on + match:class = ^(DeskPet)$ +} + +windowrule { + name = windowrule-19 + float = on + move = 2240 54 + match:title = ^(Photo\ Gallery)$ +} + +windowrule { + name = windowrule-20 + float = on + move = 2240 54 + match:title = ^(Music\ Controller)$ + # no_blur = on + # no_shadow = on +} diff --git a/.config/hypr/monitors.conf b/.config/hypr/monitors.conf new file mode 100644 index 0000000..8071463 --- /dev/null +++ b/.config/hypr/monitors.conf @@ -0,0 +1,2 @@ +monitor=DP-1, 2560x1440@144, 0x0, 1 +monitor=DP-3, 1920x1080@144, -1920x150, 1 diff --git a/.config/hypr/scripts/actions.sh b/.config/hypr/scripts/actions.sh new file mode 100755 index 0000000..6e0802c --- /dev/null +++ b/.config/hypr/scripts/actions.sh @@ -0,0 +1,257 @@ +#!/usr/bin/env bash + +set -euo pipefail +SCRIPT=$(basename "$0") + +BASE_LAUNCHER=('rofi' '-theme-str' 'window {width: 20%;}' '-c' '-dmenu' '-i') + +UPDATE_COMMAND="yay -Syu" + +CURRENT_THEME=$(wpg -c) +THEME_LIST=$(wpg -l) # | grep -v "$CURRENT_THEME") + +log() { + logger -i -t "$SCRIPT" "$*" +} + +show_main_menu() { + local options="Services\nSystem\nTools\nPassword" + echo -e "$options" | "${BASE_LAUNCHER[@]}" -l "$(echo -e "$options" | wc -l)" -p "Menu:" +} + +show_system_menu() { + local options="Update\nRefresh Mirrors\nPurge Cache" + echo -e "$options" | "${BASE_LAUNCHER[@]}" -l "$(echo -e "$options" | wc -l)" -p "System:" +} + +show_tools_menu() { + local options="Calculator\nClipboard\nColor Picker\nScreenshot\nSymbols\nTheme" + echo -e "$options" | "${BASE_LAUNCHER[@]}" -l "$(echo -e "$options" | wc -l)" -p "Tools:" +} + +show_screenshot_menu() { + local options="Fullscreen\nSelection" + echo -e "$options" | "${BASE_LAUNCHER[@]}" -l "$(echo -e "$options" | wc -l)" -p "Screenshot:" +} + +handle_update() { + local update_script="$UPDATE_COMMAND && echo 'Update completed successfully!' || { echo 'Update failed! Press any key to close...'; read -n 1; }" + $TERMINAL --title "System Update" -e bash -c "$update_script" +} + +handle_refresh_mirrors() { + local mirror_script="sudo /usr/bin/reflector -c US -a 12 --sort rate --save /etc/pacman.d/mirrorlist && echo 'Mirrors refreshed successfully!' || { echo 'Mirror refresh failed! Press any key to close...'; read -n 1; }" + $TERMINAL --title "Refresh Mirrors" -e bash -c "$mirror_script" +} + +handle_purge_cache() { + local purge_script="systemctl start paccache.service && systemctl start yaycache.service && localepurge && echo 'Cache purged successfully!' || { echo 'Cache purge failed! Press any key to close...'; read -n 1; }" + $TERMINAL --title "Purge Cache" -e bash -c "$purge_script" +} + +handle_calculator() { + rofi -show calc -no-show-match -no-sort -i -theme-str 'window {width: 20%; height: 10%;}' +} + +handle_clipboard() { + clipcat-menu +} + +handle_colorpicker() { + sleep 0.5 + hyprpicker 2>/dev/null | wl-copy +} + +handle_screenshot() { + local screenshot_type + screenshot_type=$(show_screenshot_menu) + + case "$screenshot_type" in + "Fullscreen") + sleep 0.5 + local filename="$(date +%Y%m%d-%H%M%S).png" + local current_monitor + current_monitor=$(hyprctl cursorpos -j | jq -r '. as $cursor | hyprctl monitors -j | .[] | select(.x <= $cursor.x and $cursor.x < (.x + .width) and .y <= $cursor.y and $cursor.y < (.y + .height)) | .name' 2>/dev/null || hyprctl monitors -j | jq -r '.[0].name') + grim -o "$current_monitor" "$HOME/Pictures/Screenshots/$filename" + wl-copy < "$HOME/Pictures/Screenshots/$filename" + notify-send "Saved $filename" + ;; + "Selection") + sleep 0.5 + local filename="$(date +%Y%m%d-%H%M%S).png" + if slurp | grim -g - "$HOME/Pictures/Screenshots/$filename"; then + wl-copy < "$HOME/Pictures/Screenshots/$filename" + notify-send "Saved $filename" + else + return 0 + fi + ;; + "") + return 0 + ;; + *) + return 1 + ;; + esac +} + +handle_symbols() { + rofi -modi "emoji:rofimoji" -show emoji -i -theme-str 'window {width: 20%; height: 12%;}' +} + +handle_passwords() { + passwordmenu +} + +handle_theme() { + if [[ -z "$THEME_LIST" ]]; then + log "No themes available" + return 1 + fi + MONITORS=$(hyprctl monitors -j | jq -r '.[].name') + local monitor1 + monitor1=$(echo "$MONITORS" | head -n 1) + local monitor2 + monitor2=$(echo "$MONITORS" | tail -n 1) + local wallpaper_mode + wallpaper_mode=$(echo -e "Single\nDual" | "${BASE_LAUNCHER[@]}" -l 2 -p "Wallpaper:") + + if [[ -z "$wallpaper_mode" ]]; then + return 0 + fi + + local theme_count + theme_count=$(echo "$THEME_LIST" | wc -l) + + local selected_theme + selected_theme=$(echo "$THEME_LIST" | "${BASE_LAUNCHER[@]}" -l "$theme_count" -p "$CURRENT_THEME:") + + if [[ -n "$selected_theme" && "$selected_theme" != "$CURRENT_THEME" ]]; then + if [[ "$wallpaper_mode" == "Dual" ]]; then + local second_wallpaper + second_wallpaper=$(echo "$THEME_LIST" | "${BASE_LAUNCHER[@]}" -l "$theme_count" -p "Second Wallpaper:") + + if [[ -z "$second_wallpaper" ]]; then + return 0 + fi + + wpg -s "$selected_theme" -n || { + log "Failed to set theme: $selected_theme" + return 1 + } + + local wallpaper_conf="$XDG_CONFIG_HOME/hypr/wallpaper.conf" + sed -i "s|exec-once = swaybg -o $monitor1.*|exec-once = swaybg -o $monitor1 -m fill -i \$XDG_CONFIG_HOME/wpg/wallpapers/$selected_theme|" "$wallpaper_conf" + sed -i "s|exec-once = swaybg -o $monitor2.*|exec-once = swaybg -o $monitor2 -m fill -i \$XDG_CONFIG_HOME/wpg/wallpapers/$second_wallpaper|" "$wallpaper_conf" + + pkill swaybg + swaybg -o "$monitor1" -i "$XDG_CONFIG_HOME/wpg/wallpapers/$selected_theme" -m fill & + swaybg -o "$monitor2" -i "$XDG_CONFIG_HOME/wpg/wallpapers/$second_wallpaper" -m fill & + + log "Successfully set dual wallpapers: $selected_theme ($monitor1) and $second_wallpaper ($monitor2)" + else + wpg -s "$selected_theme" || { + log "Failed to set theme: $selected_theme" + return 1 + } + + local wallpaper_conf="$XDG_CONFIG_HOME/hypr/wallpaper.conf" + sed -i "s|exec-once = swaybg -o $monitor1.*|exec-once = swaybg -o $monitor1 -m fill -i \$XDG_CONFIG_HOME/wpg/wallpapers/\$(wpg -c)|" "$wallpaper_conf" + sed -i "s|exec-once = swaybg -o $monitor2.*|exec-once = swaybg -o $monitor2 -m fill -i \$XDG_CONFIG_HOME/wpg/wallpapers/\$(wpg -c)|" "$wallpaper_conf" + + pkill swaybg + swaybg -o "$monitor1" -i "$XDG_CONFIG_HOME/wpg/wallpapers/$selected_theme" -m fill & + swaybg -o "$monitor2" -i "$XDG_CONFIG_HOME/wpg/wallpapers/$selected_theme" -m fill & + log "Successfully changed theme to: $selected_theme" + fi + fi +} + +handle_system() { + local system_action + system_action=$(show_system_menu) + + case "$system_action" in + "Update") + handle_update + ;; + "Refresh Mirrors") + handle_refresh_mirrors + ;; + "Purge Cache") + handle_purge_cache + ;; + "") + return 0 + ;; + *) + log "Unknown system action: $system_action" + return 1 + ;; + esac +} + +handle_tools() { + local tools_action + tools_action=$(show_tools_menu) + + case "$tools_action" in + "Calculator") + handle_calculator + ;; + "Clipboard") + handle_clipboard + ;; + "Color Picker") + handle_colorpicker + ;; + "Screenshot") + handle_screenshot + ;; + "Symbols") + handle_symbols + ;; + "Theme") + handle_theme + ;; + "") + return 0 + ;; + *) + log "Unknown tools action: $tools_action" + return 1 + ;; + esac +} + +main() { + local action + action=$(show_main_menu) + + case "$action" in + "Services") + uuctl + ;; + "System") + handle_system + ;; + "Tools") + handle_tools + ;; + "Password") + handle_passwords + ;; + "") + exit 0 + ;; + *) + log "Unknown action: $action" + exit 1 + ;; + esac +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi + diff --git a/.config/hypr/scripts/find_song.sh b/.config/hypr/scripts/find_song.sh new file mode 100755 index 0000000..126c986 --- /dev/null +++ b/.config/hypr/scripts/find_song.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +set -euo pipefail +SCRIPT=$(basename "$0") +LAUNCHER=('rofi' '-theme-str' 'window {width: 20%;}' '-dmenu' '-c' '-l' '4' '-p') + +MUSIC_DIR="${XDG_MUSIC_DIR:-$HOME/Music}" + +if [[ ! -d "$MUSIC_DIR" ]]; then + notify-send -u critical "Error" "Music directory not found: $MUSIC_DIR" + exit 1 +fi + +music_files=$(find -L "$MUSIC_DIR" -type f \( \ + -iname "*.mp3" -o \ + -iname "*.flac" -o \ + -iname "*.wav" -o \ + -iname "*.ogg" -o \ + -iname "*.m4a" -o \ + -iname "*.aac" -o \ + -iname "*.opus" -o \ + -iname "*.wma" \ +\) 2>/dev/null | sed "s|^$MUSIC_DIR/||") + +list_archive_music() { + local archive_path="$1" + local archive_rel_path="$2" + local music_pattern='\.(mp3|flac|wav|ogg|m4a|aac|opus|wma)$' + + case "${archive_path,,}" in + *.zip) + if command -v unzip >/dev/null 2>&1; then + unzip -l "$archive_path" 2>/dev/null | \ + awk 'NR>3 {print $NF}' | \ + grep -iE "$music_pattern" | \ + sed "s|^|$archive_rel_path/|" + fi + ;; + *.rar) + if command -v unrar >/dev/null 2>&1; then + unrar lb "$archive_path" 2>/dev/null | \ + grep -iE "$music_pattern" | \ + sed "s|^|$archive_rel_path/|" + fi + ;; + *.7z) + if command -v 7z >/dev/null 2>&1; then + 7z l -slt "$archive_path" 2>/dev/null | \ + awk '/^Path = / {print substr($0, 8)}' | \ + grep -iE "$music_pattern" | \ + sed "s|^|$archive_rel_path/|" + fi + ;; + *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) + if command -v tar >/dev/null 2>&1; then + tar -tf "$archive_path" 2>/dev/null | \ + grep -iE "$music_pattern" | \ + sed "s|^|$archive_rel_path/|" + fi + ;; + esac +} + +archive_music_files="" +while IFS= read -r -d '' archive_file; do + archive_rel_path=$(echo "$archive_file" | sed "s|^$MUSIC_DIR/||") + archive_music=$(list_archive_music "$archive_file" "$archive_rel_path") + if [[ -n "$archive_music" ]]; then + archive_music_files="$archive_music_files$archive_music"$'\n' + fi +done < <(find -L "$MUSIC_DIR" -type f \( \ + -iname "*.zip" -o \ + -iname "*.rar" -o \ + -iname "*.7z" -o \ + -iname "*.tar" -o \ + -iname "*.tar.gz" -o \ + -iname "*.tar.bz2" -o \ + -iname "*.tar.xz" \ +\) -print0 2>/dev/null) + +all_music_files="" +if [[ -n "$music_files" ]]; then + all_music_files="$music_files" +fi +if [[ -n "$archive_music_files" ]]; then + if [[ -n "$all_music_files" ]]; then + all_music_files="$all_music_files"$'\n'"$archive_music_files" + else + all_music_files="$archive_music_files" + fi +fi +all_music_files=$(echo "$all_music_files" | grep -v '^$' | sort) + +if [[ -z "$all_music_files" ]]; then + notify-send -u normal "Info" "No music files found in $MUSIC_DIR" + exit 0 +fi + +selection=$(echo "$all_music_files" | "${LAUNCHER[@]}" "Select song:") + +if [[ -z "$selection" ]]; then + exit 0 +fi + +if rmpc add "$selection"; then + notify-send -u normal "Music" "Added: $(basename "$selection")" +else + notify-send -u critical "Error" "Failed to add: $(basename "$selection")" + exit 1 +fi diff --git a/.config/hypr/scripts/move.sh b/.config/hypr/scripts/move.sh new file mode 100755 index 0000000..a901c67 --- /dev/null +++ b/.config/hypr/scripts/move.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +set -uo pipefail +SAME_MONITOR=0 + +while [ $# -gt 0 ]; do + case "$1" in + --same) + SAME_MONITOR=1 + shift + ;; + *) + shift + ;; + esac +done + +WINDOWS=$(hyprctl activewindow -j) +MONITORS=$(hyprctl monitors -j) +WORKSPACES=$(hyprctl workspaces -j) +ACTIVE_WORKSPACE=$(hyprctl activeworkspace -j) + +CURRENT_WS_ID=$(echo "$WINDOWS" | jq '.workspace.id') +CURRENT_MONITOR=$(echo "$WINDOWS" | jq -r '.monitor') +CURRENT_NAME=$(echo "$MONITORS" | jq -r ".[$CURRENT_MONITOR].name") +ACTIVE_WS_ID=$(echo "$ACTIVE_WORKSPACE" | jq -r '.id') + + +TARGET_INDEX=$CURRENT_MONITOR +if [[ $SAME_MONITOR -eq 0 ]]; then + TARGET_INDEX=$((1 - CURRENT_MONITOR)) +fi +TARGET=$(echo "$MONITORS" | jq -r ".[$TARGET_INDEX].name") + +next_empty_workspace() { + local start_search_id=$1 + local current_workspaces=$2 + local i=$start_search_id + while jq -e ".[] | select(.id == $i)" <<< "$current_workspaces" > /dev/null; do + i=$((i + 1)) + done + echo "$i" +} + +check_current_workspaces() { + local target_monitor_name=$1 + local ws_json=$2 + echo "$ws_json" | jq -r --arg tmn "$target_monitor_name" ' + [ .[] | select(.monitor == $tmn and .windows == 0) ] | + if length > 0 then (min_by(.id) | .id) else empty end + ' +} + +NEW_WORKSPACE="" + +if [[ $CURRENT_MONITOR -eq 0 && $SAME_MONITOR -eq 1 ]]; then + if ! jq -e '.[] | select(.id == 2 and .windows > 0)' <<< "$WORKSPACES" > /dev/null; then + NEW_WORKSPACE=2 + fi +fi + +if [[ -z "$NEW_WORKSPACE" ]]; then + CANDIDATE_WS_ON_MONITOR=$(check_current_workspaces "$TARGET" "$WORKSPACES") + if [[ -n "$CANDIDATE_WS_ON_MONITOR" ]]; then + NEW_WORKSPACE="$CANDIDATE_WS_ON_MONITOR" + fi +fi + + +if [[ -z "$NEW_WORKSPACE" ]]; then + _START_FIND_ID=1 + if [[ $CURRENT_MONITOR -eq 0 && $SAME_MONITOR -eq 0 ]]; then + _START_FIND_ID=2 + fi + NEW_WORKSPACE=$(next_empty_workspace "$_START_FIND_ID" "$WORKSPACES") +fi + +DEFAULT_WORKSPACE=$((CURRENT_MONITOR + 1)) + +FLOATING_ADDRESS=$(echo "$WINDOWS" | jq -r 'select(.floating == true) | .address // empty') +if [[ -n "$FLOATING_ADDRESS" ]]; then + hyprctl dispatch "togglefloating address:$FLOATING_ADDRESS" +fi + +NO_WINDOWS=$(echo "$WORKSPACES" | jq ".[] | select(.id == $CURRENT_WS_ID) | .windows // 0") + +hyprctl dispatch movewindow mon:"$TARGET" +hyprctl dispatch movetoworkspace "$NEW_WORKSPACE" + +if [[ $CURRENT_WS_ID -lt 0 ]]; then + # Don't change workspaces when moving from a negative workspace ID + hyprctl dispatch workspace "$ACTIVE_WS_ID" +elif [[ $SAME_MONITOR -eq 1 ]]; then + hyprctl dispatch workspace "$NEW_WORKSPACE" +elif [[ $NO_WINDOWS -eq 1 ]]; then + hyprctl dispatch focusmonitor "$CURRENT_NAME" + hyprctl dispatch workspace "$DEFAULT_WORKSPACE" +else + hyprctl dispatch workspace "$CURRENT_WS_ID" +fi diff --git a/.config/hypr/scripts/notes.sh b/.config/hypr/scripts/notes.sh new file mode 100755 index 0000000..8a85d6e --- /dev/null +++ b/.config/hypr/scripts/notes.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +set -uo pipefail +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +LAUNCHER=('rofi' '-kb-custom-1' 'Alt+d' '-kb-custom-2' 'Alt+n' '-kb-custom-3' 'Alt+e' '-theme-str' 'window {width: 20%;}' '-dmenu' '-c' '-l' '10' '-p') +NOTESDIR="${XDG_DOCUMENTS_DIR:-$HOME/.notes}" +mkdir -p "$NOTESDIR" + +newnote() { + local NAME + NAME=$(printf "%s" "$(find "$NOTESDIR" -maxdepth 1 -type f -printf '%T@ %f\n' | sort -rn | cut -d' ' -f2-)" | \ + "${LAUNCHER[@]}" "new:" | xargs) + + if [[ -z "$NAME" ]]; then + return 1 + fi + + touch "${NOTESDIR}/${NAME}" + main +} + +opennote() { + local NOTE="$1" + $TERMINAL --class notes "$EDITOR" "${NOTESDIR}/${NOTE}" + main +} + +deletenote() { + local NOTE="${1:-}" + + if [[ -z "$NOTE" ]]; then + NOTE=$(find "$NOTESDIR" -maxdepth 1 -type f -printf '%T@ %f\n' | sort -rn | cut -d' ' -f2- | \ + "${LAUNCHER[@]}" "delete:") + fi + + [[ -z "$NOTE" ]] && return 1 + + local CONFIRM + CONFIRM=$(printf "%s\n%s\n" "no" "yes" | \ + "${LAUNCHER[@]}" "delete ${NOTE}:") + + if [[ "$CONFIRM" == "yes" ]]; then + rm "${NOTESDIR}/${NOTE}" + echo "Deleted ${NOTE}" + fi + main +} + +editnote() { + local NOTE="${1:-}" + NAME=$(echo "" | \ + "${LAUNCHER[@]}" 'edit:' -filter "$NOTE" -matching prefix) + + if [[ -z "$NAME" ]]; then + main + fi + + if [[ "${NOTE}" != "${NAME}" ]]; then + mv "${NOTESDIR}/${NOTE}" "${NOTESDIR}/${NAME}" + fi + + main +} + +main() { + local CHOICE + CHOICE=$(printf "%s" "$(find "$NOTESDIR" -maxdepth 1 -type f -printf '%T@ %f\n' | sort -rn | cut -d' ' -f2-)" | \ + "${LAUNCHER[@]}" "notes:") + + local EXITCODE=$? + case $EXITCODE in + 0) # Enter pressed + case "$CHOICE" in + *) opennote "$CHOICE" ;; + esac + ;; + 10) # Delete pressed + case "$CHOICE" in + *) deletenote "$CHOICE" ;; + esac + ;; + 11) # New pressed + case "$CHOICE" in + *) newnote ;; + esac + ;; + 12) + case "$CHOICE" in + *) editnote "$CHOICE";; + esac + ;; + 1) # Escape pressed + exit 0 + ;; + esac +} + +main diff --git a/.config/hypr/scripts/power.sh b/.config/hypr/scripts/power.sh new file mode 100755 index 0000000..f76b8d6 --- /dev/null +++ b/.config/hypr/scripts/power.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -euo pipefail +SCRIPT=$(basename "$0") +LAUNCHER=('rofi' '-theme-str' 'window {width: 20%;}' '-dmenu' '-c' '-l' '3' '-p') + +log() { + logger -i -t "$SCRIPT" "$*" +} + +main() { + local CHOICE + CHOICE=$(printf "sleep\nrestart\nshutdown" | "${LAUNCHER[@]}" "power:") + + local EXITCODE=$? + case $EXITCODE in + 0) + case "$CHOICE" in + "sleep") systemctl suspend;; + "restart") reboot;; + "shutdown") notify-send "Shutdown in 1 minute!" && shutdown;; + esac + ;; + 1) + exit 0 + ;; + esac +} + +main diff --git a/.config/hypr/wallpaper.conf b/.config/hypr/wallpaper.conf new file mode 100644 index 0000000..179d28f --- /dev/null +++ b/.config/hypr/wallpaper.conf @@ -0,0 +1,2 @@ +exec-once = swaybg -o DP-1 -m fill -i $XDG_CONFIG_HOME/wpg/wallpapers/monk.png +exec-once = swaybg -o DP-3 -m fill -i $XDG_CONFIG_HOME/wpg/wallpapers/river.jpg diff --git a/.config/hypr/xdph.conf b/.config/hypr/xdph.conf new file mode 100644 index 0000000..e40a11d --- /dev/null +++ b/.config/hypr/xdph.conf @@ -0,0 +1,3 @@ +screencopy { + allow_token_by_default = true +} diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..bf2f69e --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,2666 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +include $HOME/.cache/wal/colors-kitty.conf +allow_remote_control yes +enabled_layouts splits:split_axis=horizontal +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +# font_family monospace +# bold_font auto +# italic_font auto +# bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. The easiest way to select fonts is to run the `kitten +#: choose-fonts` command which will present a nice UI for you to +#: select the fonts you want with previews and support for selecting +#: variable fonts and font features. If you want to learn to select +#: fonts manually, read the font specification syntax +#: . + +font_size 12.0 + +map f1 launch --location=vsplit --bias=80 --cwd=current hx . +map f5 launch --location=hsplit --bias=50 --cwd=current +map f6 launch --location=vsplit --bias=50 --cwd=current +map f4 launch --location=split --bias=50 --cwd=current +map f7 layout_action rotate + +map ctrl+shift+k move_window up +map ctrl+shift+h move_window left +map ctrl+shift+l move_window right +map ctrl+shift+j move_window down + +# map ctrl+shift+k layout_action move_to_screen_edge top +# map ctrl+shift+h layout_action move_to_screen_edge left +# map ctrl+shift+l layout_action move_to_screen_edge right +# map ctrl+shift+j layout_action move_to_screen_edge bottom + +map ctrl+k neighboring_window up +map ctrl+h neighboring_window left +map ctrl+l neighboring_window right +map ctrl+j neighboring_window down + +map ctrl+shift+space launch --location=hsplit --bias=20 --cwd=current universal_run.sh + +#: Font size (in pts). + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the string been LTR. For example, assuming the Hebrew word ירושלים, +#: selecting the character that on the screen appears to be ם actually +#: writes into the selection buffer the character י. kitty's default +#: behavior is useful in conjunction with a filter to reverse the word +#: order, however, if you wish to manipulate RTL glyphs, it can be +#: very challenging to work with, so this option is provided to turn +#: it off. Furthermore, this option can be used with the command line +#: program GNU FriBidi +#: to get BIDI support, because it will force kitty to always treat +#: the text as LTR, which FriBidi expects for terminals. + +# symbol_map + +#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified Unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each Unicode code +#: point is specified in the form `U+`. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. This option can be specified multiple times. +#: The syntax is:: + +#: symbol_map codepoints Font Family Name + +# narrow_symbols + +#: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 + +#: Usually, for Private Use Unicode characters and some symbol/dingbat +#: characters, if the character is followed by one or more spaces, +#: kitty will use those extra cells to render the character larger, if +#: the character in the font has a wide aspect ratio. Using this +#: option you can force kitty to restrict the specified code points to +#: render in the specified number of cells (defaulting to one cell). +#: This option can be specified multiple times. The syntax is:: + +#: narrow_symbols codepoints [optionally the number of cells] + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features option. + +# font_features + +#: E.g. font_features none + +#: Choose exactly which OpenType features to enable or disable. Note +#: that for the main fonts, features can be specified when selecting +#: the font using the choose-fonts kitten. This setting is useful for +#: fallback fonts. + +#: Some fonts might have features worthwhile in a terminal. For +#: example, Fira Code includes a discretionary feature, zero, which in +#: that font changes the appearance of the zero (0), to make it more +#: easily distinguishable from Ø. Fira Code also includes other +#: discretionary features known as Stylistic Sets which have the tags +#: ss01 through ss20. + +#: For the exact syntax to use for individual features, see the +#: HarfBuzz documentation . + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, font features are first read from the FontConfig database +#: and then this option is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use the `fc-scan file.ttf` +#: command on Linux or the `Font Book tool on macOS +#: `__. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero in the bold font:: + +#: font_features FiraCode-Bold +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# modify_font + +#: Modify font characteristics such as the position or thickness of +#: the underline and strikethrough. The modifications can have the +#: suffix px for pixels or % for percentage of original value. No +#: suffix means use pts. For example:: + +#: modify_font underline_position -2 +#: modify_font underline_thickness 150% +#: modify_font strikethrough_position 2px + +#: Additionally, you can modify the size of the cell in which each +#: font glyph is rendered and the baseline at which the glyph is +#: placed in the cell. For example:: + +#: modify_font cell_width 80% +#: modify_font cell_height -2px +#: modify_font baseline 3 + +#: Note that modifying the baseline will automatically adjust the +#: underline and strikethrough positions by the same amount. +#: Increasing the baseline raises glyphs inside the cell and +#: decreasing it lowers them. Decreasing the cell size might cause +#: rendering artifacts, so use with care. + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: The sizes of the lines used for the box drawing Unicode characters. +#: These values are in pts. They will be scaled by the monitor DPI to +#: arrive at a pixel value. There must be four values corresponding to +#: thin, normal, thick, and very thick lines. + +# undercurl_style thin-sparse + +#: The style with which undercurls are rendered. This option takes the +#: form (thin|thick)-(sparse|dense). Thin and thick control the +#: thickness of the undercurl. Sparse and dense control how often the +#: curl oscillates. With sparse the curl will peak once per character, +#: with dense twice. + +# text_composition_strategy platform + +#: Control how kitty composites text glyphs onto the background color. +#: The default value of platform tries for text rendering as close to +#: "native" for the platform kitty is running on as possible. + +#: A value of legacy uses the old (pre kitty 0.28) strategy for how +#: glyphs are composited. This will make dark text on light +#: backgrounds look thicker and light text on dark backgrounds +#: thinner. It might also make some text appear like the strokes are +#: uneven. + +#: You can fine tune the actual contrast curve used for glyph +#: composition by specifying up to two space-separated numbers for +#: this setting. + +#: The first number is the gamma adjustment, which controls the +#: thickness of dark text on light backgrounds. Increasing the value +#: will make text appear thicker. The default value for this is 1.0 on +#: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result +#: is scaled based on the luminance difference between the background +#: and the foreground. Dark text on light backgrounds receives the +#: full impact of the curve while light text on dark backgrounds is +#: affected very little. + +#: The second number is an additional multiplicative contrast. It is +#: percentage ranging from 0 to 100. The default value is 0 on Linux +#: and 30 on macOS. + +#: If you wish to achieve similar looking thickness in light and dark +#: themes, a good way to experiment is start by setting the value to +#: 1.0 0 and use a dark theme. Then adjust the second parameter until +#: it looks good. Then switch to a light theme and adjust the first +#: parameter until the perceived thickness matches the dark theme. + +# text_fg_override_threshold 0 + +#: The minimum accepted difference in luminance between the foreground +#: and background color, below which kitty will override the +#: foreground color. It is percentage ranging from 0 to 100. If the +#: difference in luminance of the foreground and background is below +#: this threshold, the foreground color will be set to white if the +#: background is dark or black if the background is light. The default +#: value is 0, which means no overriding is performed. Useful when +#: working with applications that use colors that do not contrast well +#: with your preferred color scheme. + +#: WARNING: Some programs use characters (such as block characters) +#: for graphics display and may expect to be able to set the +#: foreground and background to the same color (or similar colors). +#: If you see unexpected stripes, dots, lines, incorrect color, no +#: color where you expect color, or any kind of graphic display +#: problem try setting text_fg_override_threshold to 0 to see if this +#: is the cause of the problem. + +#: }}} + +#: Text cursor customization {{{ + +# cursor #cccccc + +#: Default text cursor color. If set to the special value none the +#: cursor will be rendered with a "reverse video" effect. Its color +#: will be the color of the text in the cell it is over and the text +#: will be rendered with the background color of the cell. Note that +#: if the program running in the terminal sets a cursor color, this +#: takes precedence. Also, the cursor colors are modified if the cell +#: background and foreground colors have very low contrast. Note that +#: some themes set this value, so if you want to override it, place +#: your value after the lines where the theme file is included. + +# cursor_text_color #111111 + +#: The color of text under the cursor. If you want it rendered with +#: the background color of the cell underneath instead, use the +#: special keyword: `background`. Note that if cursor is set to none +#: then this option is ignored. Note that some themes set this value, +#: so if you want to override it, place your value after the lines +#: where the theme file is included. + +# cursor_shape block + +#: The cursor shape can be one of block, beam, underline. Note that +#: when reloading the config this will be changed only if the cursor +#: shape has not been set by the program running in the terminal. This +#: sets the default cursor shape, applications running in the terminal +#: can override it. In particular, shell integration +#: in kitty sets +#: the cursor shape to beam at shell prompts. You can avoid this by +#: setting shell_integration to no-cursor. + +# cursor_shape_unfocused hollow + +#: Defines the text cursor shape when the OS window is not focused. +#: The unfocused cursor shape can be one of block, beam, underline, +#: hollow and unchanged (leave the cursor shape as it is). + +# cursor_beam_thickness 1.5 + +#: The thickness of the beam cursor (in pts). + +# cursor_underline_thickness 2.0 + +#: The thickness of the underline cursor (in pts). + +# cursor_blink_interval -1 + +#: The interval to blink the cursor (in seconds). Set to zero to +#: disable blinking. Negative values mean use system default. Note +#: that the minimum interval will be limited to repaint_delay. You can +#: also animate the cursor blink by specifying an easing function. For +#: example, setting this to option to 0.5 ease-in-out will cause the +#: cursor blink to be animated over a second, in the first half of the +#: second it will go from opaque to transparent and then back again +#: over the next half. You can specify different easing functions for +#: the two halves, for example: -1 linear ease-out. kitty supports all +#: the CSS easing functions . Note that turning on animations +#: uses extra power as it means the screen is redrawn multiple times +#: per blink interval. See also, cursor_stop_blinking_after. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +cursor_trail 10 + +#: Set this to a value larger than zero to enable a "cursor trail" +#: animation. This is an animation that shows a "trail" following the +#: movement of the text cursor. It makes it easy to follow large +#: cursor jumps and makes for a cool visual effect of the cursor +#: zooming around the screen. The actual value of this option controls +#: when the animation is trigerred. It is a number of milliseconds. +#: The trail animation only follows cursors that have stayed in their +#: position for longer than the specified number of milliseconds. This +#: prevents trails from appearing for cursors that rapidly change +#: their positions during UI updates in complex applications. See +#: cursor_trail_decay to control the animation speed and +#: cursor_trail_start_threshold to control when a cursor trail is +#: started. + +cursor_trail_decay 0.01 0.05 + +#: Controls the decay times for the cursor trail effect when the +#: cursor_trail is enabled. This option accepts two positive float +#: values specifying the fastest and slowest decay times in seconds. +#: The first value corresponds to the fastest decay time (minimum), +#: and the second value corresponds to the slowest decay time +#: (maximum). The second value must be equal to or greater than the +#: first value. Smaller values result in a faster decay of the cursor +#: trail. Adjust these values to control how quickly the cursor trail +#: fades away. + +cursor_trail_start_threshold 0 + +#: Set the distance threshold for starting the cursor trail. This +#: option accepts a positive integer value that represents the minimum +#: number of cells the cursor must move before the trail is started. +#: When the cursor moves less than this threshold, the trail is +#: skipped, reducing unnecessary cursor trail animation. + +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_indicator_opacity 1.0 + +#: The opacity of the scrollback indicator which is a small colored +#: rectangle that moves along the right hand side of the window as you +#: scroll, indicating what fraction you have scrolled. The default is +#: one which means fully opaque, aka visible. Set to a value between +#: zero and one to make the indicator less visible. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position or +#: set to 0 if there is no cursor, for example, when showing the last +#: command output. + +# scrollback_pager_history_size 0 + +#: Separate scrollback history size (in MB), used only for browsing +#: the scrollback buffer with pager. This separate buffer is not +#: available for interactive scrolling but will be piped to the pager +#: program when viewing scrollback buffer in a separate window. The +#: current implementation stores the data in UTF-8, so approximately +#: 10000 lines per megabyte at 100 chars per line, for pure ASCII, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_fill_enlarged_window no + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Multiplier for the number of lines scrolled by the mouse wheel. +#: Note that this is only used for low precision scrolling devices, +#: not for high precision scrolling devices on platforms such as macOS +#: and Wayland. Use negative numbers to change scroll direction. See +#: also wheel_scroll_min_lines. + +# wheel_scroll_min_lines 1 + +#: The minimum number of lines scrolled by the mouse wheel. The scroll +#: multiplier wheel_scroll_multiplier only takes effect after it +#: reaches this number. Note that this is only used for low precision +#: scrolling devices like wheel mice that scroll by very small amounts +#: when using the wheel. With a negative number, the minimum number of +#: lines will always be added. + +# touch_scroll_multiplier 1.0 + +#: Multiplier for the number of lines scrolled by a touchpad. Note +#: that this is only used for high precision scrolling devices on +#: platforms such as macOS and Wayland. Use negative numbers to change +#: scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +# url_color #0087bd +# url_style curly + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, straight, double, curly, dotted, dashed. + +# open_url_with default + +#: The program to open clicked URLs. The special value default will +#: first look for any URL handlers defined via the open_actions +#: facility and if non +#: are found, it will use the Operating System's default URL handler +#: (open on macOS and xdg-open on Linux). + +# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +# detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. See also the +#: underline_hyperlinks option to control how hyperlinks (as opposed +#: to plain text URLs) are displayed. + +# url_excluded_characters + +#: Additional characters to be disallowed from URLs, when detecting +#: URLs under the mouse cursor. By default, all characters that are +#: legal in URLs are allowed. Additionally, newlines are allowed (but +#: stripped). This is to accommodate programs such as mutt that add +#: hard line breaks even for continued lines. \n can be added to this +#: option to disable this behavior. Special characters can be +#: specified using backslash escapes, to specify a backslash use a +#: double backslash. + +# show_hyperlink_targets no + +#: When the mouse hovers over a terminal hyperlink, show the actual +#: URL that will be activated when the hyperlink is clicked. + +# underline_hyperlinks hover + +#: Control how hyperlinks are underlined. They can either be +#: underlined on mouse hover, always (i.e. permanently underlined) or +#: never which means that kitty will not apply any underline styling +#: to hyperlinks. Note that the value of always only applies to real +#: (OSC 8) hyperlinks not text that is detected to be a URL on mouse +#: hover. Uses the url_style and url_color settings for the underline +#: style. Note that reloading the config and changing this value +#: to/from always will only affect text subsequently received by +#: kitty. + +# copy_on_select no + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, selecting text with the mouse will cause the text to be +#: copied to clipboard. Useful on platforms such as macOS that do not +#: have the concept of primary selection. You can instead specify a +#: name such as a1 to copy to a private kitty buffer. Map a shortcut +#: with the paste_from_buffer action to paste from this private +#: buffer. For example:: + +#: copy_on_select a1 +#: map shift+cmd+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# paste_actions quote-urls-at-prompt,confirm + +#: A comma separated list of actions to take when pasting text into +#: the terminal. The supported paste actions are: + +#: quote-urls-at-prompt: +#: If the text being pasted is a URL and the cursor is at a shell prompt, +#: automatically quote the URL (needs shell_integration). +#: replace-dangerous-control-codes +#: Replace dangerous control codes from pasted text, without confirmation. +#: replace-newline +#: Replace the newline character from pasted text, without confirmation. +#: confirm: +#: Confirm the paste if the text to be pasted contains any terminal control codes +#: as this can be dangerous, leading to code execution if the shell/program running +#: in the terminal does not properly handle these. +#: confirm-if-large +#: Confirm the paste if it is very large (larger than 16KB) as pasting +#: large amounts of text into shells can be very slow. +#: filter: +#: Run the filter_paste() function from the file paste-actions.py in +#: the kitty config directory on the pasted text. The text returned by the +#: function will be actually pasted. +#: no-op: +#: Has no effect. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. A value of always will always do it. + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the Unicode database will be matched. + +# select_by_word_characters_forward + +#: Characters considered part of a word when extending the selection +#: forward on double clicking. In addition to these characters any +#: character that is marked as an alphanumeric character in the +#: Unicode database will be matched. + +#: If empty (default) select_by_word_characters will be used for both +#: directions. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +# focus_follows_mouse no + +#: Set the active window to the window under the mouse when moving the +#: mouse around. On macOS, this will also cause the OS Window under +#: the mouse to be focused automatically when the mouse enters it. + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. + +#: Mouse actions {{{ + +#: Mouse buttons can be mapped to perform arbitrary actions. The +#: syntax is: + +#: .. code-block:: none + +#: mouse_map button-name event-type modes action + +#: Where button-name is one of left, middle, right, b1 ... b8 with +#: added keyboard modifiers. For example: ctrl+shift+left refers to +#: holding the Ctrl+Shift keys while clicking with the left mouse +#: button. The value b1 ... b8 can be used to refer to up to eight +#: buttons on a mouse. + +#: event-type is one of press, release, doublepress, triplepress, +#: click, doubleclick. modes indicates whether the action is performed +#: when the mouse is grabbed by the program running in the terminal, +#: or not. The values are grabbed or ungrabbed or a comma separated +#: combination of them. grabbed refers to when the program running in +#: the terminal has requested mouse events. Note that the click and +#: double click events have a delay of click_interval to disambiguate +#: from double and triple presses. + +#: You can run kitty with the kitty --debug-input command line option +#: to see mouse events. See the builtin actions below to get a sense +#: of what is possible. + +#: If you want to unmap a button, map it to nothing. For example, to +#: disable opening of URLs with a plain click:: + +#: mouse_map left click ungrabbed + +#: See all the mappable actions including mouse actions here +#: . + +#: .. note:: +#: Once a selection is started, releasing the button that started it will +#: automatically end it and no release event will be dispatched. + +# clear_all_mouse_actions no + +#: Remove all mouse action definitions up to this point. Useful, for +#: instance, to remove the default mouse actions. + +#: Click the link under the mouse or move the cursor + +# mouse_map left click ungrabbed mouse_handle_click selection link prompt + +#:: First check for a selection and if one exists do nothing. Then +#:: check for a link under the mouse cursor and if one exists, click +#:: it. Finally check if the click happened at the current shell +#:: prompt and if so, move the cursor to the click location. Note +#:: that this requires shell integration +#:: to work. + +#: Click the link under the mouse or move the cursor even when grabbed + +# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt + +#:: Same as above, except that the action is performed even when the +#:: mouse is grabbed by the program running in the terminal. + +#: Click the link under the mouse cursor + +# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link + +#:: Variant with Ctrl+Shift is present because the simple click based +#:: version has an unavoidable delay of click_interval, to +#:: disambiguate clicks from double clicks. + +#: Discard press event for link click + +# mouse_map ctrl+shift+left press grabbed discard_event + +#:: Prevent this press event from being sent to the program that has +#:: grabbed the mouse, as the corresponding release event is used to +#:: open a URL. + +#: Paste from the primary selection + +# mouse_map middle release ungrabbed paste_from_selection + +#: Start selecting text + +# mouse_map left press ungrabbed mouse_selection normal + +#: Start selecting text in a rectangle + +# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle + +#: Select a word + +# mouse_map left doublepress ungrabbed mouse_selection word + +#: Select a line + +# mouse_map left triplepress ungrabbed mouse_selection line + +#: Select line from point + +# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line. If you +#:: would like to select the word at the point and then extend to the +#:: rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection + +# mouse_map right press ungrabbed mouse_selection extend + +#:: If you want only the end of the selection to be moved instead of +#:: the nearest boundary, use move-end instead of extend. + +#: Paste from the primary selection even when grabbed + +# mouse_map shift+middle release ungrabbed,grabbed paste_selection +# mouse_map shift+middle press grabbed discard_event + +#: Start selecting text even when grabbed + +# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal + +#: Start selecting text in a rectangle even when grabbed + +# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle + +#: Select a word even when grabbed + +# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word + +#: Select a line even when grabbed + +# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +#: Select line from point even when grabbed + +# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line even when +#:: grabbed. If you would like to select the word at the point and +#:: then extend to the rest of the line, change `line_from_point` to +#:: `word_and_line_from_point`. + +#: Extend the current selection even when grabbed + +# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend + +#: Show clicked command output in pager + +# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay between screen updates (in milliseconds). Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS, you have to +#: either set sync_to_monitor to no or use a monitor with a high +#: refresh rate. Also, to minimize latency when there is pending input +#: to be processed, this option is ignored. + +# input_delay 3 + +#: Delay before input from the program running in the terminal is +#: processed (in milliseconds). Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. +#: This setting is ignored when the input buffer is almost full. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents screen tearing +#: when scrolling. +#: However, it limits the rendering speed to the refresh rate of your +#: monitor. With a very high speed mouse/high keyboard repeat rate, +#: you may notice some slight input latency. If so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +# enable_audio_bell yes + +#: The audio bell. Useful to disable it in environments that require +#: silence. + +# visual_bell_duration 0.0 + +#: The visual bell duration (in seconds). Flash the screen when a bell +#: occurs for the specified number of seconds. Set to zero to disable. +#: The flash is animated, fading in and out over the specified +#: duration. The easing function used for the fading can be +#: controlled. For example, 2.0 linear will casuse the flash to fade +#: in and out linearly. The default if unspecified is to use ease-in- +#: out which fades slowly at the start, middle and end. You can +#: specify different easing functions for the fade-in and fade-out +#: parts, like this: 2.0 ease-in linear. kitty supports all the CSS +#: easing functions . + +# visual_bell_color none + +#: The color used by visual bell. Set to none will fall back to +#: selection background color. If you feel that the visual bell is too +#: bright, you can set it to a darker color. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on Linux. + +# bell_on_tab "🔔 " + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has a bell. If you want to use leading +#: or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +#: For backwards compatibility, values of yes, y and true are +#: converted to the default bell symbol and no, n, false and none are +#: converted to the empty string. + +# command_on_bell pw_play + +#: Program to run when a bell occurs. The environment variable +#: KITTY_CHILD_CMDLINE can be used to get the program running in the +#: window in which the bell occurred. + +# bell_path /usr/share/sounds/freedesktop/stereo/bell.oga + +#: Path to a sound file to play as the bell sound. If set to none, the +#: system default bell sound is used. Must be in a format supported by +#: the operating systems sound API, such as WAV or OGA on Linux +#: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound). + +# linux_bell_theme __custom + +#: The XDG Sound Theme kitty will use to play the bell sound. Defaults +#: to the custom theme name specified in the XDG Sound theme +#: specification , falling back to the default +#: freedesktop theme if it does not exist. To change your sound theme +#: desktop wide, create +#: :file:~/.local/share/sounds/__custom/index.theme` with the +#: contents: + +#: [Sound Theme] + +#: Inherits=name-of-the-sound-theme-you-want-to-use + +#: Replace name-of-the-sound-theme-you-want-to-use with the actual +#: theme name. Now all compliant applications should use sounds from +#: this theme. + +#: }}} + +#: Window layout {{{ + +# remember_window_size yes +# initial_window_width 640 +# initial_window_height 400 + +#: If enabled, the OS Window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the OS Window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the layouts . + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing kitty windows in a layout with the shortcut +#: start_resizing_window. The cells value is used for horizontal +#: resizing, and the lines value is used for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified, the unit is assumed +#: to be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: borders that separate the window from a neighbor are drawn. Note +#: that setting a non-zero window_margin_width overrides this and +#: causes all borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_margin_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +# window_padding_width 0 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# single_window_padding_width -1 + +#: The window padding to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_padding_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be +#: only at the bottom and right edges. The value can be one of: top- +#: left, top, top-right, left, center, right, bottom-left, bottom, +#: bottom-right. + +# active_border_color #BA9351 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #6E7986 + +#: The color for the border of inactive windows. + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred. + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +# hide_window_decorations no + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only and titlebar-and-corners can be used +#: to only hide the titlebar and the rounded corners. Whether this +#: works and exactly what effect it has depends on the window +#: manager/operating system. Note that the effects of changing this +#: option when reloading config are undefined. When using titlebar- +#: only, it is useful to also set window_margin_width and +#: placement_strategy to prevent the rounded corners from clipping +#: text. Or use titlebar-and-corners. + +# window_logo_path none + +#: Path to a logo image. Must be in PNG/JPEG/WEBP/GIF/TIFF/BMP format. +#: Relative paths are interpreted relative to the kitty config +#: directory. The logo is displayed in a corner of every kitty window. +#: The position is controlled by window_logo_position. Individual +#: windows can be configured to have different logos either using the +#: launch action or the remote control +#: facility. + +# window_logo_position bottom-right + +#: Where to position the window logo in the window. The value can be +#: one of: top-left, top, top-right, left, center, right, bottom-left, +#: bottom, bottom-right. + +# window_logo_alpha 0.5 + +#: The amount the logo should be faded into the background. With zero +#: being fully faded and one being fully opaque. + +# window_logo_scale 0 + +#: The percentage (0-100] of the window size to which the logo should +#: scale. Using a single number means the logo is scaled to that +#: percentage of the shortest window dimension, while preseving aspect +#: ratio of the logo image. + +#: Using two numbers means the width and height of the logo are scaled +#: to the respective percentage of the window's width and height. + +#: Using zero as the percentage disables scaling in that dimension. A +#: single zero (the default) disables all scaling of the window logo. + +# resize_debounce_time 0.1 0.5 + +#: The time to wait (in seconds) before asking the program running in +#: kitty to resize and redraw the screen during a live resize of the +#: OS window, when no new resize events have been received, i.e. when +#: resizing is either paused or finished. On platforms such as macOS, +#: where the operating system sends events corresponding to the start +#: and end of a live resize, the second number is used for redraw- +#: after-pause since kitty can distinguish between a pause and end of +#: resizing. On such systems the first number is ignored and redraw is +#: immediate after end of resize. On other systems only the first +#: number is used so that kitty is "ready" quickly after the end of +#: resizing, while not also continuously redrawing, to save energy. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with initial_window_width +#: and initial_window_height in number of cells, this option can be +#: used to keep the margins as small as possible when resizing the OS +#: window. Note that this does not currently work on Wayland. + +# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ + +#: The list of characters for visual window selection. For example, +#: for selecting a window to focus on with focus_visible_window. The +#: value should be a series of unique numbers or alphabets, case +#: insensitive, from the set 0-9A-Z\-=[];',./\\`. Specify your +#: preference as a string of characters. + +# confirm_os_window_close -1 + +#: Ask for confirmation when closing an OS window or a tab with at +#: least this number of kitty windows in it by window manager (e.g. +#: clicking the window close button or pressing the operating system +#: shortcut to close windows) or by the close_tab action. A value of +#: zero disables confirmation. This confirmation also applies to +#: requests to quit the entire application (all OS windows, via the +#: quit action). Negative values are converted to positive ones, +#: however, with shell_integration enabled, using negative values +#: means windows sitting at a shell prompt are not counted, only +#: windows where some command is currently running. Note that if you +#: want confirmation when closing individual windows, you can map the +#: close_window_with_confirmation action. + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: The edge to show the tab bar on, top or bottom. + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts). + +# tab_bar_margin_height 0.0 0.0 + +#: The margin above and below the tab bar (in pts). The first number +#: is the margin between the edge of the OS Window and the tab bar. +#: The second number is the margin between the tab bar and the +#: contents of the current tab. + +# tab_bar_style fade + +#: The tab bar style, can be one of: + +#: fade +#: Each tab's edges fade into the background color. (See also tab_fade) +#: slant +#: Tabs look like the tabs in a physical file. +#: separator +#: Tabs are separated by a configurable separator. (See also +#: tab_separator) +#: powerline +#: Tabs are shown as a continuous line with "fancy" separators. +#: (See also tab_powerline_style) +#: custom +#: A user-supplied Python function called draw_tab is loaded from the file +#: tab_bar.py in the kitty config directory. For examples of how to +#: write such a function, see the functions named draw_tab_with_* in +#: kitty's source code: kitty/tab_bar.py. See also +#: this discussion +#: for examples from kitty users. +#: hidden +#: The tab bar is hidden. If you use this, you might want to create +#: a mapping for the select_tab action which presents you with a list of +#: tabs and allows for easy switching to a tab. + +# tab_bar_align left + +#: The horizontal alignment of the tab bar, can be one of: left, +#: center, right. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown. + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, round. + +# tab_activity_symbol none + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. If you want to use +#: leading or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +# tab_title_max_length 0 + +#: The maximum number of cells that can be used to render the text in +#: a tab. A value of zero means that no limit is applied. + +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" + +#: A template to render the tab title. The default just renders the +#: title with optional symbols for bell and activity. If you wish to +#: include the tab-index as well, use something like: {index}:{title}. +#: Useful if you have shortcuts mapped for goto_tab N. If you prefer +#: to see the index as a superscript, use {sup.index}. All data +#: available is: + +#: title +#: The current tab title. +#: index +#: The tab index usable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (a window group is a window and all of its overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. +#: keyboard_mode +#: The name of the current keyboard mode or the empty string if no keyboard mode is active. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: The 256 eight terminal colors can be used as `fmt.fg.color0` +#: through `fmt.fg.color255`. Note that for backward compatibility, if +#: {bell_symbol} or {activity_symbol} are not present in the template, +#: they are prepended to it. + +# active_tab_title_template none + +#: Template to use for active tabs. If not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles. + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +# tab_bar_margin_color none + +#: Color for the tab bar margin area. Defaults to using the terminal +#: background color for margins above and below the tab bar. For side +#: margins the default color is chosen to match the background color +#: of the neighboring tab. + +#: }}} + +#: Color scheme {{{ + +# foreground #dddddd +# background #000000 + +#: The foreground and background colors. + +# background_opacity 1.0 + +#: The opacity of the background. A number between zero and one, where +#: one is opaque and zero is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background, so that things like the status bar in vim, powerline +#: prompts, etc. still look good. But it means that if you use a color +#: theme with a background color in your editor, it will not be +#: rendered as transparent. Instead you should change the default +#: background color in your kitty config and not use a background +#: color in the editor color scheme. Or use the escape codes to set +#: the terminals default colors in a shell script to launch your +#: editor. See also transparent_background_colors. Be aware that using +#: a value less than 1.0 is a (possibly significant) performance hit. +#: When using a low value for this setting, it is desirable that you +#: set the background color to a color the matches the general color +#: of the desktop background, for best text rendering. If you want to +#: dynamically change transparency of windows, set +#: dynamic_background_opacity to yes (this is off by default as it has +#: a performance cost). Changing this option when reloading the config +#: will only work if dynamic_background_opacity was enabled in the +#: original config. + +# background_blur 0 + +#: Set to a positive value to enable background blur (blurring of the +#: visuals behind a transparent window) on platforms that support it. +#: Only takes effect when background_opacity is less than one. On +#: macOS, this will also control the blur radius (amount of blurring). +#: Setting it to too high a value will cause severe performance issues +#: and/or rendering artifacts. Usually, values up to 64 work well. +#: Note that this might cause performance issues, depending on how the +#: platform implements it, so use with care. Currently supported on +#: macOS and KDE. + +# background_image none + +#: Path to a background image. Must be in PNG/JPEG/WEBP/TIFF/GIF/BMP +#: format. + +# background_image_layout tiled + +#: Whether to tile, scale or clamp the background image. The value can +#: be one of tiled, mirror-tiled, scaled, clamped, centered or +#: cscaled. The scaled and cscaled values scale the image to the +#: window size, with cscaled preserving the image aspect ratio. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# transparent_background_colors + +#: A space separated list of upto 7 colors, with opacity. When the +#: background color of a cell matches one of these colors, it is +#: rendered semi-transparent using the specified opacity. + +#: Useful in more complex UIs like editors where you could want more +#: than a single background color to be rendered as transparent, for +#: instance, for a cursor highlight line background or a highlighted +#: block. Terminal applications can set this color using The kitty +#: color control escape code. + +#: The syntax for specifiying colors is: color@opacity, where the +#: @opacity part is optional. When unspecified, the value of +#: background_opacity is used. For example:: + +#: transparent_background_colors red@0.5 #00ff00@0.3 + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. +#: Changing this option by reloading the config is not supported. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. This +#: option makes it easier to read the text. Tinting is done using the +#: current background color for each window. This option applies only +#: if background_opacity is set and transparent windows are supported +#: or background_image is set. + +# background_tint_gaps 1.0 + +#: How much to tint the background image at the window gaps by the +#: background color, after applying background_tint. Since this is +#: multiplicative with background_tint, it can be used to lighten the +#: tint over the window gaps for a *separated* look. + +# dim_opacity 0.4 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 +# selection_background #fffacd + +#: The foreground and background colors for text selected with the +#: mouse. Setting both of these to none will cause a "reverse video" +#: effect for selections, where the selection will be the cell text +#: color and the text will become the cell background color. Setting +#: only selection_foreground to none will cause the foreground color +#: to be used unchanged. Note that these colors can be overridden by +#: the program running in the terminal. + +#: The color table {{{ + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 + +#: black + +# color1 #cc0403 +# color9 #f2201f + +#: red + +# color2 #19cb00 +# color10 #23fd00 + +#: green + +# color3 #cecb00 +# color11 #fffd00 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 3 (violet) + +#: }}} + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: the value of of the SHELL environment variable or if unset, +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login and --interactive to ensure that the shell starts in +#: interactive mode and reads its startup rc files. Environment +#: variables are expanded in this setting. + +# editor . + +#: The terminal based text editor (such as vim or nano) to use when +#: editing the kitty config file or similar tasks. + +#: The default value of . means to use the environment variables +#: VISUAL and EDITOR in that order. If these variables aren't set, +#: kitty will run your shell ($SHELL -l -i -c env) to see if your +#: shell startup rc files set VISUAL or EDITOR. If that doesn't work, +#: kitty will cycle through various known editors (vim, emacs, etc.) +#: and take the first one that exists on your system. + +# close_on_child_death no + +#: Close the window when the child process (usually the shell) exits. +#: With the default value no, the terminal will remain open when the +#: child exits as long as there are still other processes outputting +#: to the terminal (for example disowned or backgrounded processes). +#: When enabled with yes, the window will close as soon as the child +#: process exits. Note that setting it to yes means that any +#: background processes still using the terminal can fail silently +#: because their stdout/stderr/stdin no longer work. + +# remote_control_password + +#: Allow other programs to control kitty using passwords. This option +#: can be specified multiple times to add multiple passwords. If no +#: passwords are present kitty will ask the user for permission if a +#: program tries to use remote control with a password. A password can +#: also *optionally* be associated with a set of allowed remote +#: control actions. For example:: + +#: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab + +#: Only the specified actions will be allowed when using this +#: password. Glob patterns can be used too, for example:: + +#: remote_control_password "my passphrase" set-tab-* resize-* + +#: To get a list of available actions, run:: + +#: kitten @ --help + +#: A set of actions to be allowed when no password is sent can be +#: specified by using an empty password. For example:: + +#: remote_control_password "" *-colors + +#: Finally, the path to a python module can be specified that provides +#: a function is_cmd_allowed that is used to check every remote +#: control command. For example:: + +#: remote_control_password "my passphrase" my_rc_command_checker.py + +#: Relative paths are resolved from the kitty configuration directory. +#: See rc_custom_auth for details. + +# allow_remote_control no + +#: Allow other programs to control kitty. If you turn this on, other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over SSH +#: connections. The default setting of no prevents any form of remote +#: control. The meaning of the various values are: + +#: password +#: Remote control requests received over both the TTY device and the socket +#: are confirmed based on passwords, see remote_control_password. + +#: socket-only +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are denied. +#: See listen_on. + +#: socket +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are confirmed based on +#: password. + +#: no +#: Remote control is completely disabled. + +#: yes +#: Remote control requests are always accepted. + +# listen_on none + +#: Listen to the specified socket for remote control connections. Note +#: that this will apply to all kitty instances. It can be overridden +#: by the kitty --listen-on command line option. For UNIX sockets, +#: such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). +#: Environment variables are expanded and relative paths are resolved +#: with respect to the temporary directory. If {kitty_pid} is present, +#: then it is replaced by the PID of the kitty process, otherwise the +#: PID of the kitty process is appended to the value, with a hyphen. +#: For TCP sockets such as tcp:localhost:0 a random port is always +#: used even if a non-zero port number is specified. See the help for +#: kitty --listen-on for more details. Note that this will be ignored +#: unless allow_remote_control is set to either: yes, socket or +#: socket-only. Changing this option by reloading the config is not +#: supported. + +# env + +#: Specify the environment variables to be set in all child processes. +#: Using the name with an equal sign (e.g. env VAR=) will set it to +#: the empty string. Specifying only the name (e.g. env VAR) will +#: remove the variable from the child process' environment. Note that +#: environment variables are expanded recursively, for example:: + +#: env VAR1=a +#: env VAR2=${HOME}/${VAR1}/b + +#: The value of VAR2 will be /a/b. + +# filter_notification + +#: Specify rules to filter out notifications sent by applications +#: running in kitty. Can be specified multiple times to create +#: multiple filter rules. A rule specification is of the form +#: field:regexp. A filter rule can match on any of the fields: title, +#: body, app, type. The special value of all filters out all +#: notifications. Rules can be combined using Boolean operators. Some +#: examples:: + +#: filter_notification title:hello or body:"abc.*def" +#: # filter out notification from vim except for ones about updates, (?i) +#: # makes matching case insesitive. +#: filter_notification app:"[ng]?vim" and not body:"(?i)update" +#: # filter out all notifications +#: filter_notification all + +#: The field app is the name of the application sending the +#: notification and type is the type of the notification. Not all +#: applications will send these fields, so you can also match on the +#: title and body of the notification text. More sophisticated +#: programmatic filtering and custom actions on notifications can be +#: done by creating a notifications.py file in the kitty config +#: directory (~/.config/kitty). An annotated sample is available +#: . + +# watcher + +#: Path to python file which will be loaded for watchers +#: . Can be +#: specified more than once to load multiple watchers. The watchers +#: will be added to every kitty window. Relative paths are resolved +#: relative to the kitty config directory. Note that reloading the +#: config will only affect windows created after the reload. + +# exe_search_path + +#: Control where kitty finds the programs to run. The default search +#: order is: First search the system wide PATH, then ~/.local/bin and +#: ~/bin. If still not found, the PATH defined in the login shell +#: after sourcing all its startup files is tried. Finally, if present, +#: the PATH specified by the env option is tried. + +#: This option allows you to prepend, append, or remove paths from +#: this search order. It can be specified multiple times for multiple +#: paths. A simple path will be prepended to the search order. A path +#: that starts with the + sign will be append to the search order, +#: after ~/bin above. A path that starts with the - sign will be +#: removed from the entire search order. For example:: + +#: exe_search_path /some/prepended/path +#: exe_search_path +/some/appended/path +#: exe_search_path -/some/excluded/path + +# update_check_interval 24 + +#: The interval to periodically check if an update to kitty is +#: available (in hours). If an update is found, a system notification +#: is displayed informing you of the available update. The default is +#: to check every 24 hours, set to zero to disable. Update checking is +#: only done by the official binary builds. Distro packages or source +#: builds do not do update checking. Changing this option by reloading +#: the config is not supported. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session =none command line option +#: for individual instances. See sessions +#: in the kitty +#: documentation for details. Note that relative paths are interpreted +#: with respect to the kitty config directory. Environment variables +#: in the path are expanded. Changing this option by reloading the +#: config is not supported. Note that if kitty is invoked with command +#: line arguments specifying a command to run, this option is ignored. + +# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: possible actions are: write-clipboard, read-clipboard, write- +#: primary, read-primary, read-clipboard-ask, read-primary-ask. The +#: default is to allow writing to the clipboard and primary selection +#: and to ask for permission when a program tries to read from the +#: clipboard. Note that disabling the read confirmation is a security +#: risk as it means that any program, even the ones running on a +#: remote server via SSH can read your clipboard. See also +#: clipboard_max_size. + +# clipboard_max_size 512 + +#: The maximum size (in MB) of data from programs running in kitty +#: that will be stored for writing to the system clipboard. A value of +#: zero means no size limit is applied. See also clipboard_control. + +# file_transfer_confirmation_bypass + +#: The password that can be supplied to the file transfer kitten +#: to skip the +#: transfer confirmation prompt. This should only be used when +#: initiating transfers from trusted computers, over trusted networks +#: or encrypted transports, as it allows any programs running on the +#: remote machine to read/write to the local filesystem, without +#: permission. + +# allow_hyperlinks yes + +#: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click with the mouse or by using the hints +#: kitten . The +#: special value of ask means that kitty will ask before opening the +#: link when clicked. + +# shell_integration enabled + +#: Enable shell integration on supported shells. This enables features +#: such as jumping to previous prompts, browsing the output of the +#: previous command in a pager, etc. on supported shells. Set to +#: disabled to turn off shell integration, completely. It is also +#: possible to disable individual features, set to a space separated +#: list of these values: no-rc, no-cursor, no-title, no-cwd, no- +#: prompt-mark, no-complete, no-sudo. See Shell integration +#: for details. + +# allow_cloning ask + +#: Control whether programs running in the terminal can request new +#: windows to be created. The canonical example is clone-in-kitty +#: . +#: By default, kitty will ask for permission for each clone request. +#: Allowing cloning unconditionally gives programs running in the +#: terminal (including over SSH) permission to execute arbitrary code, +#: as the user who is running the terminal, on the computer that the +#: terminal is running on. + +# clone_source_strategies venv,conda,env_var,path + +#: Control what shell code is sourced when running clone-in-kitty in +#: the newly cloned window. The supported strategies are: + +#: venv +#: Source the file $VIRTUAL_ENV/bin/activate. This is used by the +#: Python stdlib venv module and allows cloning venvs automatically. +#: conda +#: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual +#: environments created by conda. +#: env_var +#: Execute the contents of the environment variable +#: KITTY_CLONE_SOURCE_CODE with eval. +#: path +#: Source the file pointed to by the environment variable +#: KITTY_CLONE_SOURCE_PATH. + +#: This option must be a comma separated list of the above values. +#: Only the first valid match, in the order specified, is sourced. + +# notify_on_cmd_finish never + +#: Show a desktop notification when a long-running command finishes +#: (needs shell_integration). The possible values are: + +#: never +#: Never send a notification. + +#: unfocused +#: Only send a notification when the window does not have keyboard focus. + +#: invisible +#: Only send a notification when the window both is unfocused and not visible +#: to the user, for example, because it is in an inactive tab or its OS window +#: is not currently active. + +#: always +#: Always send a notification, regardless of window state. + +#: There are two optional arguments: + +#: First, the minimum duration for what is considered a long running +#: command. The default is 5 seconds. Specify a second argument to set +#: the duration. For example: invisible 15. Do not set the value too +#: small, otherwise a command that launches a new OS Window and exits +#: will spam a notification. + +#: Second, the action to perform. The default is notify. The possible +#: values are: + +#: notify +#: Send a desktop notification. + +#: bell +#: Ring the terminal bell. + +#: command +#: Run a custom command. All subsequent arguments are the cmdline to run. + +#: Some more examples:: + +#: # Send a notification when a command takes more than 5 seconds in an unfocused window +#: notify_on_cmd_finish unfocused +#: # Send a notification when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 +#: # Ring a bell when a command takes more than 10 seconds in a invisible window +#: notify_on_cmd_finish invisible 10.0 bell +#: # Run 'notify-send' when a command takes more than 10 seconds in a invisible window +#: # Here %c is replaced by the current command line and %s by the job exit code +#: notify_on_cmd_finish invisible 10.0 command notify-send "job finished with status: %s" %c + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on "Stack Overflow" +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. Changing this option by reloading the config will only affect +#: newly created windows. + +# terminfo_type path + +#: The value of the TERMINFO environment variable to set. This +#: variable is used by programs running in the terminal to search for +#: terminfo databases. The default value of path causes kitty to set +#: it to a filesystem location containing the kitty terminfo database. +#: A value of direct means put the entire database into the env var +#: directly. This can be useful when connecting to containers, for +#: example. But, note that not all software supports this. A value of +#: none means do not touch the variable. + +# forward_stdio no + +#: Forward STDOUT and STDERR of the kitty process to child processes. +#: This is useful for debugging as it allows child processes to print +#: to kitty's STDOUT directly. For example, echo hello world +#: >&$KITTY_STDIO_FORWARDED in a shell will print to the parent +#: kitty's STDOUT. Sets the KITTY_STDIO_FORWARDED=fdnum environment +#: variable so child processes know about the forwarding. Note that on +#: macOS this prevents the shell from being run via the login utility +#: so getlogin() will not work in programs run in this session. + +# menu_map + +#: Specify entries for various menus in kitty. Currently only the +#: global menubar on macOS is supported. For example:: + +#: menu_map global "Actions::Launch something special" launch --hold --type=os-window sh -c "echo hello world" + +#: This will create a menu entry named "Launch something special" in +#: an "Actions" menu in the macOS global menubar. Sub-menus can be +#: created by adding more levels separated by the :: characters. + +#: }}} + +#: OS specific tweaks {{{ + +# wayland_titlebar_color system + +#: The color of the kitty window's titlebar on Wayland systems with +#: client side window decorations such as GNOME. A value of system +#: means to use the default system colors, a value of background means +#: to use the background color of the currently active kitty window +#: and finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: The color of the kitty window's titlebar on macOS. A value of +#: system means to use the default system color, light or dark can +#: also be used to set it explicitly. A value of background means to +#: use the background color of the currently active window and finally +#: you can use an arbitrary color, such as #12af59 or red. WARNING: +#: This option works by using a hack when arbitrary color (or +#: background) is configured, as there is no proper Cocoa API for it. +#: It sets the background color of the entire window and makes the +#: titlebar transparent. As such it is incompatible with +#: background_opacity. If you want to use both, you are probably +#: better off just hiding the titlebar with hide_window_decorations. + +# macos_option_as_alt no + +#: Use the Option key as an Alt key on macOS. With this set to no, +#: kitty will use the macOS native Option+Key to enter Unicode +#: character behavior. This will break any Alt+Key keyboard shortcuts +#: in your terminal programs, but you can use the macOS Unicode input +#: technique. You can use the values: left, right or both to use only +#: the left, right or both Option keys as Alt, instead. Note that +#: kitty itself always treats Option the same as Alt. This means you +#: cannot use this option to configure different kitty shortcuts for +#: Option+Key vs. Alt+Key. Also, any kitty shortcuts using +#: Option/Alt+Key will take priority, so that any such key presses +#: will not be passed to terminal programs running inside kitty. +#: Changing this option by reloading the config is not supported. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks on macOS (⌘+Tab and the +#: Dock). Changing this option by reloading the config is not +#: supported. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed on macOS. +#: By default, kitty will stay running, even with no open windows, as +#: is the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level OS windows to not be +#: resizable on macOS. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes on macOS. For example, a +#: value of 0.75 will result in rendering that looks similar to sub- +#: pixel antialiasing at common font sizes. Note that in modern kitty, +#: this option is obsolete (although still supported). Consider using +#: text_composition_strategy instead. + +# macos_traditional_fullscreen no + +#: Use the macOS traditional full-screen transition, that is faster, +#: but less pretty. + +# macos_show_window_title_in all + +#: Control where the window title is displayed on macOS. A value of +#: window will show the title of the currently active window at the +#: top of the macOS window. A value of menubar will show the title of +#: the currently active window in the macOS global menu bar, making +#: use of otherwise wasted space. A value of all will show the title +#: in both places, and none hides the title. See +#: macos_menubar_title_max_length for how to control the length of the +#: title in the menu bar. + +# macos_menubar_title_max_length 0 + +#: The maximum number of characters from the window title to show in +#: the macOS global menu bar. Values less than one means that there is +#: no maximum limit. + +# macos_custom_beam_cursor no + +#: Use a custom mouse cursor for macOS that is easier to see on both +#: light and dark backgrounds. Nowadays, the default macOS cursor +#: already comes with a white border. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. Changing this option +#: by reloading the config is not supported. + +# macos_colorspace srgb + +#: The colorspace in which to interpret terminal colors. The default +#: of srgb will cause colors to match those seen in web browsers. The +#: value of default will use whatever the native colorspace of the +#: display is. The value of displayp3 will use Apple's special +#: snowflake display P3 color space, which will result in over +#: saturated (brighter) colors with some color shift. Reloading +#: configuration will change this value only for newly created OS +#: windows. + +# linux_display_server auto + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. Changing this option by +#: reloading the config is not supported. + +# wayland_enable_ime yes + +#: Enable Input Method Extension on Wayland. This is typically used +#: for inputting text in East Asian languages. However, its +#: implementation in Wayland is often buggy and introduces latency +#: into the input loop, so disable this if you know you dont need it. +#: Changing this option by reloading the config is not supported, it +#: will not have any effect. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase Unicode characters. +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape, the names are +#: present at Functional key definitions +#: . +#: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt +#: (opt, option, ⌥), super (cmd, command, ⌘). + +#: Simple shortcut mapping is done with the map directive. For full +#: details on advanced mapping including modal and per application +#: maps, see mapping . Some +#: quick examples to illustrate common tasks:: + +#: # unmap a keyboard shortcut, passing it to the program running in kitty +#: map kitty_mod+space +#: # completely ignore a keyboard event +#: map ctrl+alt+f1 discard_event +#: # combine multiple actions +#: map kitty_mod+e combine : new_window : next_layout +#: # multi-key shortcuts +#: map ctrl+x>ctrl+y>z action + +#: The full list of actions that can be mapped to key presses is +#: available here . + +# kitty_mod ctrl+shift + +#: Special modifier key alias for default shortcuts. You can change +#: the value of this option to alter all default shortcuts that use +#: kitty_mod. + +# clear_all_shortcuts no + +#: Remove all shortcut definitions up to this point. Useful, for +#: instance, to remove the default shortcuts. + +# action_alias + +#: E.g. action_alias launch_tab launch --type=tab --cwd=current + +#: Define action aliases to avoid repeating the same options in +#: multiple mappings. Aliases can be defined for any action and will +#: be expanded recursively. For example, the above alias allows you to +#: create mappings to launch a new tab in the current working +#: directory without duplication:: + +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +#: Similarly, to alias kitten invocation:: + +#: action_alias hints kitten hints --hints-offset=0 + +# kitten_alias + +#: E.g. kitten_alias hints hints --hints-offset=0 + +#: Like action_alias above, but specifically for kittens. Generally, +#: prefer to use action_alias. This option is a legacy version, +#: present for backwards compatibility. It causes all invocations of +#: the aliased kitten to be substituted. So the example above will +#: cause all invocations of the hints kitten to have the --hints- +#: offset=0 option applied. + +#: Clipboard {{{ + +#: Copy to clipboard + +# map kitty_mod+c copy_to_clipboard +# map cmd+c copy_to_clipboard + +#:: There is also a copy_or_interrupt action that can be optionally +#:: mapped to Ctrl+C. It will copy only if there is a selection and +#:: send an interrupt otherwise. Similarly, +#:: copy_and_clear_or_interrupt will copy and clear the selection or +#:: send an interrupt if there is no selection. + +#: Paste from clipboard + +# map kitty_mod+v paste_from_clipboard +# map cmd+v paste_from_clipboard + +#: Paste from selection + +# map kitty_mod+s paste_from_selection +# map shift+insert paste_from_selection + +#: Pass selection to program + +# map kitty_mod+o pass_selection_to_program + +#:: You can also pass the contents of the current selection to any +#:: program with pass_selection_to_program. By default, the system's +#:: open program is used, but you can specify your own, the selection +#:: will be passed as a command line argument to the program. For +#:: example:: + +#:: map kitty_mod+o pass_selection_to_program firefox + +#:: You can pass the current selection to a terminal program running +#:: in a new kitty window, by using the @selection placeholder:: + +#:: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +#: Scroll line up + +# map kitty_mod+up scroll_line_up +# map kitty_mod+k scroll_line_up +# map opt+cmd+page_up scroll_line_up +# map cmd+up scroll_line_up + +#: Scroll line down + +# map kitty_mod+down scroll_line_down +# map kitty_mod+j scroll_line_down +# map opt+cmd+page_down scroll_line_down +# map cmd+down scroll_line_down + +#: Scroll page up + +# map kitty_mod+page_up scroll_page_up +# map cmd+page_up scroll_page_up + +#: Scroll page down + +# map kitty_mod+page_down scroll_page_down +# map cmd+page_down scroll_page_down + +#: Scroll to top + +# map kitty_mod+home scroll_home +# map cmd+home scroll_home + +#: Scroll to bottom + +# map kitty_mod+end scroll_end +# map cmd+end scroll_end + +#: Scroll to previous shell prompt + +# map kitty_mod+z scroll_to_prompt -1 + +#:: Use a parameter of 0 for scroll_to_prompt to scroll to the last +#:: jumped to or the last clicked position. Requires shell +#:: integration +#:: to work. + +#: Scroll to next shell prompt + +# map kitty_mod+x scroll_to_prompt 1 + +#: Browse scrollback buffer in pager + +# map kitty_mod+h show_scrollback + +#:: You can pipe the contents of the current screen and history +#:: buffer as STDIN to an arbitrary program using launch --stdin- +#:: source. For example, the following opens the scrollback buffer in +#:: less in an overlay window:: + +#:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#:: For more details on piping screen and buffer contents to external +#:: programs, see launch . + +#: Browse output of the last shell command in pager + +# map kitty_mod+g show_last_command_output + +#:: You can also define additional shortcuts to get the command +#:: output. For example, to get the first command output on screen:: + +#:: map f1 show_first_command_output_on_screen + +#:: To get the command output that was last accessed by a keyboard +#:: action or mouse action:: + +#:: map f1 show_last_visited_command_output + +#:: You can pipe the output of the last command run in the shell +#:: using the launch action. For example, the following opens the +#:: output in less in an overlay window:: + +#:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R + +#:: To get the output of the first command on the screen, use +#:: @first_cmd_output_on_screen. To get the output of the last jumped +#:: to command, use @last_visited_cmd_output. + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: Window management {{{ + +#: New window + +# map kitty_mod+enter new_window +# map cmd+enter new_window + +#:: You can open a new kitty window running an arbitrary program, for +#:: example:: + +#:: map kitty_mod+y launch mutt + +#:: You can open a new window with the current working directory set +#:: to the working directory of the current window using:: + +#:: map ctrl+alt+enter launch --cwd=current + +#:: You can open a new window that is allowed to control kitty via +#:: the kitty remote control facility with launch --allow-remote- +#:: control. Any programs running in that window will be allowed to +#:: control kitty. For example:: + +#:: map ctrl+enter launch --allow-remote-control some_program + +#:: You can open a new window next to the currently active window or +#:: as the first window, with:: + +#:: map ctrl+n launch --location=neighbor +#:: map ctrl+f launch --location=first + +#:: For more details, see launch +#:: . + +#: New OS window + +# map kitty_mod+n new_os_window +# map cmd+n new_os_window + +#:: Works like new_window above, except that it opens a top-level OS +#:: window. In particular you can use new_os_window_with_cwd to open +#:: a window with the current working directory. + +#: Close window + +# map kitty_mod+w close_window +# map shift+cmd+d close_window + +#: Next window + +# map kitty_mod+] next_window + +#: Previous window + +# map kitty_mod+[ previous_window + +#: Move window forward + +# map kitty_mod+f move_window_forward + +#: Move window backward + +# map kitty_mod+b move_window_backward + +#: Move window to top + +# map kitty_mod+` move_window_to_top + +#: Start resizing window + +# map kitty_mod+r start_resizing_window +# map cmd+r start_resizing_window + +#: First window + +# map kitty_mod+1 first_window +# map cmd+1 first_window + +#: Second window + +# map kitty_mod+2 second_window +# map cmd+2 second_window + +#: Third window + +# map kitty_mod+3 third_window +# map cmd+3 third_window + +#: Fourth window + +# map kitty_mod+4 fourth_window +# map cmd+4 fourth_window + +#: Fifth window + +# map kitty_mod+5 fifth_window +# map cmd+5 fifth_window + +#: Sixth window + +# map kitty_mod+6 sixth_window +# map cmd+6 sixth_window + +#: Seventh window + +# map kitty_mod+7 seventh_window +# map cmd+7 seventh_window + +#: Eighth window + +# map kitty_mod+8 eighth_window +# map cmd+8 eighth_window + +#: Ninth window + +# map kitty_mod+9 ninth_window +# map cmd+9 ninth_window + +#: Tenth window + +# map kitty_mod+0 tenth_window + +#: Visually select and focus window + +# map kitty_mod+f7 focus_visible_window + +#:: Display overlay numbers and alphabets on the window, and switch +#:: the focus to the window when you press the key. When there are +#:: only two windows, the focus will be switched directly without +#:: displaying the overlay. You can change the overlay characters and +#:: their order with option visual_window_select_characters. + +#: Visually swap window with another + +# map kitty_mod+f8 swap_with_window + +#:: Works like focus_visible_window above, but swaps the window. + +#: }}} + +#: Tab management {{{ + +#: Next tab + +# map kitty_mod+right next_tab +# map shift+cmd+] next_tab +# map ctrl+tab next_tab + +#: Previous tab + +# map kitty_mod+left previous_tab +# map shift+cmd+[ previous_tab +# map ctrl+shift+tab previous_tab + +#: New tab + +# map kitty_mod+t new_tab +# map cmd+t new_tab + +#: Close tab + +# map kitty_mod+q close_tab +# map cmd+w close_tab + +#: Close OS window + +# map shift+cmd+w close_os_window + +#: Move tab forward + +# map kitty_mod+. move_tab_forward + +#: Move tab backward + +# map kitty_mod+, move_tab_backward + +#: Set tab title + +# map kitty_mod+alt+t set_tab_title +# map shift+cmd+i set_tab_title + + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, -2 being the tab active before the previously active tab and +#: so on. Any number larger than the number of tabs goes to the last +#: tab and any number less than the number of previously used tabs in +#: the history goes to the oldest previously used tab in the history:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and new_tab_with_cwd. +#: Finally, if you want the new tab to open next to the current tab +#: rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +#: Next layout + +# map kitty_mod+l next_layout + + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout + +#: There is also a toggle_layout action that switches to the named +#: layout or back to the previous layout if in the named layout. +#: Useful to temporarily "zoom" the active window by switching to the +#: stack layout:: + +#: map ctrl+alt+z toggle_layout stack +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +#: Increase font size + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+plus change_font_size all +2.0 +# map kitty_mod+kp_add change_font_size all +2.0 +# map cmd+plus change_font_size all +2.0 +# map cmd+equal change_font_size all +2.0 +# map shift+cmd+equal change_font_size all +2.0 + +#: Decrease font size + +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+kp_subtract change_font_size all -2.0 +# map cmd+minus change_font_size all -2.0 +# map shift+cmd+minus change_font_size all -2.0 + +#: Reset font size + +# map kitty_mod+backspace change_font_size all 0 +# map cmd+0 change_font_size all 0 + + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +#: Open URL + +# map kitty_mod+e open_url_with_hints + +#:: Open a currently visible URL using the keyboard. The program used +#:: to open the URL is specified in open_url_with. + +#: Insert selected path + +# map kitty_mod+p>f kitten hints --type path --program - + +#:: Select a path/filename and insert it into the terminal. Useful, +#:: for instance to run git commands on a filename output from a +#:: previous git command. + +#: Open selected path + +# map kitty_mod+p>shift+f kitten hints --type path + +#:: Select a path/filename and open it with the default open program. + +#: Insert selected line + +# map kitty_mod+p>l kitten hints --type line --program - + +#:: Select a line of text and insert it into the terminal. Useful for +#:: the output of things like: `ls -1`. + +#: Insert selected word + +# map kitty_mod+p>w kitten hints --type word --program - + +#:: Select words and insert into terminal. + +#: Insert selected hash + +# map kitty_mod+p>h kitten hints --type hash --program - + +#:: Select something that looks like a hash and insert it into the +#:: terminal. Useful with git, which uses SHA1 hashes to identify +#:: commits. + +#: Open the selected file at the selected line + +# map kitty_mod+p>n kitten hints --type linenum + +#:: Select something that looks like filename:linenum and open it in +#:: your default editor at the specified line number. + +#: Open the selected hyperlink + +# map kitty_mod+p>y kitten hints --type hyperlink + +#:: Select a hyperlink (i.e. a URL that has been marked as such by +#:: the terminal program, for example, by `ls --hyperlink=auto`). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see hints kitten +#: . +#: }}} + +#: Miscellaneous {{{ + +#: Show documentation + +# map kitty_mod+f1 show_kitty_doc overview + +#: Toggle fullscreen + +# map kitty_mod+f11 toggle_fullscreen +# map ctrl+cmd+f toggle_fullscreen + +#: Toggle maximized + +# map kitty_mod+f10 toggle_maximized + +#: Toggle macOS secure keyboard entry + +# map opt+cmd+s toggle_macos_secure_keyboard_entry + +#: Unicode input + +# map kitty_mod+u kitten unicode_input +# map ctrl+cmd+space kitten unicode_input + +#: Edit config file + +# map kitty_mod+f2 edit_config_file +# map cmd+, edit_config_file + +#: Open the kitty command shell + +# map kitty_mod+escape kitty_shell window + +#:: Open the kitty shell in a new window / tab / overlay / os_window +#:: to control kitty using commands. + +#: Increase background opacity + +# map kitty_mod+a>m set_background_opacity +0.1 + +#: Decrease background opacity + +# map kitty_mod+a>l set_background_opacity -0.1 + +#: Make background fully opaque + +# map kitty_mod+a>1 set_background_opacity 1 + +#: Reset background opacity + +# map kitty_mod+a>d set_background_opacity default + +#: Reset the terminal + +# map kitty_mod+delete clear_terminal reset active +# map opt+cmd+r clear_terminal reset active + +#:: You can create shortcuts to clear/reset the terminal. For +#:: example:: + +#:: # Reset the terminal +#:: map f1 clear_terminal reset active +#:: # Clear the terminal screen by erasing all contents +#:: map f1 clear_terminal clear active +#:: # Clear the terminal scrollback by erasing it +#:: map f1 clear_terminal scrollback active +#:: # Scroll the contents of the screen into the scrollback +#:: map f1 clear_terminal scroll active +#:: # Clear everything on screen up to the line with the cursor or the start of the current prompt (needs shell integration) +#:: map f1 clear_terminal to_cursor active +#:: # Same as above except cleared lines are moved into scrollback +#:: map f1 clear_terminal to_cursor_scroll active + +#:: If you want to operate on all kitty windows instead of just the +#:: current one, use all instead of active. + +#:: Some useful functions that can be defined in the shell rc files +#:: to perform various kinds of clearing of the current window: + +#:: .. code-block:: sh + +#:: clear-only-screen() { +#:: printf "\e[H\e[2J" +#:: } + +#:: clear-screen-and-scrollback() { +#:: printf "\e[H\e[3J" +#:: } + +#:: clear-screen-saving-contents-in-scrollback() { +#:: printf "\e[H\e[22J" +#:: } + +#:: For instance, using these escape codes, it is possible to remap +#:: Ctrl+L to both scroll the current screen contents into the +#:: scrollback buffer and clear the screen, instead of just clearing +#:: the screen. For ZSH, in ~/.zshrc, add: + +#:: .. code-block:: zsh + +#:: ctrl_l() { +#:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" +#:: builtin zle .reset-prompt +#:: builtin zle -R +#:: } +#:: zle -N ctrl_l +#:: bindkey '^l' ctrl_l + +#:: Alternatively, you can just add map ctrl+l clear_terminal +#:: to_cursor_scroll active to kitty.conf which works with no changes +#:: to the shell rc files, but only clears up to the prompt, it does +#:: not clear anytext at the prompt itself. + +#: Clear up to cursor line + +# map cmd+k clear_terminal to_cursor active + +#: Reload kitty.conf + +# map kitty_mod+f5 load_config_file +# map ctrl+cmd+, load_config_file + +#:: Reload kitty.conf, applying any changes since the last time it +#:: was loaded. Note that a handful of options cannot be dynamically +#:: changed and require a full restart of kitty. Particularly, when +#:: changing shortcuts for actions located on the macOS global menu +#:: bar, a full restart is needed. You can also map a keybinding to +#:: load a different config file, for example:: + +#:: map f5 load_config /path/to/alternative/kitty.conf + +#:: Note that all options from the original kitty.conf are discarded, +#:: in other words the new configuration *replace* the old ones. + +#: Debug kitty configuration + +# map kitty_mod+f6 debug_config +# map opt+cmd+, debug_config + +#:: Show details about exactly what configuration kitty is running +#:: with and its host environment. Useful for debugging issues. + +#: Send arbitrary text on key presses + +#:: E.g. map ctrl+shift+alt+h send_text all Hello World + +#:: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#:: client program when pressing specified shortcut keys. For +#:: example:: + +#:: map ctrl+alt+a send_text all Special text + +#:: This will send "Special text" when you press the Ctrl+Alt+A key +#:: combination. The text to be sent decodes ANSI C escapes +#:: so you can use escapes like \e to send control +#:: codes or \u21fb to send Unicode characters (or you can just input +#:: the Unicode characters directly as UTF-8 text). You can use +#:: `kitten show-key` to get the key escape codes you want to +#:: emulate. + +#:: The first argument to send_text is the keyboard modes in which to +#:: activate the shortcut. The possible values are normal, +#:: application, kitty or a comma separated combination of them. The +#:: modes normal and application refer to the DECCKM cursor key mode +#:: for terminals, and kitty refers to the kitty extended keyboard +#:: protocol. The special value all means all of them. + +#:: Some more examples:: + +#:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) +#:: map ctrl+alt+a send_text normal Word\e[H +#:: map ctrl+alt+a send_text application Word\eOH +#:: # Run a command at a shell prompt (like typing the command and pressing Enter) +#:: map ctrl+alt+a send_text normal,application some command with arguments\r + +#: Open kitty Website + +# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ + +#: Hide macOS kitty application + +# map cmd+h hide_macos_app + +#: Hide macOS other applications + +# map opt+cmd+h hide_macos_other_apps + +#: Minimize macOS window + +# map cmd+m minimize_macos_window + +#: Quit kitty + +# map cmd+q quit + +#: }}} + +#: }}} diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf new file mode 100644 index 0000000..560973f --- /dev/null +++ b/.config/mpd/mpd.conf @@ -0,0 +1,403 @@ +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the +# available audio files and add them to the daemon's online database. This +# setting defaults to the XDG directory, otherwise the music directory will be +# be disabled and audio files will only be accepted over ipc socket (using +# file:// protocol) or streaming files over an accepted protocol. +# +#music_directory "$XDG_MUSIC_DIR" +music_directory "$XDG_MUSIC_DIR" +# +# This setting sets the MPD internal playlist directory. The purpose of this +# directory is storage for playlists created by MPD. The server will use +# playlist files not created by the server but only if they are in the MPD +# format. This setting defaults to playlist saving being disabled. +# +playlist_directory "$XDG_CONFIG_HOME/mpd/playlists" +#playlist_directory "~/.mpd/playlists" +# +# This setting sets the location of the MPD database. This file is used to +# load the database at server start up and store the database while the +# server is not up. This setting defaults to disabled which will allow +# MPD to accept files over ipc socket (using file:// protocol) or streaming +# files over an accepted protocol. +# +db_file "$XDG_CACHE_HOME/mpd/database" +#db_file "~/.mpd/database" + +# These settings are the locations for the daemon log files for the daemon. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +# If you use systemd, do not configure a log_file. With systemd, MPD +# defaults to the systemd journal, which is fine. +# +#log_file "$XDG_CACHE_HOME/mpd/log" +#log_file "~/.mpd/log" + +# This setting sets the location of the file which stores the process ID +# for use of mpd --kill and some init scripts. This setting is disabled by +# default and the pid file will not be stored. +# +# If you use systemd, do not configure a pid_file. +# +pid_file "$XDG_RUNTIME_DIR/mpd/mpd.pid" +#pid_file "~/.mpd/pid" + +# This setting sets the location of the file which contains information about +# most variables to get MPD back into the same general shape it was in before +# it was brought down. This setting is disabled by default and the server +# state will be reset on server start up. +# +#state_file "$XDG_RUNTIME_DIR/mpd/state" +#state_file "~/.mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +sticker_file "$XDG_CACHE_HOME/sticker.sql" +#sticker_file "~/.mpd/sticker.sql" +# +############################################################################### + + +# General music daemon options ################################################ +# +# This setting specifies the user that MPD will run as. MPD should never run as +# root and you may use this setting to make MPD change its user ID after +# initialization. This setting is disabled by default and MPD is run as the +# current user. +# +#user "nobody" +# +# This setting specifies the group that MPD will run as. If not specified +# primary group of user specified with "user" setting will be used (if set). +# This is useful if MPD needs to be a member of group such as "audio" to +# have permission to use sound card. +# +#group "nogroup" +# +# This setting sets the address for the daemon to listen on. Careful attention +# should be paid if this is assigned to anything other than the default, any. +# This setting can deny access to control of the daemon. Not effective if +# systemd socket activation is in use. +# +# For network +bind_to_address "localhost" +# +# And for Unix Socket +#bind_to_address "$XDG_RUNTIME_DIR/mpd/socket" +#bind_to_address "~/.mpd/socket" +# +# This setting is the TCP port that is desired for the daemon to get assigned +# to. +# +port "6600" +# +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", +# "warning" and "error". +# +#log_level "notice" +# +# Setting "restore_paused" to "yes" puts MPD into pause mode instead +# of starting playback after startup. +# +#restore_paused "no" +# +# This setting enables MPD to create playlists in a format usable by other +# music players. +# +#save_absolute_paths_in_playlists "no" +# +# This setting defines a list of tag types that will be extracted during the +# audio file discovery process. The complete list of possible values can be +# found in the user manual. +#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +# +# This example just enables the "comment" tag without disabling all +# the other supported tags: +#metadata_to_use "+comment" +# +# This setting enables automatic update of MPD's database when files in +# music_directory are changed. +# +auto_update "yes" +# +# Limit the depth of the directories being watched, 0 means only watch +# the music directory itself. There is no limit by default. +# +#auto_update_depth "3" +# +############################################################################### + + +# Symbolic link behavior ###################################################### +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links outside of the configured music_directory. +# +follow_outside_symlinks "yes" +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links inside of the configured music_directory. +# +follow_inside_symlinks "yes" +# +############################################################################### + + +# Zeroconf / Avahi Service Discovery ########################################## +# +# If this setting is set to "yes", service information will be published with +# Zeroconf / Avahi. +# +#zeroconf_enabled "yes" +# +# The argument to this setting will be the Zeroconf / Avahi unique name for +# this MPD server on the network. %h will be replaced with the hostname. +# +#zeroconf_name "Music Player @ %h" +# +############################################################################### + + +# Permissions ################################################################# +# +# If this setting is set, MPD will require password authorization. The password +# setting can be specified multiple times for different password profiles. +# +#password "password@read,add,control,admin" +# +# This setting specifies the permissions a user has who has not yet logged in. +# +#default_permissions "read,add,control,admin" +# +############################################################################### + + +# Database ####################################################################### +# +# An example of a database section instead of the old 'db_file' setting. +# It enables mounting other storages into the music directory. +# +#database { +# plugin "simple" +# path "~/.local/share/mpd/db" +# cache_directory "~/.local/share/mpd/cache" +#} +# +# An example of database config for a satellite setup +# +#music_directory "nfs://fileserver.local/srv/mp3" +#database { +# plugin "proxy" +# host "other.mpd.host" +# port "6600" +#} + +# Input ####################################################################### +# +input { + plugin "curl" +# proxy "proxy.isp.com:8080" +# proxy_user "user" +# proxy_password "password" +} + +# +############################################################################### + +# Audio Output ################################################################ +# +# MPD supports various audio output types, as well as playing through multiple +# audio outputs at the same time, through multiple audio_output settings +# blocks. Setting this block is optional, though the server will only attempt +# autodetection for one sound card. +# +# An example of an ALSA output: +# +audio_output { + type "pulse" + name "My ALSA Device" +# device "hw:0,0" # optional + mixer_type "hardware" # optional +## mixer_device "default" # optional +## mixer_control "PCM" # optional +## mixer_index "0" # optional +} +# +# An example of an OSS output: +# +#audio_output { +# type "oss" +# name "My OSS Device" +## device "/dev/dsp" # optional +## mixer_type "hardware" # optional +## mixer_device "/dev/mixer" # optional +## mixer_control "PCM" # optional +#} +# +# An example of a shout output (for streaming to Icecast): +# +#audio_output { +# type "shout" +# encoder "vorbis" # optional +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" +# quality "5.0" +# bitrate "128" +# format "44100:16:1" +## protocol "icecast2" # optional +## user "source" # optional +## description "My Stream Description" # optional +## url "http://example.com" # optional +## genre "jazz" # optional +## public "no" # optional +## timeout "2" # optional +## mixer_type "software" # optional +#} +# +# An example of a recorder output: +# +#audio_output { +# type "recorder" +# name "My recorder" +# encoder "vorbis" # optional, vorbis or lame +# path "/var/lib/mpd/recorder/mpd.ogg" +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +#} +# +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} +# +# An example of a pulseaudio output (streaming to a remote pulseaudio server) +# +#audio_output { +# type "pulse" +# name "My Pulse Output" +# mixer_type "software" +## server "remote_server" # optional +## sink "remote_server_sink" # optional +## media_role "media_role" #optional +#} +# +# An example of a winmm output (Windows multimedia API). +# +#audio_output { +# type "winmm" +# name "My WinMM output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +#} +# +# An example of a wasapi output (Windows multimedia API). +# +#audio_output { +# type "wasapi" +# name "My WASAPI output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +## Exclusive mode blocks all other audio source, and get best audio quality without resampling. +## exclusive "no" # optional +## Enumerate all devices in log. +## enumerate "no" # optional +#} +# +# An example of an openal output. +# +#audio_output { +# type "openal" +# name "My OpenAL output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +#} +# +# An example of an sndio output. +# +#audio_output { +# type "sndio" +# name "sndio output" +# mixer_type "hardware" +#} +# +# An example of an OS X output: +# +#audio_output { +# type "osx" +# name "My OS X Device" +## device "Built-in Output" # optional +## channel_map "-1,-1,0,1" # optional +#} +# +## Example "pipe" output: +# +#audio_output { +# type "pipe" +# name "my pipe" +# command "aplay -f cd 2>/dev/null" +## Or if you're want to use AudioCompress +# command "AudioCompress -m | aplay -f cd 2>/dev/null" +## Or to send raw PCM stream through PCM: +# command "nc example.org 8765" +# format "44100:16:2" +#} +# +## An example of a null output (for no audio output): +# +#audio_output { +# type "null" +# name "My Null Output" +# mixer_type "none" # optional +#} +# +############################################################################### + + +# Normalization automatic volume adjustments ################################## +# +# This setting specifies the type of ReplayGain to use. This setting can have +# the argument "off", "album", "track" or "auto". "auto" is a special mode that +# chooses between "track" and "album" depending on the current state of +# random playback. If random playback is enabled then "track" mode is used. +# See for +# more details about ReplayGain. +# This setting is off by default. +# +#replaygain "album" +# +############################################################################### + +# Character Encoding ########################################################## +# +# If file or directory names do not display correctly for your locale then you +# may need to modify this setting. +# +#filesystem_charset "UTF-8" +# +############################################################################### diff --git a/.config/quickshell/Bar.qml b/.config/quickshell/Bar.qml new file mode 100644 index 0000000..01aa885 --- /dev/null +++ b/.config/quickshell/Bar.qml @@ -0,0 +1,463 @@ +import Quickshell +import Quickshell.Hyprland +import Quickshell.Widgets +import Quickshell.Services.SystemTray +import Quickshell.Io +import QtQuick + +PanelWindow { + id: bar + + required property var walColors + required property string motd + required property int notificationCount + required property var latestNotification + property var notifServer: null + required property SystemStats stats + required property string fontFamily + + // --- Notification toast state --- + property int _toastCounter: 0 + + onLatestNotificationChanged: { + if (latestNotification) { + toastModel.append({ + toastId: _toastCounter++, + appName: latestNotification.appName || "", + summary: latestNotification.summary || "", + body: latestNotification.body || "" + }) + } + } + + ListModel { + id: toastModel + } + + anchors { + top: true + left: true + right: true + } + + color: "transparent" + exclusionMode: ExclusionMode.Normal + exclusiveZone: 34 + implicitHeight: 34 + + // --- Theme colors --- + property color bgColor: (walColors.special && walColors.special.background) ? walColors.special.background : "#1d160d" + property color fgColor: (walColors.special && walColors.special.foreground) ? walColors.special.foreground : "#d8d8d3" + property color accentColor: (walColors.colors && walColors.colors.color1) ? walColors.colors.color1 : "#946F50" + property color accent2Color: (walColors.colors && walColors.colors.color2) ? walColors.colors.color2 : "#BA9351" + property color accent3Color: (walColors.colors && walColors.colors.color3) ? walColors.colors.color3 : "#BA9351" + property color accent4Color: (walColors.colors && walColors.colors.color4) ? walColors.colors.color4 : "#BA9351" + property color accent5Color: (walColors.colors && walColors.colors.color5) ? walColors.colors.color5 : "#BA9351" + property color accent6Color: (walColors.colors && walColors.colors.color6) ? walColors.colors.color6 : "#BA9351" + property color accent7Color: (walColors.colors && walColors.colors.color7) ? walColors.colors.color7 : "#BA9351" + + // --- Hyprland state --- + property var hyprMonitor: Hyprland.monitorFor(screen) + + property var monitorWorkspaces: { + let vals = Hyprland.workspaces.values + let result = [] + for (let i = 0; i < vals.length; i++) { + if (vals[i].monitor === hyprMonitor && vals[i].id > 0) + result.push(vals[i]) + } + return result.sort((a, b) => a.id - b.id) + } + + property bool specialWorkspaceVisible: false + + Connections { + target: Hyprland + function onRawEvent(event) { + if (event.name === "activespecial") { + let parts = event.data.split(",") + let monName = parts[parts.length - 1] + if (monName === hyprMonitor?.name) { + bar.specialWorkspaceVisible = parts[0] !== "" + } + } + } + } + + property string windowTitle: { + let title = Hyprland.activeToplevel?.title ?? "" + if (!title || title === "~" || title === "kitty" || title === "fish") + return motd + return title + } + + // --- Clock --- + SystemClock { + id: clock + precision: SystemClock.Minutes + } + + // --- Bar layout --- + Item { + anchors.fill: parent + anchors.margins: 2 + + // Left module group + Rectangle { + id: leftGroup + z: 1 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + height: 30 + width: leftContent.width + 8 + clip: true + color: bar.bgColor + border.color: bar.accentColor + border.width: 2 + radius: 100 + + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + Row { + id: leftContent + anchors.left: parent.left + anchors.leftMargin: 4 + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + Workspaces { + workspaces: bar.monitorWorkspaces + accentColor: bar.accentColor + fgColor: bar.fgColor + fontFamily: bar.fontFamily + anchors.verticalCenter: parent.verticalCenter + } + } + } + + // Special workspace badge + Rectangle { + id: specialBadge + z: 0 + anchors.verticalCenter: leftGroup.verticalCenter + height: 28 + width: specialText.implicitWidth + (bar.specialWorkspaceVisible ? 30 : 10) + topLeftRadius: 0 + bottomLeftRadius: 0 + topRightRadius: 100 + bottomRightRadius: 100 + color: bar.bgColor + border.color: bar.accentColor + border.width: 2 + visible: bar.specialWorkspaceVisible + + x: bar.specialWorkspaceVisible ? leftGroup.x + leftGroup.width - 10 : leftGroup.x + leftGroup.width - specialBadge.width + + Behavior on x { + NumberAnimation { duration: 200; easing.type: Easing.InOutCubic } + } + + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutCubic } + } + Text { + id: specialText + anchors.centerIn: parent + anchors.horizontalCenterOffset: 4 + text: "\uf2d2" + color: bar.fgColor + font.pixelSize: 11 + font.family: bar.fontFamily + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: Hyprland.dispatch("togglespecialworkspace magic") + } + } + + // Center module group + Rectangle { + id: centerGroup + anchors.centerIn: parent + height: 30 + width: centerContent.width + 16 + clip: true + color: bar.bgColor + border.color: bar.accentColor + border.width: 2 + radius: 100 + + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + Row { + id: centerContent + anchors.centerIn: parent + spacing: 12 + + Text { + text: bar.windowTitle + color: bar.fgColor + font.pixelSize: 13 + font.family: bar.fontFamily + elide: Text.ElideRight + width: Math.min(implicitWidth, 900) + anchors.verticalCenter: parent.verticalCenter + } + } + } + + // Notification toasts + Repeater { + model: toastModel + + delegate: NotificationToast { + bgColor: bar.bgColor + fgColor: bar.fgColor + accentColor: bar.accentColor + fontFamily: bar.fontFamily + rightAnchor: rightGroup + sourceModel: toastModel + } + } + + // Right module group + Rectangle { + id: rightGroup + z: 1 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + height: 30 + width: rightContent.width + 8 + clip: true + color: bar.bgColor + border.color: bar.accentColor + border.width: 2 + radius: 100 + + Behavior on x { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + Row { + id: rightContent + anchors.right: parent.right + anchors.rightMargin: 4 + anchors.verticalCenter: parent.verticalCenter + spacing: 5 + + // Notification count + Item { + id: notifBadgeWrapper + property real targetWidth: bar.notificationCount > 0 ? notifCountText.implicitWidth + 16 : 0 + height: 22 + width: targetWidth + clip: true + anchors.verticalCenter: parent.verticalCenter + visible: width > 0 + + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + Rectangle { + anchors.left: parent.left + height: 22 + width: notifCountText.implicitWidth + 16 + topLeftRadius: 100 + bottomLeftRadius: 100 + radius: parent.visible ? 4 : 100 + color: bar.accent7Color + + Behavior on radius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Text { + id: notifCountText + anchors.centerIn: parent + text: bar.notificationCount + " \uf0f3" + color: bar.bgColor + font.pixelSize: 13 + font.family: bar.fontFamily + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + if (!bar.notifServer) return + let notifs = bar.notifServer.trackedNotifications.values + for (let i = notifs.length - 1; i >= 0; i--) + notifs[i].dismiss() + } + } + } + } + + // Updates + BarPill { + id: updatesPill + fontFamily: bar.fontFamily + label: stats.updatesCount + (stats.updatesCount === 0 ? " \udb80\udca2" : " \udb84\udf77") + pillColor: bar.accent6Color + textColor: bar.bgColor + tooltipText: stats.updatesList || "Up to date" + topLeftRadius: bar.notificationCount > 0 ? 4 : 100 + bottomLeftRadius: bar.notificationCount > 0 ? 4 : 100 + + Behavior on topLeftRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on bottomLeftRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + cursorShape: Qt.PointingHandCursor + onClicked: mouse => { + if (mouse.button === Qt.RightButton) + stats.checkUpdates() + else + updateProc.running = true + } + } + + Process { + id: updateProc + command: ["kitty", "--title", "System Update", "-e", "bash", "-c", "yay && echo 'Update completed successfully!' || { echo 'Update failed! Press any key to close...'; read -n 1; }"] + } + } + + // CPU + BarPill { + fontFamily: bar.fontFamily + label: stats.cpuUsage + "% \uf2db" + pillColor: bar.accent5Color + textColor: bar.bgColor + } + + // Memory + BarPill { + id: memPill + fontFamily: bar.fontFamily + label: stats.memUsage + "% \uf0c9" + pillColor: bar.accent4Color + textColor: bar.bgColor + tooltipText: stats.memInfo + } + + // Temperature + BarPill { + id: tempPill + fontFamily: bar.fontFamily + label: { + let t = stats.temperature + let icon = t >= 80 ? "\uf2c7" : "\uf2c9" + return t + "\u00b0C " + icon + } + pillColor: bar.accent3Color + textColor: bar.bgColor + tooltipText: stats.cpuTemps || "No sensors" + } + + // Clock + BarPill { + id: clockPill + fontFamily: bar.fontFamily + label: Qt.formatDateTime(clock.date, "hh:mm") + pillColor: bar.accent2Color + textColor: bar.bgColor + tooltipText: Qt.formatDateTime(clock.date, "dddd, MMMM d, yyyy") + } + + // System tray + Rectangle { + height: 22 + width: trayRow.width + 16 + topLeftRadius: 4 + bottomLeftRadius: 4 + topRightRadius: 100 + bottomRightRadius: 100 + color: bar.accentColor + anchors.verticalCenter: parent.verticalCenter + + Row { + id: trayRow + anchors.centerIn: parent + spacing: 6 + + Repeater { + model: SystemTray.items + + delegate: Item { + id: trayDelegate + required property var modelData + + width: 16 + height: 16 + anchors.verticalCenter: parent.verticalCenter + + Image { + anchors.fill: parent + source: modelData.icon + sourceSize.width: 16 + sourceSize.height: 16 + fillMode: Image.PreserveAspectFit + } + + QsMenuAnchor { + id: menuAnchor + menu: modelData.menu + anchor.window: bar + anchor.rect.x: trayDelegate.mapToItem(bar.contentItem, 0, 0).x + anchor.rect.y: trayDelegate.mapToItem(bar.contentItem, 0, 0).y + anchor.rect.width: trayDelegate.width + anchor.rect.height: trayDelegate.height + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: mouse => { + if (mouse.button === Qt.RightButton) + menuAnchor.open() + else + modelData.activate() + } + } + } + } + } + } + } + } + } + + // --- Tooltips --- + BarTooltip { + bgColor: bar.bgColor; fgColor: bar.fgColor; borderColor: bar.accentColor; fontFamily: bar.fontFamily + target: updatesPill; text: updatesPill.tooltipText + } + BarTooltip { + bgColor: bar.bgColor; fgColor: bar.fgColor; borderColor: bar.accentColor; fontFamily: bar.fontFamily + target: memPill; text: memPill.tooltipText + } + BarTooltip { + bgColor: bar.bgColor; fgColor: bar.fgColor; borderColor: bar.accentColor; fontFamily: bar.fontFamily + target: tempPill; text: tempPill.tooltipText + } + BarTooltip { + bgColor: bar.bgColor; fgColor: bar.fgColor; borderColor: bar.accentColor; fontFamily: bar.fontFamily + target: clockPill; text: clockPill.tooltipText + } +} diff --git a/.config/quickshell/BarPill.qml b/.config/quickshell/BarPill.qml new file mode 100644 index 0000000..563e7fa --- /dev/null +++ b/.config/quickshell/BarPill.qml @@ -0,0 +1,44 @@ +import QtQuick + +Rectangle { + id: pill + + required property string label + required property color pillColor + required property color textColor + + required property string fontFamily + property string tooltipText: "" + property bool hovered: hoverArea.containsMouse + + property alias font: pillText.font + property real textSize: 13 + + signal clicked() + + height: 22 + width: pillText.implicitWidth + 16 + radius: 4 + color: pillColor + anchors.verticalCenter: parent?.verticalCenter + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + Text { + id: pillText + anchors.centerIn: parent + text: pill.label + color: pill.textColor + font.pixelSize: pill.textSize + font.family: pill.fontFamily + } + + MouseArea { + id: hoverArea + anchors.fill: parent + hoverEnabled: pill.tooltipText !== "" + cursorShape: Qt.ArrowCursor + onClicked: pill.clicked() + } +} diff --git a/.config/quickshell/BarTooltip.qml b/.config/quickshell/BarTooltip.qml new file mode 100644 index 0000000..da79fbb --- /dev/null +++ b/.config/quickshell/BarTooltip.qml @@ -0,0 +1,41 @@ +import Quickshell +import QtQuick + +PopupWindow { + id: tooltip + + required property color bgColor + required property color fgColor + required property color borderColor + required property string fontFamily + + property string text: "" + property Item target: null + + visible: text !== "" && target !== null && target.hovered + anchor.item: target + anchor.edges: Edges.Bottom + anchor.gravity: Edges.Bottom + anchor.adjustment: PopupAdjustment.SlideX + implicitWidth: tooltipContent.implicitWidth + 20 + implicitHeight: tooltipContent.implicitHeight + 14 + color: "transparent" + + Rectangle { + anchors.fill: parent + color: tooltip.bgColor + border.color: tooltip.borderColor + border.width: 2 + radius: 8 + + Text { + id: tooltipContent + anchors.centerIn: parent + text: tooltip.text + color: tooltip.fgColor + font.pixelSize: 12 + font.family: tooltip.fontFamily + lineHeight: 1.3 + } + } +} diff --git a/.config/quickshell/Base.qml b/.config/quickshell/Base.qml new file mode 100644 index 0000000..5265a52 --- /dev/null +++ b/.config/quickshell/Base.qml @@ -0,0 +1,49 @@ +import Quickshell +import Quickshell.Io +import QtQuick + +Scope { + id: base + + property var walColors: ({ + special: { background: "#1d160d", foreground: "#d8d8d3" }, + colors: { + color0: "#1d160d", color1: "#946F50", color2: "#BA9351", + color3: "#A28E62", color4: "#6E7986", color5: "#76878C", + color6: "#9FA4A4", color7: "#d8d8d3", color8: "#979793" + } + }) + + property string motd: "" + property string fontFamily: "HurmitNerdFontPropo" + + property SystemStats stats: SystemStats {} + + Process { + id: colorsProc + command: ["cat", "/home/candle/.cache/wal/colors.json"] + running: true + + stdout: StdioCollector { + onDataChanged: { + try { + let parsed = JSON.parse(text) + if (parsed && parsed.special) + base.walColors = parsed + } catch(e) {} + } + } + } + + Process { + id: motdProc + command: ["cat", "/home/candle/.MOTD"] + running: true + + stdout: StdioCollector { + onDataChanged: { + base.motd = text.trim() + } + } + } +} diff --git a/.config/quickshell/MusicController.qml b/.config/quickshell/MusicController.qml new file mode 100644 index 0000000..0c090c1 --- /dev/null +++ b/.config/quickshell/MusicController.qml @@ -0,0 +1,225 @@ +import Quickshell +import Quickshell.Services.Mpris +import QtQuick + +PanelWindow { + id: controller + + required property var walColors + required property string fontFamily + + property color bgColor: (walColors.special && walColors.special.background) ? walColors.special.background : "#1d160d" + property color fgColor: (walColors.special && walColors.special.foreground) ? walColors.special.foreground : "#d8d8d3" + property color accentColor: (walColors.colors && walColors.colors.color1) ? walColors.colors.color1 : "#946F50" + property color accent2Color: (walColors.colors && walColors.colors.color2) ? walColors.colors.color2 : "#BA9351" + property color accent3Color: (walColors.colors && walColors.colors.color3) ? walColors.colors.color3 : "#BA9351" + property color accent4Color: (walColors.colors && walColors.colors.color4) ? walColors.colors.color4 : "#BA9351" + property color accent5Color: (walColors.colors && walColors.colors.color5) ? walColors.colors.color5 : "#BA9351" + + anchors { + bottom: true + // right: true + } + + color: "transparent" + exclusionMode: ExclusionMode.Ignore + implicitHeight: 34 + implicitWidth: mainGroup.width + 8 + + property var player: { + let players = Mpris.players.values + if (!players || players.length === 0) return null + for (let i = 0; i < players.length; i++) { + if (players[i].playbackState === MprisPlaybackState.Playing) + return players[i] + } + return players[0] + } + + property bool hovered: hoverArea.containsMouse + + Item { + anchors.fill: parent + anchors.margins: 2 + + MouseArea { + id: hoverArea + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.NoButton + } + + Rectangle { + id: mainGroup + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + height: 30 + width: infoRow.width + 8 + clip: true + color: controller.bgColor + border.color: controller.accentColor + border.width: 2 + radius: 100 + + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + + // Track info (default view) + Row { + id: infoRow + anchors.right: parent.right + anchors.rightMargin: 4 + anchors.verticalCenter: parent.verticalCenter + spacing: 5 + visible: !controller.hovered + + BarPill { + id: trackInfoPill + fontFamily: controller.fontFamily + topLeftRadius: 100 + bottomLeftRadius: 100 + label: { + if (!controller.player) return "No Player" + let artist = controller.player.trackArtist || "" + let title = controller.player.trackTitle || "" + if (artist && title) return artist + " \u2022 " + title + if (title) return title + return controller.player.identity || "Unknown" + } + pillColor: controller.accent2Color + textColor: controller.bgColor + } + + BarPill { + fontFamily: controller.fontFamily + label: { + if (!controller.player) return "\uf04c" + if (controller.player.playbackState === MprisPlaybackState.Playing) return "\uf04b" + if (controller.player.playbackState === MprisPlaybackState.Paused) return "\uf04c" + return "\uf04d" + } + pillColor: controller.accentColor + textColor: controller.bgColor + topLeftRadius: 4 + bottomLeftRadius: 4 + topRightRadius: 100 + bottomRightRadius: 100 + } + } + + // Controls (hover view) + Row { + id: controlsRow + anchors.right: parent.right + anchors.rightMargin: 4 + anchors.verticalCenter: parent.verticalCenter + spacing: 5 + visible: controller.hovered + + property bool hasShuffle: controller.player && controller.player.shuffleSupported + property bool hasLoop: controller.player && controller.player.loopSupported + property int visibleCount: 3 + (hasShuffle ? 1 : 0) + (hasLoop ? 1 : 0) + property real totalSpacing: (visibleCount - 1) * spacing + property real pillWidth: visibleCount > 0 ? (infoRow.width - totalSpacing) / visibleCount : 40 + + BarPill { + fontFamily: controller.fontFamily + label: "\uf048" + pillColor: controller.accent5Color + textColor: controller.bgColor + width: controlsRow.pillWidth + topLeftRadius: 100 + bottomLeftRadius: 100 + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: if (controller.player && controller.player.canGoPrevious) controller.player.previous() + } + } + + BarPill { + fontFamily: controller.fontFamily + label: { + if (!controller.player) return "\uf04b" + return controller.player.playbackState === MprisPlaybackState.Playing ? "\uf04c" : "\uf04b" + } + pillColor: controller.accent3Color + textColor: controller.bgColor + width: controlsRow.pillWidth + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: if (controller.player && controller.player.canTogglePlaying) controller.player.togglePlaying() + } + } + + BarPill { + id: nextPill + fontFamily: controller.fontFamily + label: "\uf051" + pillColor: controller.accent4Color + textColor: controller.bgColor + width: controlsRow.pillWidth + topRightRadius: (!controlsRow.hasShuffle && !controlsRow.hasLoop) ? 100 : 4 + bottomRightRadius: (!controlsRow.hasShuffle && !controlsRow.hasLoop) ? 100 : 4 + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: if (controller.player && controller.player.canGoNext) controller.player.next() + } + } + + BarPill { + id: shufflePill + fontFamily: controller.fontFamily + label: "\uf074" + pillColor: controller.player && controller.player.shuffle ? controller.accent2Color : controller.accentColor + textColor: controller.bgColor + width: controlsRow.pillWidth + visible: controlsRow.hasShuffle + topRightRadius: !controlsRow.hasLoop ? 100 : 4 + bottomRightRadius: !controlsRow.hasLoop ? 100 : 4 + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: if (controller.player) controller.player.shuffle = !controller.player.shuffle + } + } + + BarPill { + fontFamily: controller.fontFamily + label: { + if (!controller.player) return "\uf01e" + if (controller.player.loopState === MprisLoopState.Track) return "\uf021" + return "\uf01e" + } + pillColor: controller.player && controller.player.loopState !== MprisLoopState.None ? controller.accent2Color : controller.accentColor + textColor: controller.bgColor + width: controlsRow.pillWidth + visible: controlsRow.hasLoop + topRightRadius: 100 + bottomRightRadius: 100 + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + if (!controller.player) return + if (controller.player.loopState === MprisLoopState.None) + controller.player.loopState = MprisLoopState.Playlist + else if (controller.player.loopState === MprisLoopState.Playlist) + controller.player.loopState = MprisLoopState.Track + else + controller.player.loopState = MprisLoopState.None + } + } + } + } + } + } +} diff --git a/.config/quickshell/NotificationToast.qml b/.config/quickshell/NotificationToast.qml new file mode 100644 index 0000000..e8d89d8 --- /dev/null +++ b/.config/quickshell/NotificationToast.qml @@ -0,0 +1,116 @@ +import QtQuick + +Rectangle { + id: toast + + required property int index + required property string appName + required property string summary + required property string body + required property int toastId + + required property color bgColor + required property color fgColor + required property color accentColor + required property string fontFamily + required property Item rightAnchor + required property var sourceModel + + z: 0 + y: rightAnchor.y + (rightAnchor.height - height) / 2 + height: 28 + width: contentRow.implicitWidth + 20 + color: bgColor + border.color: accentColor + border.width: 2 + topLeftRadius: 100 + bottomLeftRadius: 100 + visible: false + + property bool showing: false + + Component.onCompleted: { + visible = true + showing = true + hideTimer.start() + } + + x: showing ? rightAnchor.x - width + 30 : rightAnchor.x + + Behavior on x { + id: xBehavior + enabled: toast.showing + NumberAnimation { + duration: 400 + easing.type: Easing.InOutCubic + onRunningChanged: { + if (!running && !toast.showing) { + toast.visible = false + toast.sourceModel.remove(toast.index) + } + } + } + } + + Timer { + id: hideTimer + interval: 5000 + onTriggered: { + xBehavior.enabled = true + toast.showing = false + } + } + + Row { + id: contentRow + anchors.centerIn: parent + spacing: 8 + + Text { + text: toast.appName + color: toast.accentColor + font.pixelSize: 11 + font.family: toast.fontFamily + font.bold: true + visible: toast.appName !== "" + anchors.verticalCenter: parent.verticalCenter + } + + Text { + text: toast.summary + color: toast.fgColor + font.pixelSize: 13 + font.family: toast.fontFamily + elide: Text.ElideRight + width: Math.min(implicitWidth, 300) + anchors.verticalCenter: parent.verticalCenter + } + + Text { + text: toast.body + color: Qt.rgba(toast.fgColor.r, toast.fgColor.g, toast.fgColor.b, 0.7) + font.pixelSize: 11 + font.family: toast.fontFamily + elide: Text.ElideRight + width: Math.min(implicitWidth, 200) + visible: toast.body !== "" && toast.body !== toast.summary + anchors.verticalCenter: parent.verticalCenter + } + + Rectangle { + height: 18 + width: 20 + color: toast.bgColor + } + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + hideTimer.stop() + xBehavior.enabled = true + toast.showing = false + } + } +} diff --git a/.config/quickshell/PhotoGallery.qml b/.config/quickshell/PhotoGallery.qml new file mode 100644 index 0000000..47a47f0 --- /dev/null +++ b/.config/quickshell/PhotoGallery.qml @@ -0,0 +1,131 @@ +import Quickshell +import QtQuick +import Quickshell.Io + +FloatingWindow { + id: gallery + + required property var walColors + + property color bgColor: (walColors.special && walColors.special.background) ? walColors.special.background : "#1d160d" + property color accentColor: (walColors.colors && walColors.colors.color1) ? walColors.colors.color1 : "#946F50" + + title: "Photo Gallery" + color: "transparent" + implicitWidth: 300 + implicitHeight: 600 + + required property string photosPath + property var photoFiles: [] + property int currentIndex: -1 + property int nextIndex: -1 + + // Slide direction: 0 = from left, 1 = from right + property int slideDirection: 0 + + // Track which image layer is on top + property bool showingFront: true + + Process { + id: listProc + command: ["bash", "-c", "find " + gallery.photosPath + " -maxdepth 1 -type f \\( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.webp' \\) | sort"] + running: true + + stdout: StdioCollector { + onDataChanged: { + let lines = text.trim().split("\n").filter(l => l.length > 0) + gallery.photoFiles = lines + if (lines.length > 0) { + gallery.currentIndex = Math.floor(Math.random() * lines.length) + } + } + } + } + + Timer { + id: cycleTimer + interval: 5000 + running: gallery.photoFiles.length > 1 + repeat: true + onTriggered: gallery.pickNext() + } + + function pickNext() { + if (photoFiles.length < 2) return + + let idx + do { + idx = Math.floor(Math.random() * photoFiles.length) + } while (idx === currentIndex) + + nextIndex = idx + slideDirection = Math.floor(Math.random() * 4) + showingFront = !showingFront + + let incoming = showingFront ? frontImage : backImage + let outgoing = showingFront ? backImage : frontImage + + // Stop any running animations and reset positions + incoming.x = 0; incoming.y = 0 + outgoing.x = 0; outgoing.y = 0 + + incoming.source = "file://" + photoFiles[nextIndex] + incoming.z = 1 + outgoing.z = 0 + + let horizontal = slideDirection < 2 + let size = horizontal ? implicitWidth : implicitHeight + let sign = (slideDirection === 0 || slideDirection === 3) ? -1 : 1 + + if (horizontal) { + incoming.x = sign * -size + incomingX.from = sign * -size; incomingX.to = 0 + outgoingX.from = 0; outgoingX.to = sign * size + incomingX.target = incoming; outgoingX.target = outgoing + incomingY.target = null; outgoingY.target = null + incomingX.start(); outgoingX.start() + } else { + incoming.y = sign * -size + incomingY.from = sign * -size; incomingY.to = 0 + outgoingY.from = 0; outgoingY.to = sign * size + incomingY.target = incoming; outgoingY.target = outgoing + incomingX.target = null; outgoingX.target = null + incomingY.start(); outgoingY.start() + } + + currentIndex = nextIndex + } + + NumberAnimation { id: incomingX; property: "x"; duration: 400; easing.type: Easing.InOutCubic } + NumberAnimation { id: outgoingX; property: "x"; duration: 400; easing.type: Easing.InOutCubic } + NumberAnimation { id: incomingY; property: "y"; duration: 400; easing.type: Easing.InOutCubic } + NumberAnimation { id: outgoingY; property: "y"; duration: 400; easing.type: Easing.InOutCubic } + + Item { + anchors.fill: parent + clip: true + + Image { + id: backImage + width: parent.width + height: parent.height + fillMode: Image.PreserveAspectCrop + asynchronous: true + mipmap: true + z: 0 + } + + Image { + id: frontImage + width: parent.width + height: parent.height + fillMode: Image.PreserveAspectCrop + asynchronous: true + mipmap: true + z: 1 + source: gallery.currentIndex >= 0 && gallery.photoFiles.length > 0 + ? "file://" + gallery.photoFiles[gallery.currentIndex] + : "" + } + } +} diff --git a/.config/quickshell/SystemStats.qml b/.config/quickshell/SystemStats.qml new file mode 100644 index 0000000..2250804 --- /dev/null +++ b/.config/quickshell/SystemStats.qml @@ -0,0 +1,140 @@ +import QtQuick +import Quickshell +import Quickshell.Io + +QtObject { + id: stats + + property var _prevCpu: null + property int cpuUsage: 0 + property int _memTotal: 0 + property int _memAvail: 0 + property int memUsage: 0 + property string memInfo: "0/0" + property int temperature: 0 + property int updatesCount: 0 + property string updatesList: "" + property string cpuTemps: "" + + property var _cpuProc: Process { + command: ["cat", "/proc/stat"] + running: true + + stdout: SplitParser { + splitMarker: "\n" + onRead: data => { + if (!data.startsWith("cpu ")) return + let parts = data.trim().split(/\s+/).slice(1).map(Number) + let idle = parts[3] + (parts[4] || 0) + let total = parts.reduce((a, b) => a + b, 0) + if (stats._prevCpu) { + let di = idle - stats._prevCpu.idle + let dt = total - stats._prevCpu.total + stats.cpuUsage = dt > 0 ? Math.round(100 * (1 - di / dt)) : 0 + } + stats._prevCpu = { idle: idle, total: total } + } + } + } + + property var _memProc: Process { + command: ["cat", "/proc/meminfo"] + running: true + + stdout: SplitParser { + splitMarker: "\n" + onRead: data => { + let line = data.trim() + if (line.startsWith("MemTotal:")) + stats._memTotal = parseInt(line.split(/\s+/)[1]) || 0 + else if (line.startsWith("MemAvailable:")) + stats._memAvail = parseInt(line.split(/\s+/)[1]) || 0 + } + } + + onExited: (code, status) => { + if (stats._memTotal > 0) { + stats.memUsage = Math.round(100 * (1 - stats._memAvail / stats._memTotal)) + let used = ((stats._memTotal - stats._memAvail) / 1048576).toFixed(1) + let total = (stats._memTotal / 1048576).toFixed(1) + stats.memInfo = used + "G/" + total + "G" + } + } + } + + property var _tempProc: Process { + command: [ + "bash", "-c", + "for f in /sys/class/hwmon/hwmon*/temp*_input; do " + + " d=$(dirname \"$f\"); b=$(basename \"$f\"); " + + " name=$(cat \"$d/name\" 2>/dev/null || echo unknown); " + + " label=$(cat \"$d/${b%_input}_label\" 2>/dev/null || echo ''); " + + " temp=$(($(cat \"$f\" 2>/dev/null)/1000)); " + + " printf '%s|%s|%s\\n' \"$name\" \"$label\" \"$temp\"; " + + "done 2>/dev/null" + ] + running: true + + stdout: StdioCollector { + onDataChanged: { + let lines = text.trim().split("\n").filter(l => l.length > 0) + let tempLines = [] + let maxTemp = 0 + for (let i = 0; i < lines.length; i++) { + let parts = lines[i].split("|") + let name = parts[0] || "unknown" + let label = parts[1] || "" + let temp = parseInt(parts[2]) || 0 + if (temp > 0) { + let display = label ? label : name + tempLines.push(display + ": " + temp + "°C") + if (temp > maxTemp) maxTemp = temp + } + } + stats.temperature = maxTemp + stats.cpuTemps = tempLines.join("\n") + } + } + } + + property var _pollTimer: Timer { + interval: 3000 + running: true + repeat: true + onTriggered: { + if (!stats._cpuProc.running) stats._cpuProc.running = true + if (!stats._memProc.running) stats._memProc.running = true + if (!stats._tempProc.running) stats._tempProc.running = true + } + } + + function checkUpdates() { + if (!_updatesProc.running) _updatesProc.running = true + } + + property var _updatesProc: Process { + command: [ + "bash", "-c", + "(checkupdates 2>/dev/null; yay -Qua 2>/dev/null)" + ] + running: true + + stdout: StdioCollector { + onDataChanged: { + let lines = text.trim() + let arr = lines ? lines.split("\n") : [] + stats.updatesCount = arr.length + stats.updatesList = arr.slice(0, 25).join("\n") + (arr.length > 25 ? "\n..." : "") + } + } + } + + property var _updatesTimer: Timer { + interval: 300000 + running: true + repeat: true + onTriggered: { + if (!stats._updatesProc.running) stats._updatesProc.running = true + } + } +} diff --git a/.config/quickshell/Workspaces.qml b/.config/quickshell/Workspaces.qml new file mode 100644 index 0000000..e34c492 --- /dev/null +++ b/.config/quickshell/Workspaces.qml @@ -0,0 +1,106 @@ +import QtQuick +import Quickshell.Hyprland + +Item { + id: root + + required property var workspaces + required property color accentColor + required property color fgColor + required property string fontFamily + + width: workspacesRow.width + height: 22 + + Rectangle { + id: wsHighlight + height: 22 + color: root.accentColor + z: 0 + visible: targetWidth > 0 + + property real targetX: 0 + property real targetWidth: 0 + + x: targetX + width: targetWidth + + topLeftRadius: 4 + bottomLeftRadius: 4 + topRightRadius: 4 + bottomRightRadius: 4 + + Behavior on x { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on width { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on topLeftRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on bottomLeftRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on topRightRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + Behavior on bottomRightRadius { + NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } + } + } + + Row { + id: workspacesRow + spacing: 5 + z: 1 + + Repeater { + model: root.workspaces + + delegate: Item { + required property var modelData + required property int index + + width: wsText.implicitWidth + 20 + height: 22 + + property bool isActive: modelData.active + + Component.onCompleted: if (isActive) updateSlider() + onIsActiveChanged: if (isActive) updateSlider() + onXChanged: if (isActive) updateSlider() + onWidthChanged: if (isActive) updateSlider() + + function updateSlider() { + let isOnly = root.workspaces.length === 1 + let isFirst = index === 0 + let isLast = index === root.workspaces.length - 1 + + wsHighlight.targetX = x + wsHighlight.targetWidth = width + wsHighlight.topLeftRadius = isOnly ? 100 : (isFirst ? 100 : 4) + wsHighlight.bottomLeftRadius = isOnly ? 100 : (isFirst ? 100 : 4) + wsHighlight.topRightRadius = isOnly ? 100 : (isLast ? 100 : 4) + wsHighlight.bottomRightRadius = isOnly ? 100 : (isLast ? 100 : 4) + } + + Text { + id: wsText + anchors.centerIn: parent + text: modelData.name + color: root.fgColor + font.pixelSize: 12 + font.family: root.fontFamily + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: Hyprland.dispatch("workspace " + modelData.id) + } + } + } + } + +} diff --git a/.config/quickshell/gallery-shell.qml b/.config/quickshell/gallery-shell.qml new file mode 100644 index 0000000..0d71a90 --- /dev/null +++ b/.config/quickshell/gallery-shell.qml @@ -0,0 +1,12 @@ +//@ pragma UseQApplication +import Quickshell +import QtQuick + +ShellRoot { + Base { id: base } + + PhotoGallery { + walColors: base.walColors + photosPath: "$XDG_CONFIG_HOME/quickshell/photos" + } +} diff --git a/.config/quickshell/music-shell.qml b/.config/quickshell/music-shell.qml new file mode 100644 index 0000000..7a4ee0e --- /dev/null +++ b/.config/quickshell/music-shell.qml @@ -0,0 +1,12 @@ +//@ pragma UseQApplication +import Quickshell +import QtQuick + +ShellRoot { + Base { id: base } + + MusicController { + walColors: base.walColors + fontFamily: base.fontFamily + } +} diff --git a/.config/quickshell/shell.qml b/.config/quickshell/shell.qml new file mode 100644 index 0000000..b588867 --- /dev/null +++ b/.config/quickshell/shell.qml @@ -0,0 +1,48 @@ +//@ pragma UseQApplication +import Quickshell +import Quickshell.Hyprland +import Quickshell.Services.Notifications +import QtQuick + +ShellRoot { + id: root + + Base { id: base } + + NotificationServer { + id: notifServer + keepOnReload: true + bodySupported: true + bodyMarkupSupported: true + actionsSupported: true + persistenceSupported: true + + onNotification: notification => { + notification.tracked = true + root.latestNotification = notification + } + } + + property var notifServerRef: notifServer + property var latestNotification: null + property int notifCount: notifServer.trackedNotifications.values.length + + Variants { + model: Quickshell.screens + delegate: Component { + Scope { + property var modelData + Bar { + screen: modelData + walColors: base.walColors + motd: base.motd + notificationCount: root.notifCount + latestNotification: root.latestNotification + notifServer: root.notifServerRef + stats: base.stats + fontFamily: base.fontFamily + } + } + } + } +} diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..108ef86 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,31 @@ +@theme "~/.cache/wal/colors-rofi-dark.rasi" +configuration { + modes: "window,drun,combi"; + font: "mono 12"; +/* location: 0;*/ +/* yoffset: 0;*/ +/* xoffset: 0;*/ +/* icon-theme: ;*/ +/* sort: false;*/ +/* sorting-method: "normal";*/ + combi-modes: "window,drun"; + display-window: ""; +/* display-windowcd: ;*/ +/* display-run: ;*/ +/* display-ssh: ;*/ + display-drun: ""; + display-combi: "search:"; +/* display-keys: ;*/ + display-file-browser-extended: "search:"; + display-filebrowser: "search:"; + use-hot-keys: true; + timeout { + action: "kb-cancel"; + delay: 0; + } + filebrowser { + directory: "~"; + directories-first: true; + sorting-method: "name"; + } +} diff --git a/.config/rofi/file-browser b/.config/rofi/file-browser new file mode 100644 index 0000000..69d4778 --- /dev/null +++ b/.config/rofi/file-browser @@ -0,0 +1,3 @@ +dir "~" +cmd "open" +open-parent-as-self diff --git a/.config/systemd/user/motd.service b/.config/systemd/user/motd.service new file mode 100644 index 0000000..28dc7bd --- /dev/null +++ b/.config/systemd/user/motd.service @@ -0,0 +1,12 @@ +[Unit] +Description=MOTD Generator +After=graphical-session.target + +[Service] +Type=oneshot +ExecStart=motd -o %h/.MOTD +Restart=on-failure +Slice=session.slice + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/motd.timer b/.config/systemd/user/motd.timer new file mode 100644 index 0000000..ce082b5 --- /dev/null +++ b/.config/systemd/user/motd.timer @@ -0,0 +1,10 @@ +[Unit] +Description=MOTD update +After=graphical-session.target + +[Timer] +OnBootSec=30sec +OnUnitInactiveSec=60min + +[Install] +WantedBy=timers.target diff --git a/.config/systemd/user/mpd-mpris.service b/.config/systemd/user/mpd-mpris.service new file mode 100644 index 0000000..9781f64 --- /dev/null +++ b/.config/systemd/user/mpd-mpris.service @@ -0,0 +1,12 @@ +[Unit] +Description=mpd-mpris bridge +After=mpd.service + +[Service] +Type=simple +ExecStart=mpd-mpris +Restart=on-failure +Slice=session.slice + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/quickshell.service b/.config/systemd/user/quickshell.service new file mode 100644 index 0000000..ea5939d --- /dev/null +++ b/.config/systemd/user/quickshell.service @@ -0,0 +1,13 @@ +[Unit] +Description=Quickshell mainbar +After=graphical-session.target + +[Service] +Type=exec +ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "Hyprland" "" +ExecStart=quickshell -p %h/.config/quickshell/shell.qml +Restart=on-failure +Slice=app-graphical.slice + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/weather.service b/.config/systemd/user/weather.service new file mode 100644 index 0000000..4b556b3 --- /dev/null +++ b/.config/systemd/user/weather.service @@ -0,0 +1,13 @@ +[Unit] +Description=weather for fast fetch +After=graphical-session.target + +[Service] +Type=oneshot +ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "Hyprland" "" +ExecStart=%h/.local/bin/weather +Restart=on-failure +Slice=app-graphical.slice + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/weather.timer b/.config/systemd/user/weather.timer new file mode 100644 index 0000000..5c3bd6e --- /dev/null +++ b/.config/systemd/user/weather.timer @@ -0,0 +1,10 @@ +[Unit] +Description=weather for fastfetch, runs hourly +After=graphical-session.target + +[Timer] +OnBootSec=30sec +OnUnitInactiveSec=60min + +[Install] +WantedBy=timers.target diff --git a/.config/wal/templates/colors-fzf b/.config/wal/templates/colors-fzf new file mode 100644 index 0000000..dde7918 --- /dev/null +++ b/.config/wal/templates/colors-fzf @@ -0,0 +1 @@ +--color=bg+:{color8},bg:{background},border:{color7},spinner:{color10},hl:{color9},fg:{foreground},header:{color9},info:{color11},pointer:{background},marker:{color5},fg+:{color15},preview-bg:{background},prompt:{color12},hl+:{color10} diff --git a/.config/wal/templates/colors-hyprland b/.config/wal/templates/colors-hyprland new file mode 100644 index 0000000..5822cf5 --- /dev/null +++ b/.config/wal/templates/colors-hyprland @@ -0,0 +1,18 @@ + $foregroundCol = 0xff{foreground.strip} + $backgroundCol = 0xff{background.strip} + $color0 = 0xff{color0.strip} + $color1 = 0xff{color1.strip} + $color2 = 0xff{color2.strip} + $color3 = 0xff{color3.strip} + $color4 = 0xff{color4.strip} + $color5 = 0xff{color5.strip} + $color6 = 0xff{color6.strip} + $color7 = 0xff{color7.strip} + $color8 = 0xff{color8.strip} + $color9 = 0xff{color9.strip} + $color10 = 0xff{color10.strip} + $color11 = 0xff{color11.strip} + $color12 = 0xff{color12.strip} + $color13 = 0xff{color13.strip} + $color14 = 0xff{color14.strip} + $color15 = 0xff{color15.strip} diff --git a/.config/wal/templates/colors-rofi-dark.rasi b/.config/wal/templates/colors-rofi-dark.rasi new file mode 100644 index 0000000..6f6bf11 --- /dev/null +++ b/.config/wal/templates/colors-rofi-dark.rasi @@ -0,0 +1,177 @@ +* {{ + active-background: {color2}80; + active-foreground: @foreground; + normal-background: @background; + normal-foreground: @foreground; + urgent-background: {color1}80; + urgent-foreground: @foreground; + + alternate-active-background: @background; + alternate-active-foreground: @foreground; + alternate-normal-background: @background; + alternate-normal-foreground: @foreground; + alternate-urgent-background: @background; + alternate-urgent-foreground: @foreground; + + selected-active-background: {color1}40; + selected-active-foreground: @foreground; + selected-normal-background: {color3}40; + selected-normal-foreground: @foreground; + selected-urgent-background: {color4}40; + selected-urgent-foreground: @foreground; + + background-color: @background; + background: {background}10; + foreground: {foreground}; + border-color: @background; + spacing: 2; +}} + +#window {{ + background: transparent; + background-color: @background; + border: 0; + border-radius: 3.5px; +}} + +#mainbox {{ + border: 0; + padding: 0; + border-radius: 3.5px; +}} + +#message {{ + border: 2px 0px 0px; + border-color: @border-color; + padding: 1px; +}} + +#textbox {{ + text-color: @foreground; +}} + +#inputbar {{ + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +}} + +#textbox-prompt-colon {{ + expand: false; + str: ""; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +}} + +#listview {{ + fixed-height: 0; + border: 2px 0px 0px; + border-color: @border-color; + spacing: 2px; + scrollbar: true; + padding: 2px 0px 0px; +}} + +#element {{ + border: 0; + padding: 1px; +}} + +#element-icon {{ + size: 2.5em; +}} + +#element-text {{ + vertical-align: 0.5; +}} + +#element-text, element-icon {{ + background-color: inherit; + text-color: inherit; +}} + +#element.normal.normal {{ + background-color: @normal-background; + text-color: @normal-foreground; +}} + +#element.normal.urgent {{ + background-color: @urgent-background; + text-color: @urgent-foreground; +}} + +#element.normal.active {{ + background-color: @active-background; + text-color: @active-foreground; +}} + +#element.selected.normal {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#element.selected.urgent {{ + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +}} + +#element.selected.active {{ + background-color: @selected-active-background; + text-color: @selected-active-foreground; +}} + +#element.alternate.normal {{ + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +}} + +#element.alternate.urgent {{ + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +}} + +#element.alternate.active {{ + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +}} + +#scrollbar {{ + background-color: @selected-normal-background; + width: 4px; + border: 0; + handle-width: 8px; + padding: 0; +}} + +#sidebar {{ + border: 2px 0px 0px; + border-color: @border-color; +}} + +#button {{ + text-color: @normal-foreground; +}} + +#button.selected {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#inputbar {{ + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +}} + +#case-indicator {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#entry {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#prompt {{ + spacing: 0; + text-color: @normal-foreground; +}} diff --git a/.config/wal/templates/colors-steam.css b/.config/wal/templates/colors-steam.css new file mode 100644 index 0000000..21b37b3 --- /dev/null +++ b/.config/wal/templates/colors-steam.css @@ -0,0 +1,35 @@ +:root {{ + --focus: {color1.rgb}; + --clientBG: {background.rgb}; + --header_dark: {color0.rgb}; + --frameBorder: {color8.rgb}; + --online: {color4.rgb}; + --ingame: {color2.rgb}; + --offline: {color7.rgb}; /* Originally white45 but that makes it too bold */ + --golden: {color3.rgb}; + --textentry: {color0.rgb}; + --white03: 255, 255, 255, 0.03; + --white05: 255, 255, 255, 0.05; + --white08: 255, 255, 255, 0.08; + --white10: 255, 255, 255, 0.10; + --white12: 255, 255, 255, 0.12; + --white20: 255, 255, 255, 0.20; + --white24: 255, 255, 255, 0.24; + --white25: 255, 255, 255, 0.25; + --white35: 255, 255, 255, 0.35; + --white45: 255, 255, 255, 0.45; + --white50: 255, 255, 255, 0.50; + --white75: 255, 255, 255, 0.75; + --white: 255, 255, 255; + --black05: 255, 255, 255, 0.05; + --black10: 0, 0, 0, 0.10; + --black12: 0, 0, 0, 0.12; + --black20: 0, 0, 0, 0.20; + --black24: 0, 0, 0, 0.24; + --black25: 0, 0, 0, 0.25; + --black45: 0, 0, 0, 0.45; + --black50: 0, 0, 0, 0.50; + --black75: 0, 0, 0, 0.75; + --black: 0, 0, 0; + --red: 255, 0, 0; +}} diff --git a/.config/wal/templates/zed.json b/.config/wal/templates/zed.json new file mode 100644 index 0000000..582404d --- /dev/null +++ b/.config/wal/templates/zed.json @@ -0,0 +1,130 @@ + +{{ + "$schema": "https://zed.dev/schema/themes/v0.2.0.json", + "name": "WPG", + "author": "pywal", + "themes": [ + {{ + "name": "WPG Generated", + "appearance": "dark", + "style": {{ + "border": "{color8}", + "border.variant": "{color0}", + "border.focused": "{color4}", + "border.selected": "{color4}", + "border.transparent": "#00000000", + "border.disabled": "{color8}", + "elevated_surface.background": "{color0}", + "surface.background": "{color0}", + "background": "{color0}", + "element.background": "{color0}", + "element.hover": "{color8}", + "element.active": "{color8}", + "element.selected": "{color8}", + "element.disabled": "{color0}", + "drop_target.background": "{color8}80", + "ghost_element.background": "#00000000", + "ghost_element.hover": "{color8}", + "ghost_element.active": "{color8}", + "ghost_element.selected": "{color8}", + "ghost_element.disabled": "{color0}", + "text": "{color15}", + "text.muted": "{color7}", + "text.placeholder": "{color8}", + "text.disabled": "{color8}", + "text.accent": "{color4}", + "icon": "{color15}", + "icon.muted": "{color7}", + "icon.disabled": "{color8}", + "icon.placeholder": "{color7}", + "icon.accent": "{color4}", + "status_bar.background": "{color0}", + "title_bar.background": "{color0}", + "title_bar.inactive_background": "{color0}", + "toolbar.background": "{color0}", + "tab_bar.background": "{color0}", + "tab.inactive_background": "{color0}", + "tab.active_background": "{color8}", + "search.match_background": "{color4}66", + "search.active_match_background": "{color3}66", + "panel.background": "{color0}", + "panel.focused_border": null, + "pane.focused_border": null, + "scrollbar.thumb.background": "{color7}4c", + "scrollbar.thumb.hover_background": "{color8}", + "scrollbar.thumb.border": "{color8}", + "scrollbar.track.background": "#00000000", + "scrollbar.track.border": "{color0}", + "editor.foreground": "{color15}", + "editor.background": "{color0}", + "editor.gutter.background": "{color0}", + "editor.subheader.background": "{color0}", + "editor.active_line.background": "{color8}bf", + "editor.highlighted_line.background": "{color8}", + "editor.line_number": "{color8}", + "editor.active_line_number": "{color15}", + "editor.hover_line_number": "{color7}", + "editor.invisible": "{color8}", + "editor.wrap_guide": "{color8}1a", + "editor.active_wrap_guide": "{color8}33", + "editor.document_highlight.read_background": "{color4}1a", + "editor.document_highlight.write_background": "{color8}66", + "terminal.background": "{color0}", + "terminal.foreground": "{color15}", + "terminal.bright_foreground": "{color15}", + "terminal.dim_foreground": "{color7}", + "terminal.ansi.black": "{color0}", + "terminal.ansi.bright_black": "{color8}", + "terminal.ansi.red": "{color1}", + "terminal.ansi.bright_red": "{color9}", + "terminal.ansi.green": "{color2}", + "terminal.ansi.bright_green": "{color10}", + "terminal.ansi.yellow": "{color3}", + "terminal.ansi.bright_yellow": "{color11}", + "terminal.ansi.blue": "{color4}", + "terminal.ansi.bright_blue": "{color12}", + "terminal.ansi.magenta": "{color5}", + "terminal.ansi.bright_magenta": "{color13}", + "terminal.ansi.cyan": "{color6}", + "terminal.ansi.bright_cyan": "{color14}", + "terminal.ansi.white": "{color7}", + "terminal.ansi.bright_white": "{color15}", + "link_text.hover": "{color4}", + "syntax": {{ + "attribute": {{ "color": "{color4}" }}, + "boolean": {{ "color": "{color3}" }}, + "comment": {{ "color": "{color8}" }}, + "comment.doc": {{ "color": "{color8}" }}, + "constant": {{ "color": "{color3}" }}, + "constructor": {{ "color": "{color4}" }}, + "embedded": {{ "color": "{color15}" }}, + "emphasis": {{ "color": "{color4}" }}, + "emphasis.strong": {{ "color": "{color3}", "font_weight": 700 }}, + "enum": {{ "color": "{color1}" }}, + "function": {{ "color": "{color4}" }}, + "hint": {{ "color": "{color6}" }}, + "keyword": {{ "color": "{color5}" }}, + "label": {{ "color": "{color4}" }}, + "link_text": {{ "color": "{color4}" }}, + "link_uri": {{ "color": "{color6}" }}, + "namespace": {{ "color": "{color15}" }}, + "number": {{ "color": "{color3}" }}, + "operator": {{ "color": "{color6}" }}, + "preproc": {{ "color": "{color15}" }}, + "primary": {{ "color": "{color15}" }}, + "property": {{ "color": "{color1}" }}, + "punctuation": {{ "color": "{color15}" }}, + "punctuation.bracket": {{ "color": "{color7}" }}, + "punctuation.delimiter": {{ "color": "{color7}" }}, + "selector": {{ "color": "{color3}" }}, + "string": {{ "color": "{color2}" }}, + "string.regex": {{ "color": "{color3}" }}, + "tag": {{ "color": "{color4}" }}, + "type": {{ "color": "{color6}" }}, + "variable": {{ "color": "{color15}" }}, + "variant": {{ "color": "{color4}" }} + }} + }} + }} + ] +}} diff --git a/.config/wpg/templates/gtk2.base b/.config/wpg/templates/gtk2.base new file mode 100644 index 0000000..f0a9029 --- /dev/null +++ b/.config/wpg/templates/gtk2.base @@ -0,0 +1,797 @@ +#modded Numix gtkrc + +gtk-color-scheme = "bg_color:{color0} +color0:{color0} +color1:{color1} +color2:{color2} +color3:{color3} +color4:{color4} +color5:{color5} +color6:{color6} +color7:{color7} +color8:{color8} +color9:{color9} +color10:{color10} +color11:{color11} +color12:{color12} +color13:{color13} +color14:{color14} +color15:{color15} +text_color:{color15} +selected_bg_color:{active} +selected_fg_color:{color15} +tooltip_bg_color:{color0} +tooltip_fg_color:{color15} +titlebar_bg_color:{color0} +titlebar_fg_color:{color15} +menu_bg_color:{color0} +menu_fg_color:{color15} +link_color:{active}" +gtk-auto-mnemonics = 1 + +# Default Style +# DO --NOT-- CHANGE ACTIVE +# IT's THE COLOR THAT WPGTK REPLACES +# FEEL FREE TO MODIFY EVERYTHING ELSE IN gtkrc.base + +style "murrine-default" {{ + GtkArrow::arrow-scaling= 0.6 + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 + + GtkButton::default-border = {{ 0, 0, 0, 0 }} + + GtkButtonBox::child-min-height = 26 + + GtkCheckButton::indicator-size = 16 + + # The following line hints to gecko (and possibly other appliations) + # that the entry should be drawn transparently on the canvas. + # Without this, gecko will fill in the background of the entry. + GtkEntry::honors-transparent-bg-hint = 1 + GtkEntry::state-hint = 0 + + GtkExpander::expander-size = 16 + + GtkImage::x-ayatana-indicator-dynamic = 1 + + GtkMenu::horizontal-padding = 0 + GtkMenu::vertical-padding = 0 + + GtkMenuBar::internal-padding = 0 + GtkMenuBar::window-dragging = 1 + + GtkMenuItem::arrow-scaling= 0.5 + + GtkPaned::handle-size = 1 + + GtkProgressBar::min-horizontal-bar-height = 12 + GtkProgressBar::min-vertical-bar-width = 12 + + GtkRange::trough-border = 0 + GtkRange::slider-width = 8 + GtkRange::stepper-size = 12 + GtkRange::stepper_spacing = 0 + GtkRange::trough-under-steppers = 1 + + GtkScale::slider-length = 16 + GtkScale::slider-width = 16 + GtkScale::trough-side-details = 1 + + GtkScrollbar::activate-slider = 1 + GtkScrollbar::has-backward-stepper = 0 + GtkScrollbar::has-forward-stepper = 0 + GtkScrollbar::has-secondary-backward-stepper = 0 + GtkScrollbar::has-secondary-forward-stepper = 0 + GtkScrollbar::min-slider-length = 80 + GtkScrollbar::slider-width = 8 + GtkScrollbar::trough-border = 0 + + GtkScrolledWindow::scrollbar-spacing = 0 + GtkScrolledWindow::scrollbars-within-bevel = 1 + + GtkSeparatorMenuItem::horizontal-padding = 0 + + GtkToolbar::internal-padding = 0 + + GtkTreeView::expander-size = 11 + GtkTreeView::vertical-separator = 0 + + GtkWidget::focus-line-width = 1 + # The following line prevents the Firefox tabs + # from jumping a few pixels when you create a new tab + GtkWidget::focus-padding = 0 + + GtkWidget::wide-separators = 1 + GtkWidget::separator-width = 1 + GtkWidget::separator-height = 1 + + GtkWindow::resize-grip-height = 0 + GtkWindow::resize-grip-width = 0 + + WnckTasklist::fade-overlay-rect = 0 + + GnomeHRef::link_color = @link_color + GtkHTML::link-color = @link_color + GtkIMHtmlr::hyperlink-color = @link_color + GtkIMHtml::hyperlink-color = @link_color + GtkWidget::link-color = @link_color + GtkWidget::visited-link-color = @text_color + + GtkToolbar::shadow-type = GTK_SHADOW_NONE # Makes toolbars flat and unified + GtkMenuBar::shadow-type = GTK_SHADOW_NONE # Makes menubars flat and unified + + xthickness = 1 + ythickness = 1 + + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + bg[NORMAL] = @bg_color + bg[PRELIGHT] = shade (1.02, @bg_color) + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = @bg_color + bg[INSENSITIVE] = @bg_color + + base[NORMAL] = shade(0.85, @color0) + base[PRELIGHT] = shade (0.85, @color0) + base[SELECTED] = @selected_bg_color + base[ACTIVE] = @selected_bg_color + base[INSENSITIVE] = shade (0.85, @bg_color) + + text[NORMAL] = @text_color + text[PRELIGHT] = @text_color + text[SELECTED] = @selected_fg_color + text[ACTIVE] = @selected_fg_color + text[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + engine "murrine" {{ + animation = FALSE + arrowstyle = 1 # 0 = normal arrows, 1 = filled arrows + border_shades = {{ 1.0, 1.0 }} # gradient to draw on border + colorize_scrollbar = TRUE + comboboxstyle = 0 # 0 = normal combobox, 1 = colorized combobox below arrow + contrast = 0.0 # overal contrast with borders + focusstyle = 1 # 0 = none, 1 = grey dotted, 2 = colored with fill, 3 = colored glow + glazestyle = 0 # 0 = flat highlight, 1 = curved highlight, 2 = concave, 3 = top curved highlight, 4 = beryl highlight + glowstyle = 0 # 0 = glow on top, 1 = glow on bottom, 2 = glow on top and bottom, 3 = glow on middle vertically, 4 = glow on middle horizontally, 5 = glow on all sides + glow_shade = 1.0 # amount of glow + gradient_shades = {{ 1.0, 1.0, 1.0, 1.0 }} # gradient to draw on widgets + highlight_shade = 1.0 # amount of highlight + lightborder_shade = 1.0 # amount of inset light border + lightborderstyle = 1 # 0 = lightborder on top side, 1 = lightborder on all sides + listviewheaderstyle = 0 # 0 = flat, 1 = glassy, 2 = raised + listviewstyle = 0 # 0 = none, 1 = dotted, 2 = line + menubaritemstyle = 0 # 0 = menuitem look, 1 = button look + menubarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient, 3 = striped + menuitemstyle = 0 # 0 = flat, 1 = glassy, 2 = striped + menustyle = 0 # 0 = none, 1 = vertical striped + progressbarstyle = 0 # 0 = none, 1 = diagonal striped, 2 = vertical striped + reliefstyle = 0 # 0 = flat, 1 = inset, 2 = shadow, 3 = shadow with gradient, 4 = stronger shadow with gradient + roundness = 0 # roundness of widgets + scrollbarstyle = 0 # 0 = none, 1 = circles, 2 = handles, 3 = diagonal stripes, 4 = diagonal stripes and handles, 5 = horizontal stripes, 6 = horizontal stripes and handles + sliderstyle = 0 # 0 = none, 1 = handles + stepperstyle = 1 # 0 = standard, 1 = integrated stepper handles + toolbarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient + }} +}} + +style "murrine-wide" {{ + xthickness = 2 + ythickness = 2 +}} + +style "murrine-wider" {{ + xthickness = 3 + ythickness = 3 +}} + +style "murrine-thin" {{ + xthickness = 0 + ythickness = 0 +}} + +# Notebook + +style "murrine-notebook-bg" {{ + bg[NORMAL] = @bg_color + bg[ACTIVE] = shade (0.70, @bg_color) +}} + +style "murrine-notebook" = "murrine-notebook-bg" {{ + xthickness = 2 + ythickness = 2 + + engine "murrine" {{ + roundness = 0 + }} +}} + +# Various Standard Widgets + +style "murrine-button" = "murrine-wider" {{ + bg[NORMAL] = shade (1.3, @bg_color) + bg[PRELIGHT] = shade (0.80, @selected_bg_color) + bg[ACTIVE] = shade (1.00, @selected_bg_color) + bg[INSENSITIVE] = shade (0.85, @bg_color) + + engine "murrine" {{ + }} +}} + +style "murrine-scrollbar" {{ + bg[NORMAL] = @bg_color + bg[PRELIGHT] = mix (0.31, @text_color, @bg_color) + bg[ACTIVE] = @selected_bg_color + + engine "murrine" {{ + roundness = 0 + contrast = 0.0 + border_shades = {{ 0.9, 0.9 }} + trough_shades = {{ 0.97, 0.97 }} + trough_border_shades = {{ 1.0, 1.0 }} + }} +}} + +style "murrine-overlay-scrollbar" {{ + bg[ACTIVE] = shade (0.8, @bg_color) + bg[INSENSITIVE] = shade (0.97, @bg_color) + + base[SELECTED] = shade (0.6, @bg_color) + base[INSENSITIVE] = shade (0.85, @bg_color) +}} + +style "murrine-scale" = "murrine-thin" {{ + bg[NORMAL] = @bg_color + bg[ACTIVE] = @bg_color + bg[SELECTED] = @selected_bg_color + bg[INSENSITIVE] = shade (0.95, @bg_color) + + engine "murrine" {{ + roundness = 8 + gradient_shades = {{ 1.08, 1.08, 1.08, 1.08 }} + border_shades = {{ 1.0, 1.0 }} + trough_shades = {{ 1.08, 1.08 }} + trough_border_shades = {{ 0.8, 0.8 }} + }} +}} + +style "murrine-progressbar" = "murrine-thin" {{ + bg[NORMAL] = @bg_color + bg[ACTIVE] = shade(0.60, @bg_color) + + fg[PRELIGHT] = @selected_fg_color + + engine "murrine" {{ + roundness = 0 + border_shades = {{ 1.2, 1.2 }} + trough_border_shades = {{ 0.8, 0.8 }} + }} +}} + +style "murrine-treeview-header" = "murrine-button" {{ + engine "murrine" {{ + roundness = 0 + }} +}} + +style "murrine-treeview" {{ + engine "murrine" {{ + roundness = 0 + }} +}} + +style "murrine-frame-title" {{ + fg[NORMAL] = lighter (@text_color) +}} + +style "murrine-tooltips" {{ + xthickness = 5 + ythickness = 5 + + bg[NORMAL] = @tooltip_bg_color + bg[SELECTED] = @tooltip_bg_color + + fg[NORMAL] = @text_color + + engine "murrine" {{ + textstyle = 0 + roundness = 0 + rgba = FALSE + }} +}} + +style "murrine-spinbutton" = "murrine-button" {{ + engine "murrine" {{ + }} +}} + +style "murrine-radiocheck" = "murrine-default" {{ + bg[SELECTED] = @bg_color + + text[NORMAL] = @selected_bg_color + text[PRELIGHT] = @selected_bg_color +}} + +style "murrine-entry" = "murrine-wider" {{ + bg[SELECTED] = @selected_bg_color + + engine "murrine" {{ + border_shades = {{ 1.15, 1.15 }} + }} +}} + +style "metacity-frame" = "murrine-default" {{ + bg[SELECTED] = @selected_bg_color +}} + +style "murrine-statusbar" {{ + bg[NORMAL] = @bg_color +}} +style "murrine-comboboxentry" = "murrine-entry" {{ }} +style "murrine-hscale" = "murrine-scale" {{ }} +style "murrine-vscale" = "murrine-scale" {{ }} +style "murrine-hscrollbar" = "murrine-scrollbar" {{ }} +style "murrine-vscrollbar" = "murrine-scrollbar" {{ }} + +# Menus + +style "murrine-menu" = "murrine-thin" {{ + bg[NORMAL] = shade(0.8, @menu_bg_color) + bg[PRELIGHT] = @selected_bg_color + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = @menu_bg_color + bg[INSENSITIVE] = @menu_bg_color + + fg[NORMAL] = @menu_fg_color + fg[PRELIGHT] = @selected_fg_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @selected_fg_color + fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) + + text[NORMAL] = @menu_fg_color + text[PRELIGHT] = @selected_fg_color + text[SELECTED] = @selected_fg_color + text[ACTIVE] = @selected_fg_color + text[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) + + engine "murrine" {{ + roundness = 0 + }} +}} + +style "murrine-menu-item" = "murrine-wider" {{ + bg[PRELIGHT] = @selected_bg_color + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = @selected_bg_color + + fg[NORMAL] = @menu_fg_color # Fix for XFCE menu text + fg[PRELIGHT] = @selected_fg_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @selected_fg_color + fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) + + engine "murrine" {{ + textstyle = 0 + border_shades = {{ 1.2, 1.2 }} + }} +}} + +style "murrine-separator-menu-item" = "murrine-thin" {{ }} + +style "murrine-menubar" {{ + bg[NORMAL] = @bg_color + bg[PRELIGHT] = mix (0.21, @text_color, @bg_color) + bg[SELECTED] = mix (0.21, @text_color, @bg_color) + bg[ACTIVE] = shade (0.9, @bg_color) + bg[INSENSITIVE] = @bg_color + + fg[NORMAL] = @text_color + fg[PRELIGHT] = shade (1.08, @text_color) + fg[SELECTED] = shade (1.08, @text_color) + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + engine "murrine" {{ + roundness = 0 + }} +}} + +style "murrine-menubaritem" {{ + bg[NORMAL] = @bg_color + bg[PRELIGHT] = @selected_bg_color + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = shade (0.9, @bg_color) + bg[INSENSITIVE] = @bg_color + + fg[NORMAL] = @text_color + fg[PRELIGHT] = shade (1.08, @text_color) + fg[SELECTED] = shade (1.08, @text_color) + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + engine "murrine" {{ + roundness = 0 + }} +}} + +# Toolbars + +style "murrine-toolbar" = "murrine-thin" {{ + bg[NORMAL] = @bg_color + bg[PRELIGHT] = shade (1.02, @bg_color) + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = shade (0.9, @bg_color) + bg[INSENSITIVE] = @bg_color + + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + engine "murrine" {{ + }} +}} + +style "murrine-toolbutton" = "murrine-button" {{ + bg[NORMAL] = shade (1.08, @bg_color) + bg[PRELIGHT] = shade (1.10, @bg_color) + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = shade (0.95, @bg_color) + bg[INSENSITIVE] = shade (0.85, @bg_color) + + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = mix (0.5, @bg_color, @text_color) + + engine "murrine" {{ + }} +}} + +class "GtkToolbar" style "murrine-toolbar" +class "GtkHandleBox" style "murrine-toolbar" +widget_class "*Toolbar*.*Separator*" style "murrine-toolbar" + +# Panels + +style "murrine-panel" = "murrine-thin" {{ + xthickness = 2 + + bg[NORMAL] = @menu_bg_color + bg[PRELIGHT] = shade(0.8, @selected_bg_color) + bg[SELECTED] = @selected_bg_color + bg[ACTIVE] = @selected_bg_color + bg[INSENSITIVE] = @menu_bg_color + + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[SELECTED] = @text_color + fg[ACTIVE] = @text_color + fg[INSENSITIVE] = shade(0.8, @text_color) + + base[NORMAL] = @menu_bg_color + base[PRELIGHT] = mix (0.21, @text_color, @menu_bg_color) + base[SELECTED] = @selected_bg_color + base[ACTIVE] = @selected_bg_color + base[INSENSITIVE] = @menu_bg_color + + text[NORMAL] = @text_color + text[PRELIGHT] = shade (1.08, @text_color) + text[SELECTED] = shade (1.08, @text_color) + text[ACTIVE] = @text_color + text[INSENSITIVE] = mix (0.5, @menu_bg_color, @text_color) + + engine "murrine" {{ + roundness = 0 + contrast = 0.0 + }} +}} + +widget "*PanelWidget*" style "murrine-panel" +widget "*PanelApplet*" style "murrine-panel" +widget "*fast-user-switch*" style "murrine-panel" +widget "*CPUFreq*Applet*" style "murrine-panel" +widget "*indicator-applet*" style "murrine-panel" +class "PanelApp*" style "murrine-panel" +class "PanelToplevel*" style "murrine-panel" +widget_class "*PanelToplevel*" style "murrine-panel" +widget_class "*notif*" style "murrine-panel" +widget_class "*Notif*" style "murrine-panel" +widget_class "*Tray*" style "murrine-panel" +widget_class "*tray*" style "murrine-panel" +widget_class "*computertemp*" style "murrine-panel" +widget_class "*Applet*Tomboy*" style "murrine-panel" +widget_class "*Applet*Netstatus*" style "murrine-panel" +widget "*gdm-user-switch-menubar*" style "murrine-panel" + +style "bold-panel-item" {{ + font_name = "Bold" + + engine "murrine" {{ + roundness = 0 + }} +}} + +widget "*Panel*MenuBar*" style "bold-panel-item" +widget "*gimmie*" style "bold-panel-item" + +# widget_class "*Mail*" style "murrine-panel" # Disabled to fix Evolution bug +# class "*Panel*" style "murrine-panel" # Disabled to fix bug + +# XFCE Styles + +style "workspace-switcher" = "murrine-panel" {{ + bg[SELECTED] = @selected_bg_color +}} + +style "xfce-header" {{ + bg[NORMAL] = shade (0.9, @bg_color) + base[NORMAL] = shade (1.18, @bg_color) +}} + +style "xfdesktop-windowlist" {{ + bg[NORMAL] = @bg_color + fg[INSENSITIVE] = shade (0.95, @bg_color) + text[INSENSITIVE] = shade (0.95, @bg_color) +}} + +style "xfdesktop-icon-view" {{ + XfdesktopIconView::label-alpha = 0 + XfdesktopIconView::selected-label-alpha = 60 + XfdesktopIconVIew::ellipsize-icon-labels = 1 + + base[NORMAL] = @selected_bg_color + base[SELECTED] = @selected_bg_color + base[ACTIVE] = @selected_bg_color + + fg[NORMAL] = @selected_fg_color + fg[SELECTED] = @selected_fg_color + fg[ACTIVE] = @selected_fg_color + + engine "murrine" {{ + textstyle = 5 + text_shade = 0.05 + }} +}} + +style "xfwm-tabwin" {{ + Xfwm4TabwinWidget::border-width = 0 + Xfwm4TabwinWidget::icon-size = 64 + + bg[NORMAL] = @menu_bg_color + fg[NORMAL] = @menu_fg_color + + engine "murrine" {{ + focusstyle = 0 + }} +}} + +style "xfsm-logout" {{ + bg[NORMAL] = @menu_bg_color + bg[ACTIVE] = @menu_bg_color + bg[PRELIGHT] = shade (1.1, @menu_bg_color) + bg[SELECTED] = shade (0.5, @menu_bg_color) + bg[INSENSITIVE] = shade (1.3, @menu_bg_color) + + fg[NORMAL] = @menu_fg_color + fg[PRELIGHT] = @menu_fg_color + + text[NORMAL] = @menu_fg_color + + engine "murrine" {{ + }} +}} + +style "xfsm-logout-button" {{ + bg[NORMAL] = shade (1.2, @menu_bg_color) + bg[PRELIGHT] = shade (1.4, @menu_bg_color) + + engine "murrine" {{ + }} +}} + +widget "*WnckPager*" style "workspace-switcher" + +widget "*Xfce*Panel*" style "murrine-panel" +class "*Xfce*Panel*" style "murrine-panel" + +# Thunar Styles + +style "sidepane" {{ + base[NORMAL] = @bg_color + base[INSENSITIVE] = shade(0.90, @bg_color) + bg[NORMAL] = @bg_color + text[NORMAL] = @text_color +}} + +widget_class "*ThunarShortcutsView*" style "sidepane" +widget_class "*ThunarTreeView*" style "sidepane" +widget_class "*ThunarLocationEntry*" style "murrine-entry" + +# Gtk2 Open-File Dialog + +widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.GtkTreeView*" style "sidepane" +widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.." style "murrine-treeview-header" + +# Google Chrome/Chromium Styles (requires 9.0.597 or newer) + +style "chromium-toolbar-button" {{ + engine "murrine" {{ + roundness = 2 + textstyle = 0 + }} +}} + +style "chrome-gtk-frame" {{ + ChromeGtkFrame::frame-color = @titlebar_bg_color + ChromeGtkFrame::inactive-frame-color = @titlebar_bg_color + + ChromeGtkFrame::frame-gradient-size = 0 + ChromeGtkFrame::frame-gradient-color = @titlebar_bg_color + + ChromeGtkFrame::incognito-frame-color = @titlebar_bg_color + ChromeGtkFrame::incognito-inactive-frame-color = @titlebar_bg_color + + ChromeGtkFrame::incognito-frame-gradient-size = 0 + ChromeGtkFrame::incognito-frame-gradient-color = @titlebar_bg_color + + ChromeGtkFrame::scrollbar-trough-color = @bg_color + ChromeGtkFrame::scrollbar-slider-normal-color = mix (0.21, @text_color, @bg_color) + ChromeGtkFrame::scrollbar-slider-prelight-color = mix (0.31, @text_color, @bg_color) +}} + +class "ChromeGtkFrame" style "chrome-gtk-frame" + +widget_class "*Chrom*Button*" style "chromium-toolbar-button" + +# General Styles + +class "GtkWidget" style "murrine-default" + +class "GtkFrame" style "murrine-wide" +class "MetaFrames" style "metacity-frame" +class "GtkWindow" style "metacity-frame" + +class "GtkSeparator" style "murrine-wide" +class "GtkCalendar" style "murrine-wide" + +class "GtkSpinButton" style "murrine-spinbutton" + +class "GtkScale" style "murrine-scale" +class "GtkVScale" style "murrine-vscale" +class "GtkHScale" style "murrine-hscale" +class "GtkScrollbar" style "murrine-scrollbar" +class "GtkVScrollbar" style "murrine-vscrollbar" +class "GtkHScrollbar" style "murrine-hscrollbar" + +class "GtkRadio*" style "murrine-radiocheck" +class "GtkCheck*" style "murrine-radiocheck" + +class "GtkEntry" style "murrine-entry" + +widget_class "*" style "murrine-notebook" +widget_class "**" style "murrine-notebook-bg" +widget_class "**" style "murrine-notebook-bg" +widget_class "**" style "murrine-notebook-bg" +widget_class "*.GtkNotebook.*.GtkViewport" style "murrine-notebook" + +widget_class "*" style "murrine-button" +widget_class "**" style "murrine-statusbar" +widget_class "*" style "murrine-progressbar" +widget_class "*" style "murrine-progressbar" + +widget_class "**" style "murrine-comboboxentry" +widget_class "**" style "murrine-comboboxentry" + +widget_class "**" style "murrine-menu" +widget_class "**" style "murrine-menu-item" +widget_class "**" style "murrine-separator-menu-item" +widget_class "*Menu*.*Sepa*" style "murrine-separator-menu-item" +widget_class "**" style "murrine-menubar" +widget_class "***" style "murrine-menubaritem" + +widget_class "*GtkToolButton*" style "murrine-toolbutton" +widget_class "*GtkToggleToolButton*" style "murrine-toolbutton" +widget_class "*GtkMenuToolButton*" style "murrine-toolbutton" +widget_class "*GtkToolbar*Button" style "murrine-toolbutton" + +widget_class "*.." style "murrine-frame-title" + +widget_class "*.*" style "murrine-treeview" +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" +widget_class "*.." style "murrine-treeview-header" + +widget "gtk-tooltip*" style "murrine-tooltips" + +widget_class "**" style "murrine-overlay-scrollbar" + +# Workarounds and Non-Standard Styling + +style "text-is-fg-color-workaround" {{ + text[NORMAL] = @text_color + text[PRELIGHT] = @text_color + text[SELECTED] = @selected_fg_color + text[ACTIVE] = @text_color + text[INSENSITIVE] = mix (0.5, @bg_color, @text_color) +}} + +widget_class "*.." style "text-is-fg-color-workaround" + +style "fg-is-text-color-workaround" {{ + fg[NORMAL] = @text_color + fg[PRELIGHT] = @text_color + fg[ACTIVE] = @selected_fg_color + fg[SELECTED] = @selected_fg_color + fg[INSENSITIVE] = darker (@text_color) +}} + +widget_class "**" style "fg-is-text-color-workaround" +widget_class "*" style "fg-is-text-color-workaround" +widget_class "*" style "fg-is-text-color-workaround" + +style "murrine-evo-new-button-workaround" {{ + engine "murrine" {{ + toolbarstyle = 0 + }} +}} + +widget_class "EShellWindow.GtkVBox.BonoboDock.BonoboDockBand.BonoboDockItem*" style "murrine-evo-new-button-workaround" + +style "inkscape-toolbar-fix" {{ + engine "murrine" {{ + gradient_shades = {{ 1.0, 1.0, 1.0, 1.0 }} + highlight_shade = 1.0 + }} +}} + +#widget "*GtkHandleBox*" style "inkscape-toolbar-fix" +#widget "*HandleBox*CommandsToolbar*" style "inkscape-toolbar-fix" +#widget "*HandleBox*SnapToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*SelectToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*NodeToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*TweakToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*ZoomToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*StarToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*RectToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*3DBoxToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*ArcToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*SpiralToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*PencilToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*PenToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*CalligraphyToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*EraserToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*LPEToolToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*DropperToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*ConnectorToolbar*" style "inkscape-toolbar-fix" +widget "*HandleBox*PaintbucketToolbar*" style "inkscape-toolbar-fix" + +# Performance Fixes + +style "performance-fix" {{ + engine "murrine" {{ + textstyle = 0 + }} +}} + +widget_class "*gtkmm__GtkWindow*" style "performance-fix" # Inkscape +widget_class "*GimpDisplayShell*" style "performance-fix" # Gimp +widget_class "*GimpToolbox*" style "performance-fix" +widget_class "*GimpMenuDock*" style "performance-fix" +widget "*OOoFixed*" style "performance-fix" # Openoffice/Libreoffice +widget_class "*MozContainer*" style "performance-fix" # Firefox (Not sure if this one does anything though.) + +widget_class "*XfceHeading*" style "xfce-header" +widget_class "*XfceDesktop*" style "xfdesktop-windowlist" +widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view" +widget "xfwm4-tabwin*" style "xfwm-tabwin" +widget_class "*XfsmLogoutDialog*" style "xfsm-logout" +widget_class "*XfsmLogoutDialog*GtkButton" style "xfsm-logout-button" diff --git a/.config/wpg/templates/gtk3.0.base b/.config/wpg/templates/gtk3.0.base new file mode 100644 index 0000000..bea8499 --- /dev/null +++ b/.config/wpg/templates/gtk3.0.base @@ -0,0 +1,93 @@ + +/* Default color scheme */ +@define-color bg_color {color0}; +@define-color fg_color {color15}; +@define-color base_color {color1}; +@define-color text_color {color15}; +@define-color selected_bg_color {active}; +@define-color selected_fg_color {color15}; +@define-color tooltip_bg_color {color0}; +@define-color tooltip_fg_color {color15}; + +/* colormap actually used by the theme, to be overridden in other css files */ +@define-color theme_bg_color @bg_color; +@define-color theme_fg_color @fg_color; +@define-color theme_base_color @base_color; +@define-color theme_text_color @text_color; +@define-color theme_selected_bg_color @selected_bg_color; +@define-color theme_selected_fg_color @selected_fg_color; +@define-color theme_tooltip_bg_color @tooltip_bg_color; +@define-color theme_tooltip_fg_color @tooltip_fg_color; + +/* shadow effects */ +@define-color light_shadow #eeeeee; +@define-color dark_shadow #222222; + +/* misc colors used by gtk+ */ +@define-color info_fg_color white; +@define-color info_bg_color #BACF66; +@define-color warning_fg_color white; +@define-color warning_bg_color #E6A682; +@define-color question_fg_color white; +@define-color question_bg_color #74C47B; +@define-color error_fg_color white; +@define-color error_bg_color #E682C8; +@define-color link_color mix (@theme_selected_bg_color, black, 0.15); +@define-color success_color #53a93f; +@define-color warning_color #f57900; +@define-color error_color #cc0000; + +/* widget colors*/ +@define-color border_color #363D43; +@define-color button_normal_color #3F474A; +@define-color button_info_color #72B279; +@define-color button_default_active_color shade(@theme_selected_bg_color, 0.857); +@define-color entry_border_color shade(@theme_base_color, 0.9); +@define-color frame_border_bottom_color #E3E4E7; +@define-color sel_color #B98CD7; +@define-color switch_bg_color #C9CBCF; +@define-color panel_bg_color @bg_color; +@define-color panel_fg_color @fg_color; +@define-color borders #FAFAFA; +@define-color scrollbar_trough shade(@theme_base_color, 0.9); +@define-color scrollbar_slider_prelight mix(@scrollbar_trough, @theme_fg_color, 0.5); + + +/* osd */ +@define-color osd_separator #49525B; +@define-color osd_fg #ABB4BD; +@define-color osd_bg #434A54; + +/* window manager colors */ +@define-color wm_bg @theme_bg_color; +@define-color wm_title_focused @theme_fg_color; +@define-color wm_title_unfocused @theme_text_color; +@define-color wm_border_focused @border_color; +@define-color wm_border_unfocused @border_color; + +@import url("gtk-widgets.css"); +@import url("gtk-widgets-assets.css"); +@import url("unity.css"); +@import url("widgets/button.css"); +@import url("widgets/cell-row.css"); +@import url("widgets/check-radio.css"); +@import url("widgets/column-header.css"); +@import url("widgets/calendar.css"); +@import url("widgets/entry.css"); +@import url("widgets/infobar.css"); +@import url("widgets/menu.css"); +@import url("widgets/notebook.css"); +@import url("widgets/progress-scale.css"); +@import url("widgets/scrollbar.css"); +@import url("widgets/separator.css"); +@import url("widgets/sidebar.css"); +@import url("widgets/spinbutton.css"); +@import url("widgets/spinner.css"); +@import url("widgets/switch.css"); +@import url("widgets/color-chooser.css"); +@import url("widgets/toolbar.css"); +@import url("widgets/header-bar.css"); +@import url("widgets/osd.css"); +@import url("widgets/csd.css"); +@import url("widgets/combobox.css"); +@import url("widgets/selection-mode.css"); diff --git a/.config/wpg/templates/gtk3.20.base b/.config/wpg/templates/gtk3.20.base new file mode 100644 index 0000000..08b9fba --- /dev/null +++ b/.config/wpg/templates/gtk3.20.base @@ -0,0 +1,108 @@ +/* Default color scheme */ +@define-color color0 {color0}; +@define-color color1 {color1}; +@define-color color2 {color2}; +@define-color color3 {color3}; +@define-color color4 {color4}; +@define-color color5 {color5}; +@define-color color6 {color6}; +@define-color color7 {color7}; +@define-color color8 {color8}; +@define-color color9 {color9}; +@define-color color10 {color10}; +@define-color color11 {color11}; +@define-color color12 {color12}; +@define-color color13 {color13}; +@define-color color14 {color14}; +@define-color color15 {color15}; +@define-color selected_bg_color {active}; +@define-color bg_color mix(@color0, @color15, 0.12); +@define-color tooltip_bg_color mix(@color0, @color15, 0.04); +@define-color base_color mix(@color0, @color15, 0); +@define-color fg_color @color15; +@define-color text_color @color15; +@define-color selected_fg_color @color15; +@define-color tooltip_fg_color @color15; + +/* colormap actually used by the theme, to be overridden in other css files */ +@define-color theme_bg_color @bg_color; +@define-color theme_fg_color @fg_color; +@define-color theme_base_color @base_color; +@define-color theme_text_color @text_color; +@define-color theme_selected_bg_color @selected_bg_color; +@define-color theme_selected_fg_color @selected_fg_color; +@define-color theme_tooltip_bg_color @tooltip_bg_color; +@define-color theme_tooltip_fg_color @tooltip_fg_color; + +/* shadow effects */ +@define-color light_shadow #eeeeee; +@define-color dark_shadow #222222; + +/* misc colors used by gtk+ */ +@define-color info_fg_color @text_color; +@define-color info_bg_color @bg_color; +@define-color warning_fg_color @text_color; +@define-color warning_bg_color @bg_color; +@define-color question_fg_color @text_color; +@define-color question_bg_color @theme_selected_bg_color; +@define-color error_fg_color @text_color; +@define-color error_bg_color #f52400; +@define-color link_color mix (@theme_selected_bg_color, black, 0.15); +@define-color success_color #53a93f; +@define-color warning_color #f57900; +@define-color error_color #f52400; + +/* widget colors*/ +@define-color border_color shade(@theme_selected_bg_color, 0.2); +@define-color button_normal_color shade(@theme_bg_color, 1.20); +@define-color button_info_color @theme_selected_bg_color; +@define-color button_default_active_color @theme_selected_bg_color; +@define-color entry_border_color shade(@theme_base_color, 0.9); +@define-color frame_border_bottom_color shade(@bg_color, 0.8); +@define-color sel_color shade(@theme_selected_bg_color, 0.857); +@define-color switch_bg_color shade(@bg_color, 0.8); +@define-color panel_bg_color @bg_color; +@define-color panel_fg_color @fg_color; +@define-color borders shade(@theme_selected_bg_color, 0.857); +@define-color scrollbar_trough shade(@theme_base_color, 0.9); +@define-color scrollbar_slider_prelight mix(@scrollbar_trough, @theme_fg_color, 0.5); + + +/* osd */ +@define-color osd_separator #49525B; +@define-color osd_fg #ABB4BD; +@define-color osd_bg #434A54; + +/* window manager colors */ +@define-color wm_bg @theme_bg_color; +@define-color wm_title_focused @theme_fg_color; +@define-color wm_title_unfocused @theme_text_color; +@define-color wm_border_focused @border_color; +@define-color wm_border_unfocused @border_color; + +@import url("gtk-widgets.css"); +@import url("unity.css"); +@import url("widgets/button.css"); +@import url("widgets/cell-row.css"); +@import url("widgets/check-radio.css"); +@import url("widgets/column-header.css"); +@import url("widgets/calendar.css"); +@import url("widgets/entry.css"); +@import url("widgets/infobar.css"); +@import url("widgets/menu.css"); +@import url("widgets/notebook.css"); +@import url("widgets/progress-scale.css"); +@import url("widgets/scrollbar.css"); +@import url("widgets/separator.css"); +@import url("widgets/sidebar.css"); +@import url("widgets/chrome.css"); +@import url("widgets/spinbutton.css"); +@import url("widgets/spinner.css"); +@import url("widgets/switch.css"); +@import url("widgets/color-chooser.css"); +@import url("widgets/toolbar.css"); +@import url("widgets/header-bar.css"); +@import url("widgets/osd.css"); +@import url("widgets/csd.css"); +@import url("widgets/combobox.css"); +@import url("widgets/selection-mode.css"); diff --git a/.config/wpg/wpg.conf b/.config/wpg/wpg.conf new file mode 100644 index 0000000..5f0d1fb --- /dev/null +++ b/.config/wpg/wpg.conf @@ -0,0 +1,19 @@ +[settings] +set_wallpaper = true +gtk = true +active = 0 +light_theme = false +editor = urxvt -e vim +execute_cmd = true +command = theme-reload +backend = wal +alpha = 100 +smart_sort = true +auto_adjust = false +reload = true +terminal = true +keywords = default +vte = true + +[keywords] + diff --git a/.config/xsettingsd/xsettingsd.conf b/.config/xsettingsd/xsettingsd.conf new file mode 100644 index 0000000..09c27f1 --- /dev/null +++ b/.config/xsettingsd/xsettingsd.conf @@ -0,0 +1,9 @@ +Net/ThemeName "FlatColor" +Net/IconThemeName "Papirus-Dark" +Gtk/CursorThemeName "Posy_Cursor" +Net/EnableEventSounds 1 +EnableInputFeedbackSounds 1 +Xft/Antialias 1 +Xft/Hinting 1 +Xft/HintStyle "hintslight" +Xft/RGBA "rgb" diff --git a/.config/yazi/edit.sh b/.config/yazi/edit.sh new file mode 100755 index 0000000..0933b5b --- /dev/null +++ b/.config/yazi/edit.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -eo pipefail +CWD=$(dirname "$1") + +if [ -n "$TMUX" ]; then + if tmux list-panes -F "#{pane_title}" 2>/dev/null | grep -q "^$EDITOR$"; then + tmux send-keys -t "$EDITOR" ":e $1" Enter + else + tmux split-window -h -p 83 -c "$CWD" -P -F "#{pane_id}" "exec $EDITOR '$1'" + tmux select-pane -T "$EDITOR" + tmux split-window -v -p 20 -c "$CWD" + fi +elif [ -n "$KITTY_WINDOW_ID" ]; then + if kitty @ focus-window --match "title:$EDITOR" 2>/dev/null; then + kitty @ send-text --match "title:$EDITOR" ":e $1\x0d" + else + kitty @ launch --title "$EDITOR" --location=vsplit --bias=83 --cwd "$CWD" bash -c "'$EDITOR' '$1'; while true; do '$EDITOR'; done" + kitty @ launch --title "CLI" --dont-take-focus --location=hsplit --bias=20 --cwd "$CWD" + fi +else + "$EDITOR" "$1" +fi diff --git a/.config/yazi/init.lua b/.config/yazi/init.lua new file mode 100644 index 0000000..3430e00 --- /dev/null +++ b/.config/yazi/init.lua @@ -0,0 +1,14 @@ +Status:children_add(function() + local h = cx.active.current.hovered + if not h or ya.target_family() ~= "unix" then + return "" + end + + return ui.Line { + ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"), + ":", + ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"), + " ", + } +end, 500, Status.RIGHT) +require("full-border"):setup() diff --git a/.config/yazi/package.toml b/.config/yazi/package.toml new file mode 100644 index 0000000..7b32e78 --- /dev/null +++ b/.config/yazi/package.toml @@ -0,0 +1,7 @@ +[[plugin.deps]] +use = "yazi-rs/plugins:full-border" +rev = "1ab21d4" +hash = "3996fc74044bc44144b323686f887e1" + +[flavor] +deps = [] diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..c5802e2 --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,7 @@ +[mgr] +ratio = [1, 1, 1] + +# [opener] +# edit = [ +# { run = "~/.config/yazi/edit.sh \"$@\"", block = true } +# ] diff --git a/.fdignore b/.fdignore new file mode 100644 index 0000000..0becbdc --- /dev/null +++ b/.fdignore @@ -0,0 +1,9 @@ +.git +build + +drive_c +pfx +dosdevices +SteamLinux* + +*.mca diff --git a/.local/bin/theme b/.local/bin/theme new file mode 100755 index 0000000..9c2da6b --- /dev/null +++ b/.local/bin/theme @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +set -euo pipefail +SCRIPT=$(basename "$0") +CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}" +VCONSOLE_UPDATE="$HOME/.local/bin/vconsole-colors.sh" +WALLPAPER="${CONFIG}/hypr/wallpaper" + +QUIET_MODE=false +SKIP_VCONSOLE=false +SKIP_INITRAMFS=false + +show_help() { + cat < + +A script to update system theme based on a wallpaper image. + +Options: + -h, --help Show this help message and exit + -q, --quiet Quiet mode: Suppress output to the terminal + -n Skip prompting to regenerate initramfs + -nn Skip prompting to update vconsole.conf + +Examples: + $0 /path/to/image/sunset.jpg # Normal theme update + $0 -q ~/wallpapers/night.jpg # Quiet mode theme update + $0 -q -n ~/Downloads/nature.jpg # Combine quiet mode and skip initramfs + +Requirements: + - Requires an input image file + - Depends on pywal, wpg, swaync, pywalfox, and spicetify +EOF + exit 0 +} + +validate_image() { + local file="$1" + local mime_type + + [[ -f "$file" ]] || die "File '$file' not found." + + mime_type=$(file --mime-type -b "$file") + + local allowed_types=( + "image/jpeg" + "image/png" + "image/gif" + "image/bmp" + "image/webp" + "image/tiff" + "image/x-icon" + "image/svg+xml" + ) + + local is_image=false + for type in "${allowed_types[@]}"; do + if [[ "$mime_type" == "$type" ]]; then + is_image=true + break + fi + done + + if [[ "$is_image" == false ]]; then + die "File '$file' is not a valid image. Mime type detected: $mime_type" + fi +} + +quiet_exec() { + if [[ "$QUIET_MODE" == true ]]; then + "$@" >/dev/null 2>&1 || return 1 + else + "$@" || return 1 + fi +} + +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + show_help + ;; + -q|--quiet) + QUIET_MODE=true + shift + ;; + -n) + SKIP_INITRAMFS=true + shift + ;; + -nn) + SKIP_VCONSOLE=true + shift + ;; + *) + break + ;; + esac +done + +log() { + if [[ "$QUIET_MODE" == false ]]; then + logger -i -t "$SCRIPT" "$*" + fi +} + +die() { + logger -i -t "$SCRIPT" ":Error:" "$*" + exit 1 +} + +[[ $# -eq 1 ]] || die "Usage: $0 [-h] [-q] [-n] [-nn] " +IMAGE="$1" + +validate_image "$IMAGE" + +quiet_exec wal -i "$IMAGE" -n || die "Pywal update failed" +quiet_exec wpg -a "$(echo "$IMAGE")" || die "Pywal adding failed." +quiet_exec wpg -s "$(basename "$IMAGE")" || die "Pywal update failed." +quiet_exec ln -sf "$(realpath "$IMAGE")" "$WALLPAPER" +# quiet_exec eww reload +# quiet_exec swaync-client -R +# quiet_exec killall swaync +quiet_exec pywalfox update +quiet_exec spicetify apply +# quiet_exec swaync-client -rs + +notify-send "New theme applied!" + +if [[ "$SKIP_VCONSOLE" == false ]]; then + if [[ "$QUIET_MODE" == false ]]; then + read -rp "Update vconsole.conf? (y/N): " VCONSOLE + else + VCONSOLE="y" + fi + + if [[ "${VCONSOLE,,}" =~ ^y(es)?$ ]]; then + [[ -f "$VCONSOLE_UPDATE" ]] || die "Vconsole update script not found" + log "Running vconsole-colors update script..." + + quiet_exec sudo bash "$VCONSOLE_UPDATE" + + if [[ "$SKIP_INITRAMFS" == false ]]; then + if [[ "$QUIET_MODE" == false ]]; then + read -rp "Regenerate initramfs? Colors won't apply until it is. (y/N): " INITRAMFS + else + INITRAMFS="y" + fi + + if [[ "${INITRAMFS,,}" =~ ^y(es)?$ ]]; then + log "Regenerating initramfs from theme swap..." + quiet_exec sudo mkinitcpio -P + else + log "Not regenerating initramfs. New colors won't apply until it has been." + fi + fi + else + log "Skipping vconsole.conf update for new theme." + fi +fi + +exit 0 diff --git a/.local/bin/theme-reload b/.local/bin/theme-reload new file mode 100755 index 0000000..543bcba --- /dev/null +++ b/.local/bin/theme-reload @@ -0,0 +1,38 @@ +#!/bin/bash + +COUNT=0 +POTENTIAL=0 +if command -v eww &> /dev/null; then + eww reload + COUNT=$(( COUNT + $? )) + ((POTENTIAL++)) +fi + +if command -v pywalfox &> /dev/null; then + pywalfox update + COUNT=$(( COUNT + $? )) + ((POTENTIAL++)) +fi + +if command -v spicetify &> /dev/null; then + spicetify apply + COUNT=$(( COUNT + 0 )) + ((POTENTIAL++)) +fi + +if command -v swaync &> /dev/null; then + swaync-client -rs + COUNT=$(( COUNT + $? )) + ((POTENTIAL++)) +fi + +if [[ $COUNT -ne 0 ]] && [[ $COUNT -eq $POTENTIAL ]]; then + notify-send -u critical "Failed to reload." + exit 0 +fi +if [[ $COUNT -ne 0 ]]; then + notify-send -u critical "Failed to reload some colors" +else + notify-send "Colors changed" --expire-time=1000 +fi +exit 0 diff --git a/.local/bin/universal_run.sh b/.local/bin/universal_run.sh new file mode 100755 index 0000000..7c4e933 --- /dev/null +++ b/.local/bin/universal_run.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -eo pipefail + +SCRIPT="${BASH_SOURCE[0]}" + +fail() { + echo "ERR - $SCRIPT: $1" + exit 1 +} + +DIR="$1" +if [[ -z $DIR ]]; then + DIR=$(pwd) +fi +if [[ ! -d $DIR ]]; then + echo "Usage: $SCRIPT " + exit 1 +fi + +pushd "$DIR" || fail "Couldn't enter directory." + if [[ -x "run.sh" ]]; then + ./run.sh + elif [[ -f "Cargo.toml" ]]; then + cargo run + fi +popd >/dev/null || exit 1 diff --git a/.local/bin/vconsole-colors.sh b/.local/bin/vconsole-colors.sh new file mode 100755 index 0000000..42b4b63 --- /dev/null +++ b/.local/bin/vconsole-colors.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +SCRIPT_NAME=$(basename "$0") +VERSION="1.0.0" + +log() { + local level="$1" + local message="$2" + local timestamp + timestamp=$(date "+%Y-%m-%d %H:%M:%S") + echo "[${timestamp}] [${level}] ${message}" >&2 +} + +check_root() { + if [[ $EUID -ne 0 ]]; then + log "ERROR" "This script must be run with sudo or as root." + exit 1 + fi +} + +get_real_user() { + USER="${SUDO_USER:-$(whoami)}" + if [[ -z "$USER" ]]; then + log "ERROR" "Unable to determine non-root user." + exit 1 + fi + COLOR_FILE="/home/$USER/.cache/wal/colors.sh" +} + +validate_color_source() { + if [[ ! -f "$COLOR_FILE" ]]; then + log "ERROR" "Color configuration file not found: $COLOR_FILE" + exit 1 + fi + source "$COLOR_FILE" +} + +update_vconsole() { + local color_var="$1" + local color_value="$2" + local vconsole_conf="/etc/vconsole.conf" + + color_value=$(printf "%s" "$color_value" | tr '[:upper:]' '[:lower:]' | sed 's/^#//') + + cp "$vconsole_conf" "${vconsole_conf}.bak" + + if grep -q "^COLOR_${color_var}=" "$vconsole_conf"; then + sed -i "s/^COLOR_${color_var}=.*/COLOR_${color_var}=${color_value}/" "$vconsole_conf" + else + echo "COLOR_${color_var}=${color_value}" >> "$vconsole_conf" + fi +} + +main() { + while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + echo "Usage: (as root) $SCRIPT_NAME [options]" + echo "Updates vconsole.conf with pywal color scheme" + echo " -h, --help Show this help message" + echo " -v, --version Show script version" + exit 0 + ;; + -v|--version) + echo "$SCRIPT_NAME version $VERSION" + exit 0 + ;; + *) + log "ERROR" "Unknown option: $1" + exit 1 + ;; + esac + done + + check_root + get_real_user + validate_color_source + + for i in {0..15}; do + color_var="color$i" + if [[ -n "${!color_var:-}" ]]; then + update_vconsole "$i" "${!color_var}" + fi + done + + log "INFO" "vconsole.conf updated successfully!" +} + +main "$@" diff --git a/.local/bin/weather b/.local/bin/weather new file mode 100755 index 0000000..ed0de76 --- /dev/null +++ b/.local/bin/weather @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_NAME=$(basename "${BASH_SOURCE[0]}") +WEATHER="/tmp/wttr.in" +CONFIG="$XDG_CONFIG_HOME/fastfetch/small.jsonc" + +log() { + logger -i -t "$SCRIPT_NAME" "$*" +} + +main() { + TIME=$(date +%H:%M) + if [[ "$TIME" < "12:00" ]] && [[ "$TIME" > "00:00" ]]; then + log "Getting weather and sunrise time." + curl -s wttr.in/hartford\?format="%c\n%t\n%S\n" > "$WEATHER" + else + log "Getting weather and sunset time." + curl -s wttr.in/hartford\?format="%c\n%t\n%s\n" > "$WEATHER" + fi + CURRENT=$(cat "$WEATHER") + CONDITION=$(echo "$CURRENT" | head -n 1 | perl -CS -pe 's/\x{FE0F}//g' | tr -d '[:space:]' | xargs) envsubst < "$CONFIG" > /tmp/small.jsonc +} + +main diff --git a/.profile b/.profile new file mode 100644 index 0000000..541c534 --- /dev/null +++ b/.profile @@ -0,0 +1,35 @@ +export TERMINAL=kitty +export BROWSER=librewolf +export EDITOR=helix +export VISUAL=helix +export BAT_THEME=base16 + +# XDG STANDARD DIRS +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_STATE_HOME="$HOME/.local/state" +export XDG_CACHE_HOME="$HOME/.cache" + +# XDG-NINJA FIXES +# +export HISTFILE="$XDG_STATE_HOME/bash/history" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" +export XCURSOR_PATH=/usr/share/icons:$XDG_DATA_HOME/icons +export NVM_DIR="$XDG_DATA_HOME/nvm" +export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel" +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" +export W3M_DIR="$XDG_DATA_HOME/w3m" +export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" +export _JAVA_OPTIONS=-Djava.utils.prefs.userRoot="$XDG_CONFIG_HOME/java" +export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" +export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +export SQLITE_HISTORY="$XDG_CACHE_HOME/sqlite_history" + +export PATH=$PATH:"$HOME/.local/bin" + +# PATH CLEANUP +# shellcheck disable=SC2155 +export PATH=$(printf "%s" "$PATH" | awk -v RS=':' '!a[$1]++ { if (NR > 1) printf RS; printf $1 }') diff --git a/README b/README new file mode 100644 index 0000000..3964154 --- /dev/null +++ b/README @@ -0,0 +1,22 @@ +Dotfiles I use + +Requires: + +bat +curl +eza +fd +fish +fastfetch +fzf +helix +hyprland +kitty +mpd +python-pywal +quickshell +rofi +ripgrep +swaybg +wpgtk +yazi