├── .config ├── fish │ ├── completions │ │ └── fisher.fish │ ├── conf.d │ │ └── z.fish │ ├── config-linux.fish │ ├── config.fish │ ├── fish_plugins │ ├── fish_variables │ ├── functions │ │ ├── __z.fish │ │ ├── __z_add.fish │ │ ├── __z_clean.fish │ │ ├── __z_complete.fish │ │ ├── fish_user_key_bindings.fish │ │ ├── fisher.fish │ │ ├── peco_change_directory.fish │ │ └── peco_select_history.fish │ └── themes │ │ └── Dracula Official.theme ├── i3 │ ├── config │ ├── i3blocks.conf │ ├── keybindings │ └── scripts │ │ ├── bandwidth2 │ │ ├── battery-pinebook-pro │ │ ├── battery1 │ │ ├── battery2 │ │ ├── blur-lock │ │ ├── cpu_usage │ │ ├── disk │ │ ├── empty_workspace │ │ ├── keyboard-layout │ │ ├── keyhint │ │ ├── keyhint-2 │ │ ├── memory │ │ ├── openweather │ │ ├── openweather-city │ │ ├── openweather.conf │ │ ├── power-profiles │ │ ├── powermenu │ │ ├── ppd-status │ │ ├── temperature │ │ ├── volume │ │ ├── volume_brightness.sh │ │ └── vpn ├── redshift │ ├── hooks │ │ └── brightness.sh │ └── redshift.conf ├── starship.toml └── wezterm │ └── wezterm.lua ├── .gitconfig ├── .markdownlint.yml ├── README.md └── images ├── desktop-screenshot-01.png ├── desktop-screenshot-02.png ├── desktop-screenshot-03.png ├── i3wm-intro-screenshot.png ├── ventoy-disk-screenshot.png ├── webarebear-01.jpg ├── webarebear-02.jpg └── yay-install-screenshot.png /.config/fish/completions/fisher.fish: -------------------------------------------------------------------------------- 1 | complete --command fisher --exclusive --long help --description "Print help" 2 | complete --command fisher --exclusive --long version --description "Print version" 3 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" 4 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" 5 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" 6 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" 7 | complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" 8 | -------------------------------------------------------------------------------- /.config/fish/conf.d/z.fish: -------------------------------------------------------------------------------- 1 | if test -z "$Z_DATA" 2 | if test -z "$XDG_DATA_HOME" 3 | set -U Z_DATA_DIR "$HOME/.local/share/z" 4 | else 5 | set -U Z_DATA_DIR "$XDG_DATA_HOME/z" 6 | end 7 | set -U Z_DATA "$Z_DATA_DIR/data" 8 | end 9 | 10 | if test ! -e "$Z_DATA" 11 | if test ! -e "$Z_DATA_DIR" 12 | mkdir -p -m 700 "$Z_DATA_DIR" 13 | end 14 | touch "$Z_DATA" 15 | end 16 | 17 | if test -z "$Z_CMD" 18 | set -U Z_CMD z 19 | end 20 | 21 | set -U ZO_CMD "$Z_CMD"o 22 | 23 | if test ! -z $Z_CMD 24 | function $Z_CMD -d "jump around" 25 | __z $argv 26 | end 27 | end 28 | 29 | if test ! -z $ZO_CMD 30 | function $ZO_CMD -d "open target dir" 31 | __z -d $argv 32 | end 33 | end 34 | 35 | if not set -q Z_EXCLUDE 36 | set -U Z_EXCLUDE "^$HOME\$" 37 | else if contains $HOME $Z_EXCLUDE 38 | # Workaround: migrate old default values to a regex (see #90). 39 | set Z_EXCLUDE (string replace -r -- "^$HOME\$" '^'$HOME'$$' $Z_EXCLUDE) 40 | end 41 | 42 | # Setup completions once first 43 | __z_complete 44 | 45 | function __z_on_variable_pwd --on-variable PWD 46 | __z_add 47 | end 48 | 49 | function __z_uninstall --on-event z_uninstall 50 | functions -e __z_on_variable_pwd 51 | functions -e $Z_CMD 52 | functions -e $ZO_CMD 53 | 54 | if test ! -z "$Z_DATA" 55 | printf "To completely erase z's data, remove:\n" >/dev/stderr 56 | printf "%s\n" "$Z_DATA" >/dev/stderr 57 | end 58 | 59 | set -e Z_CMD 60 | set -e ZO_CMD 61 | set -e Z_DATA 62 | set -e Z_EXCLUDE 63 | end 64 | -------------------------------------------------------------------------------- /.config/fish/config-linux.fish: -------------------------------------------------------------------------------- 1 | if type -q eza 2 | alias ll "eza -l -g --icons --header --time-style=default" 3 | alias lla "ll -a" 4 | alias llt "ll --tree" 5 | alias llat "ll -a --tree" 6 | end -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | if status is-interactive 2 | # Commands to run in interactive sessions can go here 3 | alias gg="ghq get" 4 | end 5 | 6 | # Go 7 | set -g GOPATH $HOME/go 8 | set -gx PATH $GOPATH/bin $PATH 9 | 10 | switch (uname) 11 | case Darwin 12 | source (dirname (status --current-filename))/config-osx.fish 13 | case Linux 14 | source (dirname (status --current-filename))/config-linux.fish 15 | case '*' 16 | source (dirname (status --current-filename))/config-windows.fish 17 | end 18 | 19 | # starship 20 | starship init fish | source 21 | -------------------------------------------------------------------------------- /.config/fish/fish_plugins: -------------------------------------------------------------------------------- 1 | jorgebucaran/fisher 2 | jethrokuan/z 3 | dracula/fish 4 | -------------------------------------------------------------------------------- /.config/fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR ZO_CMD:zo 4 | SETUVAR Z_CMD:z 5 | SETUVAR Z_DATA:/home/ngockhoi96/\x2elocal/share/z/data 6 | SETUVAR Z_DATA_DIR:/home/ngockhoi96/\x2elocal/share/z 7 | SETUVAR Z_EXCLUDE:\x5e/home/ngockhoi96\x24 8 | SETUVAR __fish_initialized:3800 9 | SETUVAR _fisher_dracula_2F_fish_files:\x7e/\x2econfig/fish/themes/Dracula\x20Official\x2etheme\x1e\x7e/\x2econfig/fish/conf\x2ed/dracula\x2efish 10 | SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish 11 | SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish 12 | SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejethrokuan/z\x1edracula/fish 13 | SETUVAR _fisher_upgraded_to_4_4:\x1d 14 | SETUVAR fish_color_autosuggestion:brblack 15 | SETUVAR fish_color_cancel:\x2dr 16 | SETUVAR fish_color_command:normal 17 | SETUVAR fish_color_comment:red 18 | SETUVAR fish_color_cwd:green 19 | SETUVAR fish_color_cwd_root:red 20 | SETUVAR fish_color_end:green 21 | SETUVAR fish_color_error:brred 22 | SETUVAR fish_color_escape:brcyan 23 | SETUVAR fish_color_history_current:\x2d\x2dbold 24 | SETUVAR fish_color_host:normal 25 | SETUVAR fish_color_host_remote:yellow 26 | SETUVAR fish_color_normal:normal 27 | SETUVAR fish_color_operator:brcyan 28 | SETUVAR fish_color_param:cyan 29 | SETUVAR fish_color_quote:yellow 30 | SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold 31 | SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack 32 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 33 | SETUVAR fish_color_status:red 34 | SETUVAR fish_color_user:brgreen 35 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 36 | SETUVAR fish_key_bindings:fish_default_key_bindings 37 | SETUVAR fish_pager_color_completion:normal 38 | SETUVAR fish_pager_color_description:yellow\x1e\x2di 39 | SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 40 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 41 | SETUVAR fish_pager_color_selected_background:\x2dr 42 | -------------------------------------------------------------------------------- /.config/fish/functions/__z.fish: -------------------------------------------------------------------------------- 1 | function __z -d "Jump to a recent directory." 2 | function __print_help -d "Print z help." 3 | printf "Usage: $Z_CMD [-celrth] string1 string2...\n\n" 4 | printf " -c --clean Removes directories that no longer exist from $Z_DATA\n" 5 | printf " -d --dir Opens matching directory using system file manager.\n" 6 | printf " -e --echo Prints best match, no cd\n" 7 | printf " -l --list List matches and scores, no cd\n" 8 | printf " -p --purge Delete all entries from $Z_DATA\n" 9 | printf " -r --rank Search by rank\n" 10 | printf " -t --recent Search by recency\n" 11 | printf " -x --delete Removes the current directory from $Z_DATA\n" 12 | printf " -h --help Print this help\n\n" 13 | end 14 | function __z_legacy_escape_regex 15 | # taken from escape_string_pcre2 in fish 16 | # used to provide compatibility with fish 2 17 | for c in (string split -- '' $argv) 18 | if contains $c (string split '' '.^$*+()?[{}\\|-]') 19 | printf \\ 20 | end 21 | printf '%s' $c 22 | end 23 | end 24 | 25 | set -l options h/help c/clean e/echo l/list p/purge r/rank t/recent d/directory x/delete 26 | 27 | argparse $options -- $argv 28 | 29 | if set -q _flag_help 30 | __print_help 31 | return 0 32 | else if set -q _flag_clean 33 | __z_clean 34 | printf "%s cleaned!\n" $Z_DATA 35 | return 0 36 | else if set -q _flag_purge 37 | echo >$Z_DATA 38 | printf "%s purged!\n" $Z_DATA 39 | return 0 40 | else if set -q _flag_delete 41 | sed -i -e "\:^$PWD|.*:d" $Z_DATA 42 | return 0 43 | end 44 | 45 | set -l typ 46 | 47 | if set -q _flag_rank 48 | set typ rank 49 | else if set -q _flag_recent 50 | set typ recent 51 | end 52 | 53 | set -l z_script ' 54 | function frecent(rank, time) { 55 | dx = t-time 56 | if( dx < 3600 ) return rank*4 57 | if( dx < 86400 ) return rank*2 58 | if( dx < 604800 ) return rank/2 59 | return rank/4 60 | } 61 | 62 | function output(matches, best_match, common) { 63 | # list or return the desired directory 64 | if( list ) { 65 | cmd = "sort -nr" 66 | for( x in matches ) { 67 | if( matches[x] ) { 68 | printf "%-10s %s\n", matches[x], x | cmd 69 | } 70 | } 71 | } else { 72 | if( common ) best_match = common 73 | print best_match 74 | } 75 | } 76 | 77 | function common(matches) { 78 | # find the common root of a list of matches, if it exists 79 | for( x in matches ) { 80 | if( matches[x] && (!short || length(x) < length(short)) ) { 81 | short = x 82 | } 83 | } 84 | if( short == "/" ) return 85 | for( x in matches ) if( matches[x] && index(x, short) != 1 ) { 86 | return 87 | } 88 | return short 89 | } 90 | 91 | BEGIN { 92 | hi_rank = ihi_rank = -9999999999 93 | } 94 | { 95 | if( typ == "rank" ) { 96 | rank = $2 97 | } else if( typ == "recent" ) { 98 | rank = $3 - t 99 | } else rank = frecent($2, $3) 100 | if( $1 ~ q ) { 101 | matches[$1] = rank 102 | } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank 103 | if( matches[$1] && matches[$1] > hi_rank ) { 104 | best_match = $1 105 | hi_rank = matches[$1] 106 | } else if( imatches[$1] && imatches[$1] > ihi_rank ) { 107 | ibest_match = $1 108 | ihi_rank = imatches[$1] 109 | } 110 | } 111 | 112 | END { 113 | # prefer case sensitive 114 | if( best_match ) { 115 | output(matches, best_match, common(matches)) 116 | } else if( ibest_match ) { 117 | output(imatches, ibest_match, common(imatches)) 118 | } 119 | } 120 | ' 121 | 122 | set -l qs 123 | for arg in $argv 124 | set -l escaped $arg 125 | if string escape --style=regex '' >/dev/null 2>&1 # use builtin escape if available 126 | set escaped (string escape --style=regex -- $escaped) 127 | else 128 | set escaped (__z_legacy_escape_regex $escaped) 129 | end 130 | # Need to escape twice, see https://www.math.utah.edu/docs/info/gawk_5.html#SEC32 131 | set escaped (string replace --all -- \\ \\\\ $escaped) 132 | set qs $qs $escaped 133 | end 134 | set -l q (string join -- '.*' $qs) 135 | 136 | if set -q _flag_list 137 | # Handle list separately as it can print common path information to stderr 138 | # which cannot be captured from a subcommand. 139 | command awk -v t=(date +%s) -v list="list" -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA" 140 | return 141 | end 142 | 143 | set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA") 144 | 145 | if test "$status" -gt 0 146 | return 147 | end 148 | 149 | if test -z "$target" 150 | printf "'%s' did not match any results\n" "$argv" 151 | return 1 152 | end 153 | 154 | if set -q _flag_echo 155 | printf "%s\n" "$target" 156 | else if set -q _flag_directory 157 | if test -n "$ZO_METHOD" 158 | type -q "$ZO_METHOD"; and "$ZO_METHOD" "$target"; and return $status 159 | echo "Cannot open with ZO_METHOD set to $ZO_METHOD"; and return 1 160 | else if test "$OS" = Windows_NT 161 | # Be careful, in msys2, explorer always return 1 162 | type -q explorer; and explorer "$target" 163 | return 0 164 | echo "Cannot open file explorer" 165 | return 1 166 | else 167 | type -q xdg-open; and xdg-open "$target"; and return $status 168 | type -q open; and open "$target"; and return $status 169 | echo "Not sure how to open file manager"; and return 1 170 | end 171 | else 172 | pushd "$target" 173 | end 174 | end 175 | -------------------------------------------------------------------------------- /.config/fish/functions/__z_add.fish: -------------------------------------------------------------------------------- 1 | function __z_add -d "Add PATH to .z file" 2 | test -n "$fish_private_mode"; and return 0 3 | 4 | for i in $Z_EXCLUDE 5 | if string match -r $i $PWD >/dev/null 6 | return 0 #Path excluded 7 | end 8 | end 9 | 10 | set -l tmpfile (mktemp $Z_DATA.XXXXXX) 11 | 12 | if test -f $tmpfile 13 | set -l path (string replace --all \\ \\\\ $PWD) 14 | command awk -v path=$path -v now=(date +%s) -F "|" ' 15 | BEGIN { 16 | rank[path] = 1 17 | time[path] = now 18 | } 19 | $2 >= 1 { 20 | if( $1 == path ) { 21 | rank[$1] = $2 + 1 22 | time[$1] = now 23 | } 24 | else { 25 | rank[$1] = $2 26 | time[$1] = $3 27 | } 28 | count += $2 29 | } 30 | END { 31 | if( count > 1000 ) { 32 | for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging 33 | } 34 | else for( i in rank ) print i "|" rank[i] "|" time[i] 35 | } 36 | ' $Z_DATA 2>/dev/null >$tmpfile 37 | 38 | if test ! -z "$Z_OWNER" 39 | chown $Z_OWNER:(id -ng $Z_OWNER) $tmpfile 40 | end 41 | # 42 | # Don't use redirection here as it can lead to a race condition where $Z_DATA is clobbered. 43 | # Note: There is a still a possible race condition where an old version of $Z_DATA is 44 | # read by one instance of Fish before another instance of Fish writes its copy. 45 | # 46 | command mv $tmpfile $Z_DATA 47 | or command rm $tmpfile 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /.config/fish/functions/__z_clean.fish: -------------------------------------------------------------------------------- 1 | function __z_clean -d "Clean up .z file to remove paths no longer valid" 2 | set -l tmpfile (mktemp $Z_DATA.XXXXXX) 3 | 4 | if test -f $tmpfile 5 | while read line 6 | set -l path (string split '|' $line)[1] 7 | test -d $path; and echo $line 8 | end <$Z_DATA >$tmpfile 9 | command mv -f $tmpfile $Z_DATA 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /.config/fish/functions/__z_complete.fish: -------------------------------------------------------------------------------- 1 | function __z_complete -d "add completions" 2 | complete -c $Z_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k 3 | complete -c $ZO_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k 4 | 5 | complete -c $Z_CMD -s c -l clean -d "Cleans out $Z_DATA" 6 | complete -c $Z_CMD -s e -l echo -d "Prints best match, no cd" 7 | complete -c $Z_CMD -s l -l list -d "List matches, no cd" 8 | complete -c $Z_CMD -s p -l purge -d "Purges $Z_DATA" 9 | complete -c $Z_CMD -s r -l rank -d "Searches by rank, cd" 10 | complete -c $Z_CMD -s t -l recent -d "Searches by recency, cd" 11 | complete -c $Z_CMD -s h -l help -d "Print help" 12 | complete -c $Z_CMD -s x -l delete -d "Removes the current directory from $Z_DATA" 13 | end 14 | -------------------------------------------------------------------------------- /.config/fish/functions/fish_user_key_bindings.fish: -------------------------------------------------------------------------------- 1 | function fish_user_key_bindings 2 | # peco 3 | bind \cr peco_select_history # Bind for peco select history to Ctrl+R 4 | bind \cf peco_change_directory # Bind for peco change directory to Ctrl+F 5 | 6 | # vim-like 7 | bind \cl forward-char 8 | 9 | # prevent iterm2 from closing when typing Ctrl-D (EOF) 10 | bind \cd delete-char 11 | end -------------------------------------------------------------------------------- /.config/fish/functions/fisher.fish: -------------------------------------------------------------------------------- 1 | function fisher --argument-names cmd --description "A plugin manager for Fish" 2 | set --query fisher_path || set --local fisher_path $__fish_config_dir 3 | set --local fisher_version 4.4.5 4 | set --local fish_plugins $__fish_config_dir/fish_plugins 5 | 6 | switch "$cmd" 7 | case -v --version 8 | echo "fisher, version $fisher_version" 9 | case "" -h --help 10 | echo "Usage: fisher install Install plugins" 11 | echo " fisher remove Remove installed plugins" 12 | echo " fisher update Update installed plugins" 13 | echo " fisher update Update all installed plugins" 14 | echo " fisher list [] List installed plugins matching regex" 15 | echo "Options:" 16 | echo " -v, --version Print version" 17 | echo " -h, --help Print this help message" 18 | echo "Variables:" 19 | echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~ 20 | case ls list 21 | string match --entire --regex -- "$argv[2]" $_fisher_plugins 22 | case install update remove 23 | isatty || read --local --null --array stdin && set --append argv $stdin 24 | 25 | set --local install_plugins 26 | set --local update_plugins 27 | set --local remove_plugins 28 | set --local arg_plugins $argv[2..-1] 29 | set --local old_plugins $_fisher_plugins 30 | set --local new_plugins 31 | 32 | test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins | string replace -- \~ ~) 33 | 34 | if ! set --query argv[2] 35 | if test "$cmd" != update 36 | echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 37 | else if ! set --query file_plugins 38 | echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 39 | end 40 | set arg_plugins $file_plugins 41 | end 42 | 43 | for plugin in $arg_plugins 44 | set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin) 45 | contains -- "$plugin" $new_plugins || set --append new_plugins $plugin 46 | end 47 | 48 | if set --query argv[2] 49 | for plugin in $new_plugins 50 | if contains -- "$plugin" $old_plugins 51 | test "$cmd" = remove && 52 | set --append remove_plugins $plugin || 53 | set --append update_plugins $plugin 54 | else if test "$cmd" = install 55 | set --append install_plugins $plugin 56 | else 57 | echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 58 | end 59 | end 60 | else 61 | for plugin in $new_plugins 62 | contains -- "$plugin" $old_plugins && 63 | set --append update_plugins $plugin || 64 | set --append install_plugins $plugin 65 | end 66 | 67 | for plugin in $old_plugins 68 | contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin 69 | end 70 | end 71 | 72 | set --local pid_list 73 | set --local source_plugins 74 | set --local fetch_plugins $update_plugins $install_plugins 75 | set --local fish_path (status fish-path) 76 | 77 | echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) 78 | 79 | for plugin in $fetch_plugins 80 | set --local source (command mktemp -d) 81 | set --append source_plugins $source 82 | 83 | command mkdir -p $source/{completions,conf.d,themes,functions} 84 | 85 | $fish_path --command " 86 | if test -e $plugin 87 | command cp -Rf $plugin/* $source 88 | else 89 | set temp (command mktemp -d) 90 | set repo (string split -- \@ $plugin) || set repo[2] HEAD 91 | 92 | if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1]) 93 | set name (string split -- / \$path)[-1] 94 | set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz 95 | else 96 | set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2] 97 | end 98 | 99 | echo Fetching (set_color --underline)\$url(set_color normal) 100 | 101 | if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null 102 | command cp -Rf \$temp/*/* $source 103 | else 104 | echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 105 | command rm -rf $source 106 | end 107 | 108 | command rm -rf \$temp 109 | end 110 | 111 | set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files 112 | " & 113 | 114 | set --append pid_list (jobs --last --pid) 115 | end 116 | 117 | wait $pid_list 2>/dev/null 118 | 119 | for plugin in $fetch_plugins 120 | if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source 121 | if set --local index (contains --index -- "$plugin" $install_plugins) 122 | set --erase install_plugins[$index] 123 | else 124 | set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] 125 | end 126 | end 127 | end 128 | 129 | for plugin in $update_plugins $remove_plugins 130 | if set --local index (contains --index -- "$plugin" $_fisher_plugins) 131 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 132 | 133 | if contains -- "$plugin" $remove_plugins 134 | for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) 135 | emit {$name}_uninstall 136 | end 137 | printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ 138 | set --erase _fisher_plugins[$index] 139 | end 140 | 141 | command rm -rf (string replace -- \~ ~ $$plugin_files_var) 142 | 143 | functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) 144 | 145 | for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) 146 | complete --erase --command $name 147 | end 148 | 149 | set --erase $plugin_files_var 150 | end 151 | end 152 | 153 | if set --query update_plugins[1] || set --query install_plugins[1] 154 | command mkdir -p $fisher_path/{functions,themes,conf.d,completions} 155 | end 156 | 157 | for plugin in $update_plugins $install_plugins 158 | set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] 159 | set --local files $source/{functions,themes,conf.d,completions}/* 160 | 161 | if set --local index (contains --index -- $plugin $install_plugins) 162 | set --local user_files $fisher_path/{functions,themes,conf.d,completions}/* 163 | set --local conflict_files 164 | 165 | for file in (string replace -- $source/ $fisher_path/ $files) 166 | contains -- $file $user_files && set --append conflict_files $file 167 | end 168 | 169 | if set --query conflict_files[1] && set --erase install_plugins[$index] 170 | echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 171 | continue 172 | end 173 | end 174 | 175 | for file in (string replace -- $source/ "" $files) 176 | command cp -RLf $source/$file $fisher_path/$file 177 | end 178 | 179 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 180 | 181 | set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~) 182 | 183 | contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin 184 | contains -- $plugin $install_plugins && set --local event install || set --local event update 185 | 186 | printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ 187 | 188 | for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~) 189 | source $file 190 | if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) 191 | emit {$name}_$event 192 | end 193 | end 194 | end 195 | 196 | command rm -rf $source_plugins 197 | 198 | if set --query _fisher_plugins[1] 199 | set --local commit_plugins 200 | 201 | for plugin in $file_plugins 202 | contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin 203 | end 204 | 205 | for plugin in $_fisher_plugins 206 | contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin 207 | end 208 | 209 | string replace --regex -- $HOME \~ $commit_plugins >$fish_plugins 210 | else 211 | set --erase _fisher_plugins 212 | command rm -f $fish_plugins 213 | end 214 | 215 | set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) 216 | 217 | test "$total" != "0 0 0" && echo (string join ", " ( 218 | test $total[1] = 0 || echo "Installed $total[1]") ( 219 | test $total[2] = 0 || echo "Updated $total[2]") ( 220 | test $total[3] = 0 || echo "Removed $total[3]") 221 | ) plugin/s 222 | case \* 223 | echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 224 | end 225 | end 226 | 227 | if ! set --query _fisher_upgraded_to_4_4 228 | set --universal _fisher_upgraded_to_4_4 229 | if functions --query _fisher_list 230 | set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share 231 | command rm -rf $XDG_DATA_HOME/fisher 232 | functions --erase _fisher_{list,plugin_parse} 233 | fisher update >/dev/null 2>/dev/null 234 | else 235 | for var in (set --names | string match --entire --regex '^_fisher_.+_files$') 236 | set $var (string replace -- ~ \~ $$var) 237 | end 238 | functions --erase _fisher_fish_postexec 239 | end 240 | end 241 | -------------------------------------------------------------------------------- /.config/fish/functions/peco_change_directory.fish: -------------------------------------------------------------------------------- 1 | function _peco_change_directory 2 | if [ (count $argv) ] 3 | peco --layout=bottom-up --query "$argv "|perl -pe 's/([ ()])/\\\\$1/g'|read foo 4 | else 5 | peco --layout=bottom-up |perl -pe 's/([ ()])/\\\\$1/g'|read foo 6 | end 7 | if [ $foo ] 8 | builtin cd $foo 9 | commandline -r '' 10 | commandline -f repaint 11 | else 12 | commandline '' 13 | end 14 | end 15 | 16 | function peco_change_directory 17 | begin 18 | echo $HOME/.config 19 | ghq list -p 20 | ls -ad */|perl -pe "s#^#$PWD/#"|grep -v \.git 21 | ls -ad $HOME/workspace/*/* |grep -v \.git 22 | end | sed -e 's/\/$//' | awk '!a[$0]++' | _peco_change_directory $argv 23 | end -------------------------------------------------------------------------------- /.config/fish/functions/peco_select_history.fish: -------------------------------------------------------------------------------- 1 | function peco_select_history 2 | if test (count $argv) = 0 3 | set peco_flags --layout=bottom-up 4 | else 5 | set peco_flags --layout=bottom-up --query "$argv" 6 | end 7 | 8 | history|peco $peco_flags|read foo 9 | 10 | if [ $foo ] 11 | commandline $foo 12 | else 13 | commandline '' 14 | end 15 | end -------------------------------------------------------------------------------- /.config/fish/themes/Dracula Official.theme: -------------------------------------------------------------------------------- 1 | # Dracula Color Palette 2 | # 3 | # Foreground: f8f8f2 4 | # Selection: 44475a 5 | # Comment: 6272a4 6 | # Red: ff5555 7 | # Orange: ffb86c 8 | # Yellow: f1fa8c 9 | # Green: 50fa7b 10 | # Purple: bd93f9 11 | # Cyan: 8be9fd 12 | # Pink: ff79c6 13 | 14 | # Syntax Highlighting Colors 15 | fish_color_normal f8f8f2 16 | fish_color_command 8be9fd 17 | fish_color_keyword ff79c6 18 | fish_color_quote f1fa8c 19 | fish_color_redirection f8f8f2 20 | fish_color_end ffb86c 21 | fish_color_error ff5555 22 | fish_color_param bd93f9 23 | fish_color_comment 6272a4 24 | fish_color_selection --background=44475a 25 | fish_color_search_match --background=44475a 26 | fish_color_operator 50fa7b 27 | fish_color_escape ff79c6 28 | fish_color_autosuggestion 6272a4 29 | fish_color_cancel ff5555 --reverse 30 | fish_color_option ffb86c 31 | fish_color_history_current --bold 32 | fish_color_status ff5555 33 | fish_color_valid_path --underline 34 | 35 | # Default Prompt Colors 36 | fish_color_cwd 50fa7b 37 | fish_color_cwd_root red 38 | fish_color_host bd93f9 39 | fish_color_host_remote bd93f9 40 | fish_color_user 8be9fd 41 | 42 | # Completion Pager Colors 43 | fish_pager_color_progress 6272a4 44 | fish_pager_color_background 45 | fish_pager_color_prefix 8be9fd 46 | fish_pager_color_completion f8f8f2 47 | fish_pager_color_description 6272a4 48 | fish_pager_color_selected_background --background=44475a 49 | fish_pager_color_selected_prefix 8be9fd 50 | fish_pager_color_selected_completion f8f8f2 51 | fish_pager_color_selected_description 6272a4 52 | fish_pager_color_secondary_background 53 | fish_pager_color_secondary_prefix 8be9fd 54 | fish_pager_color_secondary_completion f8f8f2 55 | fish_pager_color_secondary_description 6272a4 56 | -------------------------------------------------------------------------------- /.config/i3/config: -------------------------------------------------------------------------------- 1 | # This file is a modified version based on default i3-config-wizard config 2 | # source is available here: 3 | # https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/master/.config/i3/config 4 | # Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] 5 | # https://endeavouros.com 6 | # 7 | # iconic font icon search: https://fontawesome.com/v4.7/cheatsheet/ 8 | # 9 | # --> to update this run the following command (will backup existing setup file) 10 | # wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/config -P ~/.config/i3/ 11 | # 12 | # Endeavouros-i3 config file 13 | # Source for complete framework of our i3 config and theming here: https://github.com/endeavouros-team/endeavouros-i3wm-setup 14 | # EndeavourOS wiki holds some Information also: https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ 15 | # Please see http://i3wm.org/docs/userguide.html for the official i3 reference! 16 | 17 | ####################### 18 | # config starts here: # 19 | ####################### 20 | 21 | # Font for window titles. Will also be used by the bar unless a different font 22 | # is used in the bar {} block below. 23 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 24 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 25 | font pango: Noto Sans Regular 10 26 | 27 | # set the mod key to the winkey: 28 | set $mod Mod4 29 | 30 | ##################### 31 | # workspace layout: # 32 | ##################### 33 | 34 | # default i3 tiling mode: 35 | workspace_layout default 36 | 37 | # i3 stacking layout: 38 | # Each window will be fullscreen and tabbed top to bottom. 39 | #workspace_layout stacking 40 | 41 | # i3 tabbed layout: 42 | # Each new window will open fullscreen as a tab (left to right) 43 | #workspace_layout tabbed 44 | 45 | ############################## 46 | # extra options for windows: # 47 | ############################## 48 | 49 | #border indicator on windows: 50 | new_window pixel 1 51 | 52 | # thin borders 53 | # hide_edge_borders both 54 | 55 | # Set inner/outer gaps 56 | gaps inner 8 57 | gaps outer 4 58 | 59 | # show window title bars (not officially supported with i3gaps) 60 | #default_border normal 61 | 62 | # window title alignment 63 | #title_align center 64 | 65 | # Use Mouse+$mod to drag floating windows to their wanted position 66 | floating_modifier $mod 67 | 68 | # switch/iterate between workspaces 69 | bindsym $mod+Tab workspace next 70 | bindsym $mod+Shift+Tab workspace prev 71 | 72 | # switch to workspace 73 | bindsym $mod+1 workspace $ws1 74 | bindsym $mod+2 workspace $ws2 75 | bindsym $mod+3 workspace $ws3 76 | bindsym $mod+4 workspace $ws4 77 | bindsym $mod+5 workspace $ws5 78 | bindsym $mod+6 workspace $ws6 79 | bindsym $mod+7 workspace $ws7 80 | bindsym $mod+8 workspace $ws8 81 | bindsym $mod+9 workspace $ws9 82 | bindsym $mod+0 workspace $ws10 83 | 84 | # switch to workspace with numpad keys 85 | bindcode $mod+87 workspace 1 86 | bindcode $mod+88 workspace 2 87 | bindcode $mod+89 workspace 3 88 | bindcode $mod+83 workspace 4 89 | bindcode $mod+84 workspace 5 90 | bindcode $mod+85 workspace 6 91 | bindcode $mod+79 workspace 7 92 | bindcode $mod+80 workspace 8 93 | bindcode $mod+81 workspace 9 94 | bindcode $mod+90 workspace 10 95 | 96 | # switch to workspace with numlock numpad keys 97 | bindcode $mod+Mod2+87 workspace $ws1 98 | bindcode $mod+Mod2+88 workspace $ws2 99 | bindcode $mod+Mod2+89 workspace $ws3 100 | bindcode $mod+Mod2+83 workspace $ws4 101 | bindcode $mod+Mod2+84 workspace $ws5 102 | bindcode $mod+Mod2+85 workspace $ws6 103 | bindcode $mod+Mod2+79 workspace $ws7 104 | bindcode $mod+Mod2+80 workspace $ws8 105 | bindcode $mod+Mod2+81 workspace $ws9 106 | bindcode $mod+Mod2+90 workspace $ws10 107 | 108 | # move focused container to workspace 109 | bindsym $mod+Shift+1 move container to workspace $ws1 110 | bindsym $mod+Shift+2 move container to workspace $ws2 111 | bindsym $mod+Shift+3 move container to workspace $ws3 112 | bindsym $mod+Shift+4 move container to workspace $ws4 113 | bindsym $mod+Shift+5 move container to workspace $ws5 114 | bindsym $mod+Shift+6 move container to workspace $ws6 115 | bindsym $mod+Shift+7 move container to workspace $ws7 116 | bindsym $mod+Shift+8 move container to workspace $ws8 117 | bindsym $mod+Shift+9 move container to workspace $ws9 118 | bindsym $mod+Shift+0 move container to workspace $ws10 119 | 120 | # move focused container to workspace with numpad keys 121 | bindcode $mod+Shift+Mod2+87 move container to workspace $ws1 122 | bindcode $mod+Shift+Mod2+88 move container to workspace $ws2 123 | bindcode $mod+Shift+Mod2+89 move container to workspace $ws3 124 | bindcode $mod+Shift+Mod2+83 move container to workspace $ws4 125 | bindcode $mod+Shift+Mod2+84 move container to workspace $ws5 126 | bindcode $mod+Shift+Mod2+85 move container to workspace $ws6 127 | bindcode $mod+Shift+Mod2+79 move container to workspace $ws7 128 | bindcode $mod+Shift+Mod2+80 move container to workspace $ws8 129 | bindcode $mod+Shift+Mod2+81 move container to workspace $ws9 130 | bindcode $mod+Shift+Mod2+90 move container to workspace $ws10 131 | 132 | # move focused container to workspace with numpad keys 133 | bindcode $mod+Shift+87 move container to workspace $ws1 134 | bindcode $mod+Shift+88 move container to workspace $ws2 135 | bindcode $mod+Shift+89 move container to workspace $ws3 136 | bindcode $mod+Shift+83 move container to workspace $ws4 137 | bindcode $mod+Shift+84 move container to workspace $ws5 138 | bindcode $mod+Shift+85 move container to workspace $ws6 139 | bindcode $mod+Shift+79 move container to workspace $ws7 140 | bindcode $mod+Shift+80 move container to workspace $ws8 141 | bindcode $mod+Shift+81 move container to workspace $ws9 142 | bindcode $mod+Shift+90 move container to workspace $ws10 143 | 144 | # resize window (you can also use the mouse for that): 145 | #mode "resize" { 146 | # These bindings trigger as soon as you enter the resize mode 147 | # Pressing left will shrink the window's width. 148 | # Pressing right will grow the window's width. 149 | # Pressing up will shrink the window's height. 150 | # Pressing down will grow the window's height. 151 | # bindsym j resize shrink width 10 px or 10 ppt 152 | # bindsym k resize grow height 10 px or 10 ppt 153 | # bindsym l resize shrink height 10 px or 10 ppt 154 | # bindsym ntilde resize grow width 10 px or 10 ppt 155 | 156 | # same bindings, but for the arrow keys 157 | # bindsym Left resirze shrink width 10 px or 10 ppt 158 | # bindsym Down resize grow height 10 px or 10 ppt 159 | # bindsym Up resize shrink height 10 px or 10 ppt 160 | # bindsym Right resize grow width 10 px or 10 ppt 161 | 162 | # back to normal: Enter or Escape 163 | # bindsym Return mode "default" 164 | # bindsym Escape mode "default" 165 | #} 166 | 167 | #bindsym $mod+r mode "resize" 168 | 169 | ###################################### 170 | # keybindings for different actions: # 171 | ###################################### 172 | 173 | # start a terminal 174 | bindsym $mod+Return exec wezterm 175 | 176 | # kill focused window 177 | bindsym $mod+q kill 178 | 179 | # exit-menu 180 | #bindsym $mod+Shift+e exec ~/.config/i3/scripts/powermenu 181 | bindsym $mod+Shift+e exec ~/.config/rofi/powermenu/type-1/powermenu.sh 182 | 183 | # Lock the system 184 | # lock with a picture: 185 | #bindsym $mod+l exec i3lock -i ~/.config/i3/i3-lock-screen.png -p default|win -t 186 | # lock by blurring the screen: 187 | #bindsym $mod+l exec ~/.config/i3/scripts/blur-lock 188 | bindsym $mod+Ctrl+Shift+l exec betterlockscreen -l 189 | 190 | # reload the configuration file 191 | bindsym $mod+Shift+c reload 192 | 193 | # restart i3 inplace (preserves your layout/session, can be used to update i3) 194 | bindsym $mod+Shift+r restart 195 | 196 | # keybinding in fancy rofi (automated): 197 | bindsym F1 exec ~/.config/i3/scripts/keyhint-2 198 | # alternative 199 | # keybinding list in editor: 200 | # bindsym $mod+F1 exec xed ~/.config/i3/keybindings 201 | 202 | # Backlight control 203 | #bindsym XF86MonBrightnessUp exec xbacklight +10 && notify-send "Brightness - $(xbacklight -get | cut -d '.' -f 1)%" 204 | #bindsym XF86MonBrightnessDown exec xbacklight -10 && notify-send "Brightness - $(xbacklight -get | cut -d '.' -f 1)%" 205 | # Backlight setting using dunst osc 206 | bindsym XF86MonBrightnessUp exec --no-startup-id ~/.config/i3/scripts/volume_brightness.sh brightness_up 207 | bindsym XF86MonBrightnessDown exec --no-startup-id ~/.config/i3/scripts/volume_brightness.sh brightness_down 208 | 209 | # change focus 210 | bindsym $mod+j focus left 211 | bindsym $mod+k focus down 212 | bindsym $mod+b focus up 213 | bindsym $mod+o focus right 214 | 215 | # alternatively, you can use the cursor keys: 216 | bindsym $mod+Left focus left 217 | bindsym $mod+Down focus down 218 | bindsym $mod+Up focus up 219 | bindsym $mod+Right focus right 220 | 221 | # move focused window 222 | bindsym $mod+Shift+j move left 223 | bindsym $mod+Shift+k move down 224 | bindsym $mod+Shift+b move up 225 | bindsym $mod+Shift+o move right 226 | 227 | # alternatively, you can use the cursor keys: 228 | bindsym $mod+Shift+Left move left 229 | bindsym $mod+Shift+Down move down 230 | bindsym $mod+Shift+Up move up 231 | bindsym $mod+Shift+Right move right 232 | 233 | # split in horizontal orientation 234 | bindsym $mod+h split h 235 | 236 | # split in vertical orientation 237 | bindsym $mod+v split v 238 | 239 | # enter fullscreen mode for the focused container 240 | bindsym $mod+f fullscreen toggle 241 | 242 | # change container layout (stacked, tabbed, toggle split) 243 | bindsym $mod+s layout stacking 244 | bindsym $mod+g layout tabbed 245 | bindsym $mod+e layout toggle split 246 | 247 | # toggle tiling / floating 248 | bindsym $mod+Shift+space floating toggle 249 | 250 | # change focus between tiling / floating windows 251 | bindsym $mod+space focus mode_toggle 252 | 253 | # focus the parent container 254 | bindsym $mod+a focus parent 255 | 256 | # open new empty workspace 257 | bindsym $mod+Shift+n exec ~/.config/i3/scripts/empty_workspace 258 | 259 | # Multimedia Keys 260 | 261 | # volume 262 | # use meta keys without showing osc 263 | #bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks 264 | #bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks 265 | # use meta keys showing osc using dunst 266 | bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.config/i3/scripts/volume_brightness.sh volume_up 267 | bindsym XF86AudioLowerVolume exec --no-startup-id ~/.config/i3/scripts/volume_brightness.sh volume_down 268 | 269 | # gradular volume control 270 | bindsym $mod+XF86AudioRaiseVolume exec amixer -D pulse sset Master 1%+ && pkill -RTMIN+1 i3blocks 271 | bindsym $mod+XF86AudioLowerVolume exec amixer -D pulse sset Master 1%- && pkill -RTMIN+1 i3blocks 272 | 273 | # mute 274 | #bindsym XF86AudioMute exec amixer sset Master toggle && killall -USR1 i3blocks 275 | # use meta keys showing osc using dunst 276 | bindsym XF86AudioMute exec --no-startup-id ~/.config/i3/scripts/volume_brightness.sh volume_mute 277 | 278 | # mic mute toggle 279 | bindsym XF86AudioMicMute exec amixer sset Capture toggle 280 | 281 | # audio control 282 | bindsym XF86AudioPlay exec playerctl play 283 | bindsym XF86AudioPause exec playerctl pause 284 | bindsym XF86AudioNext exec playerctl next 285 | bindsym XF86AudioPrev exec playerctl previous 286 | 287 | # Redirect sound to headphones 288 | bindsym $mod+p exec /usr/local/bin/switch-audio-port 289 | 290 | ## App shortcuts 291 | bindsym $mod+w exec /usr/bin/firefox-developer-edition 292 | bindsym $mod+n exec /usr/bin/thunar 293 | #bindsym Print exec scrot ~/%Y-%m-%d-%T-screenshot.png && notify-send "Screenshot saved to ~/$(date +"%Y-%m-%d-%T")-screenshot.png" 294 | 295 | # Print Screen 296 | bindsym $mod+Shift+s exec --no-startup-id flameshot gui 297 | 298 | # Power Profiles menu switcher (rofi) 299 | bindsym $mod+Shift+p exec ~/.config/i3/scripts/power-profiles 300 | 301 | ########################################## 302 | # configuration for workspace behaviour: # 303 | ########################################## 304 | 305 | # Define names for default workspaces for which we configure key bindings later on. 306 | # We use variables to avoid repeating the names in multiple places. 307 | set $ws1 "1" 308 | set $ws2 "2" 309 | set $ws3 "3" 310 | set $ws4 "4" 311 | set $ws5 "5" 312 | set $ws6 "6" 313 | set $ws7 "7" 314 | set $ws8 "8" 315 | set $ws9 "9" 316 | set $ws10 "10" 317 | 318 | # use workspaces on different displays: 319 | # where you have to replace VGA-0/HDMI-0 with the names for your displays 320 | # you can get from xrandr command 321 | #workspace $ws1 output VGA-0 322 | #workspace $ws2 output VGA-0 323 | #workspace $ws3 output HDMI-0 324 | #workspace $ws4 output HDMI-0 325 | #workspace $ws5 output HDMI-0 326 | 327 | # bind program to workspace and focus to them on startup: 328 | assign [class="wezterm"] $ws1 329 | assign [class="(?i)firefox-developer-edition"] $ws2 330 | assign [class="Thunar"] $ws3 331 | assign [class="thunderbird"] $ws4 332 | assign [class="TelegramDesktop"] $ws5 333 | 334 | # automatic set focus new window if it opens on another workspace than the current: 335 | for_window [class=wezterm] focus 336 | for_window [class=(?i)firefox-developer-edition] focus 337 | for_window [class=Thunar] focus 338 | for_window [class=Thunderbird] focus 339 | for_window [class=TelegramDesktop] focus 340 | 341 | ############## 342 | # compositor # 343 | ############## 344 | 345 | # transparency 346 | # uncomment one of them to be used 347 | # options could need changes, related to used GPU and drivers. 348 | # to find the right setting consult the archwiki or ask at the forum. 349 | # 350 | # xcompmgr: https://wiki.archlinux.org/title/Xcompmgr 351 | # manpage: https://man.archlinux.org/man/xcompmgr.1.en 352 | # install xcompmgr package to use it (yay -S xcompmgr) 353 | #exec --no-startup-id xcompmgr -C -n & 354 | # or an more specialized config like this: 355 | #exec --no-startup-id xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 & 356 | # 357 | # or: 358 | # 359 | # picom: https://wiki.archlinux.org/title/Picom 360 | # manpage: https://man.archlinux.org/man/picom.1.en 361 | # The default configuration is available in /etc/xdg/picom.conf 362 | # For modifications, it can be copied to ~/.config/picom/picom.conf or ~/.config/picom.conf 363 | # install picom package (yay -S picom) 364 | # start using default config 365 | exec_always --no-startup-id picom -b --no-frame-pacing 366 | # 367 | # for custom config: 368 | #exec_always --no-startup-id picom --config ~/.config/picom/picom.conf 369 | 370 | ############################################# 371 | # autostart applications/services on login: # 372 | ############################################# 373 | 374 | #get auth work with polkit-gnome 375 | exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 376 | 377 | # dex execute .desktop files + apps using /etc/xdg/autostart. 378 | # when second to i3 a DE is installed or mixed usage of i3 + xfce4 or GNOME 379 | # in this cases better disable dex and use manual starting apps using xdg/autostart 380 | # if enabled you should comment welcome app. 381 | # https://github.com/jceb/dex 382 | #exec --no-startup-id dex -a -s /etc/xdg/autostart/:~/.config/autostart/ 383 | exec --no-startup-id dex --autostart --environment i3 384 | 385 | # start welcome app 386 | #exec --no-startup-id sh /usr/share/endeavouros/scripts/welcome --startdelay=3 387 | 388 | # startup app 389 | exec --no-startup-id /usr/bin/redshift 390 | #exec --no-startup-id "ibus-daemon -rd" 391 | exec_always --no-startup-id sleep 3 && bash ~/.config/polybar/launch.sh --forest 392 | 393 | # num lock activated 394 | #exec --no-startup-id numlockx on 395 | 396 | # configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example) 397 | #exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle' 398 | 399 | # start conky: 400 | #exec_always --no-startup-id conky 401 | 402 | # start a script to setup displays 403 | # uncomment the next line, use arandr to setup displays and save the file as monitor: 404 | #exec --no-startup-id ~/.screenlayout/default-layout.sh 405 | 406 | # set wallpaper 407 | exec --no-startup-id sleep 2 && nitrogen --restore 408 | #exec --no-startup-id sleep 1 && feh --bg-fill /home/ngockhoi96/Pictures/wallpaper/webarebear-01.jpg 409 | #exec --no-startup-id sleep 1 && dwall -s forest 410 | 411 | # set powersavings for display: 412 | exec --no-startup-id xset s 480 dpms 600 600 600 413 | 414 | # disable power saving (for example if using xscreensaver) 415 | #exec --no-startup-id xset -dpms 416 | 417 | # use xautolock to use autosuspend rules for mobile devices 418 | # https://wiki.archlinux.org/title/Session_lock#xautolock 419 | #exec --no-startup-id xautolock -time 60 -locker "systemctl suspend" 420 | 421 | 422 | # xscreensaver 423 | # https://www.jwz.org/xscreensaver 424 | #exec --no-startup-id xscreensaver --no-splash 425 | 426 | # Desktop notifications 427 | # dunst config used ~/.config/dunst/dunstrc 428 | # set alternative config if needed: 429 | #exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc 430 | # may yneed to run dbus-launch explicitly: 431 | #exec --no-startup-id dbus-launch /usr/bin/dunst 432 | exec --no-startup-id /usr/bin/dunst 433 | # alternative if you installed aside with XFCE4: 434 | # exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd & 435 | 436 | # autotiling script 437 | # https://github.com/nwg-piotr/autotiling 438 | # `yay -S autotiling ;) (it is in AUR) 439 | #exec_always --no-startup-id autotiling 440 | 441 | # Autostart apps as you like 442 | #exec --no-startup-id sleep 2 && wezterm 443 | #exec --no-startup-id sleep 7 && firefox-developer-edition https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md 444 | #exec --no-startup-id sleep 3 && thunar 445 | 446 | ############### 447 | # system tray # 448 | ############### 449 | # if you do not use dex: exec --no-startup-id dex --autostart --environment i3 450 | # you need to have tray apps started manually one by one: 451 | 452 | # start blueberry app for managing bluetooth devices from tray: 453 | #exec --no-startup-id blueberry-tray 454 | 455 | # networkmanager-applet 456 | #exec --no-startup-id nm-applet 457 | 458 | # clipman-applet 459 | #exec --no-startup-id xfce4-clipman 460 | 461 | ################## 462 | # floating rules # 463 | ################## 464 | 465 | # set floating (nontiling) for apps needing it 466 | for_window [class="Yad" instance="yad"] floating enable 467 | for_window [class="Galculator" instance="galculator"] floating enable 468 | for_window [class="Blueberry.py" instance="blueberry.py"] floating enable 469 | 470 | # set floating (nontiling) for special apps 471 | for_window [class="Xsane" instance="xsane"] floating enable 472 | for_window [class="Pavucontrol" instance="pavucontrol"] floating enable 473 | for_window [class="qt5ct" instance="qt5ct"] floating enable 474 | for_window [class="Blueberry.py" instance="blueberry.py"] floating enable 475 | for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable 476 | for_window [class="Pamac-manager"] floating enable 477 | for_window [window_role="About"] floating enable 478 | 479 | # set border of floating window 480 | for_window [class="urxvt"] border pixel 1 481 | 482 | # set size of floating window 483 | #for_window [window_role="(?i)GtkFileChooserDialog"] resize set 640 480 #to set size of file choose dialog 484 | #for_window [class=".*"] resize set 640 480 #to change size of all floating windows 485 | 486 | # set position of floating window 487 | #for_window [class=".*"] move position center 488 | 489 | ###################################### 490 | # color settings for bar and windows # 491 | ###################################### 492 | 493 | # Define colors variables: 494 | set $darkbluetrans #08052be6 495 | set $darkblue #08052b 496 | set $lightblue #5294e2 497 | set $urgentred #e53935 498 | set $white #ffffff 499 | set $black #000000 500 | set $purple #e345ff 501 | set $darkgrey #383c4a 502 | set $grey #b0b5bd 503 | set $mediumgrey #8b8b8b 504 | set $yellowbrown #e1b700 505 | 506 | # define colors for windows: 507 | #class border bground text indicator child_border 508 | client.focused $lightblue $darkblue $white $mediumgrey $mediumgrey 509 | client.unfocused $darkblue $darkblue $grey $darkgrey $darkgrey 510 | client.focused_inactive $darkblue $darkblue $grey $black $black 511 | client.urgent $urgentred $urgentred $white $yellowbrown $yellowbrown 512 | 513 | ############################################ 514 | # bar settings (input comes from i3blocks) # 515 | ############################################ 516 | 517 | # Start i3bar to display a workspace bar 518 | # (plus the system information i3status finds out, if available) 519 | #bar { 520 | # font pango: Noto Sans Regular 10 521 | # status_command i3blocks -c ~/.config/i3/i3blocks.conf 522 | # position bottom 523 | # i3bar_command i3bar --transparency 524 | # it could be that you have no primary display set: set one (xrandr --output --primary) 525 | # reference: https://i3wm.org/docs/userguide.html#_tray_output 526 | # #tray_output primary 527 | # tray_padding 0 528 | 529 | # When strip_workspace_numbers is set to yes, 530 | # any workspace that has a name of the form 531 | # “[n][:][NAME]” will display only the name. 532 | #strip_workspace_numbers yes 533 | ##strip_workspace_name no 534 | 535 | # colors { 536 | # separator $purple 537 | # background $darkgrey 538 | # statusline $white 539 | # border bg txt indicator 540 | # focused_workspace $mediumgrey $grey $darkgrey $purple 541 | # active_workspace $lightblue $mediumgrey $darkgrey $purple 542 | # inactive_workspace $darkgrey $darkgrey $grey $purple 543 | # urgent_workspace $urgentred $urgentred $white $purple 544 | # } 545 | #} 546 | 547 | # you can add different bars for multidisplay setups on each display: 548 | # set output HDMI-0 to the display you want the bar, --transparency can be set. 549 | # Transparency needs rgba color codes to be used where the last two letters are the transparency factor see here: 550 | # https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 551 | # #08052be6 --> e6=90% 552 | 553 | # bar { 554 | # font pango: Noto Sans Regular 10 555 | # status_command i3blocks -c ~/.config/i3/i3blocks-2.conf 556 | # i3bar_command i3bar --transparency 557 | # output HDMI-0 558 | # position bottom 559 | # 560 | # When strip_workspace_numbers is set to yes, 561 | # any workspace that has a name of the form 562 | # “[n][:][NAME]” will display only the name. 563 | #strip_workspace_numbers yes 564 | ##strip_workspace_name no 565 | # 566 | # colors { 567 | # separator $purple 568 | # background $darkbluetrans 569 | # statusline $white 570 | # border bg txt indicator 571 | # focused_workspace $lighterblue $lighterblue $darkblue $purple 572 | # active_workspace $lightdblue $lightdblue $darkblue $purple 573 | # inactive_workspace $darkblue $darkblue $lightdblue $purple 574 | # urgent_workspace $urgentred $urgentred $white $purple 575 | # } 576 | #} 577 | 578 | ##################################### 579 | # Application menu handled by rofi: # 580 | ##################################### 581 | 582 | ## rofi bindings fancy application menu ($mod+d /F9 optional disabled) 583 | 584 | #bindsym $mod+d exec rofi -modi drun -show drun \ 585 | # -config ~/.config/rofi/rofidmenu.rasi 586 | bindsym $mod+d exec ~/.config/rofi/launchers/type-2/launcher.sh 587 | 588 | #bindsym F9 exec rofi -modi drun -show drun \ 589 | # -config ~/.config/rofi/rofidmenu.rasi 590 | 591 | ## rofi bindings for window menu ($mod+t /F10 optional disabled) 592 | 593 | bindsym $mod+t exec rofi -show window \ 594 | -config ~/.config/rofi/rofidmenu.rasi 595 | 596 | #bindsym F10 exec rofi -show window \ 597 | # -config ~/.config/rofi/rofidmenu.rasi 598 | 599 | ## rofi bindings to manage clipboard (install rofi-greenclip from the AUR) 600 | 601 | #exec --no-startup-id greenclip daemon>/dev/null 602 | #bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \ 603 | # -config ~/.config/rofi/rofidmenu.rasi 604 | 605 | ## check bluetooth 606 | bindsym $mod+Ctrl+Shift+b exec --no-startup-id rofi-bluetooth -------------------------------------------------------------------------------- /.config/i3/i3blocks.conf: -------------------------------------------------------------------------------- 1 | # i3blocks config file changed for EndeavourOS-i3 setup 2 | 3 | # source is available here: 4 | # https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf 5 | # Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] 6 | # Former Visual Designer: Florent Valetti [@FLVAL EndeavourOS] 7 | # created for i3wm setup on EndeavourOS 8 | # https://endeavouros.com 9 | 10 | # cheatsheet for icon fonts used on the block-bar: 11 | # https://fontawesome.com/v4.7/cheatsheet/ 12 | 13 | # --> to update this run the following command: 14 | # wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf -P ~/.config/i3/ 15 | 16 | # Please see man i3blocks for a complete reference! 17 | # The man page is also hosted at http://vivien.github.io/i3blocks 18 | 19 | 20 | # List of valid properties: 21 | # 22 | # align 23 | # color 24 | # command 25 | # full_text 26 | # instance 27 | # interval 28 | # label 29 | # min_width 30 | # name 31 | # separator 32 | # separator_block_width 33 | # short_text 34 | # signal 35 | # urgent 36 | 37 | # Global properties 38 | # 39 | # The top properties below are applied to every block, but can be overridden. 40 | separator=false 41 | markup=pango 42 | 43 | #[Weather] 44 | #command=~/.config/i3/scripts/openweather 45 | # or: 46 | #command=~/.config/i3/scripts/openweather-city 47 | #interval=1800 48 | #color=#7275b3 49 | 50 | [terminal] 51 | full_text=  52 | color=#807dfe 53 | command=i3-msg -q exec xfce4-terminal 54 | 55 | [browser] 56 | full_text=  57 | color=#ff7f81 58 | command=i3-msg -q exec firefox 59 | 60 | [files] 61 | full_text=  62 | color=#7f3fbf 63 | command=i3-msg -q exec thunar ~/ 64 | 65 | #[mail] 66 | #full_text=  67 | #color=#dbcb75 68 | #command=i3-msg -q exec thunderbird 69 | 70 | [simple-2] 71 | full_text=: : 72 | color=#717171 73 | 74 | # Disk usage 75 | # 76 | # The directory defaults to $HOME if the instance is not specified. 77 | # The script may be called with a optional argument to set the alert 78 | # (defaults to 10 for 10%). 79 | [disk] 80 | label= 81 | instance=/ 82 | command=~/.config/i3/scripts/disk 83 | interval=30 84 | 85 | # Memory usage 86 | # 87 | # The type defaults to "mem" if the instance is not specified. 88 | [memory] 89 | label= 90 | command=~/.config/i3/scripts/memory 91 | interval=2 92 | 93 | [cpu_usage] 94 | label= 95 | command=~/.config/i3/scripts/cpu_usage 96 | #min_width=CPU: 100.00% 97 | interval=2 98 | 99 | [CPU-temperature] 100 | label= 101 | command=~/.config/i3/scripts/temperature 102 | interval=30 103 | #T_WARN=70 104 | #T_CRIT=90 105 | #SENSOR_CHIP="" 106 | # where SENSOR_CHIP can be find with sensors output 107 | # can be used also for GPU temperature or other temperature sensors lm-sensors detects. 108 | 109 | # showing name of connected network (enable for wifi use) 110 | #[net] 111 | #label= 112 | #command=echo "$(LANG=C nmcli d | grep connected | awk '{print $4}')" 113 | #interval=30 114 | 115 | [bandwidth] 116 | command=~/.config/i3/scripts/bandwidth2 117 | interval=persist 118 | 119 | # Battery indicator 120 | [battery] 121 | command=~/.config/i3/scripts/battery2 122 | # for alternative battery script change to battery1 123 | # change this to battery-pinebook-pro if you are running on pinebook-pro 124 | label= 125 | interval=30 126 | 127 | [simple-2] 128 | full_text=: : 129 | color=#717171 130 | 131 | [pavucontrol] 132 | full_text= 133 | command=pavucontrol 134 | 135 | [volume-pulseaudio] 136 | command=~/.config/i3/scripts/volume 137 | instance=Master 138 | interval=1 139 | 140 | # display keyboard layout name 141 | # for keyboard layouts switcher 142 | # see i3 config file 143 | # this needs xkblayout-state installed from the AUR: 144 | # https://aur.archlinux.org/packages/xkblayout-state-git 145 | #[keyboard-layout] 146 | #command=~/.config/i3/scripts/keyboard-layout 147 | #interval=2 148 | 149 | [keybindings] 150 | full_text= 151 | command=~/.config/i3/scripts/keyhint 152 | 153 | # power-profiles-daemon implementation: 154 | # needs package power-profiles-daemon installed and the service running see here: 155 | # https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon 156 | 157 | #set power-profile 158 | [ppd_menu] 159 | full_text= 160 | command=~/.config/i3/scripts/power-profiles 161 | color=#407437 162 | 163 | #Show the current power-profile 164 | [ppd-status] 165 | command=~/.config/i3/scripts/ppd-status 166 | interval=5 167 | 168 | [time] 169 | #label= 170 | command=date '+%a %d %b %H:%M:%S' 171 | interval=1 172 | 173 | [shutdown_menu] 174 | full_text= 175 | command=~/.config/i3/scripts/powermenu 176 | 177 | [simple-2] 178 | full_text=: : 179 | color=#717171 180 | -------------------------------------------------------------------------------- /.config/i3/keybindings: -------------------------------------------------------------------------------- 1 | EndeavourOS i3wm Keybindings cheat sheet: 2 | 3 | --> to update this run the following command: 4 | wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/keybindings -P ~/.config/i3/ 5 | 6 | All sources and updates are available at GitHub: 7 | https://github.com/endeavouros-team/endeavouros-i3wm-setup 8 | 9 | For reference consult our WIKI: 10 | https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ 11 | 12 |  = windows key 13 | 14 | # start xfce4-terminal 15 | +Return 16 | 17 | # kill focused window 18 | +q 19 | 20 | # Application menu search by typing (fancy Rofi menu): 21 | +d 22 | 23 | # Window switcher menu (fancy Rofi menu): 24 | +t 25 | 26 | # fancy exit-menu on bottom right: 27 | +Shift+e 28 | 29 | # Lock the system 30 | # lock with a picture or blurring the screen (options in config) 31 | +l 32 | 33 | # reload the configuration file 34 | +Shift+c 35 | 36 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 37 | +Shift+r 38 | 39 | # keybinding in fancy rofi (automated) 40 | F1 41 | 42 | # full keybinding list in editor: 43 | +F1 44 | 45 | # change window focus 46 | +j focus left 47 | +k focus down 48 | +b focus up 49 | +o focus right 50 | 51 | # alternatively, you can use the cursor keys: 52 | +Left focus left 53 | +Down focus down 54 | +Up focus up 55 | +Right focus right 56 | 57 | # move a focused window 58 | +Shift+j move left 59 | +Shift+k move down 60 | +Shift+b move up 61 | +Shift+o move right 62 | 63 | # alternatively, you can use the cursor keys: 64 | +Shift+Left move left 65 | +Shift+Down move down 66 | +Shift+Up move up 67 | +Shift+Right move right 68 | 69 | # split in horizontal orientation 70 | +h split h 71 | 72 | # split in vertical orientation 73 | +v split v 74 | 75 | # enter fullscreen mode for the focused container 76 | +f fullscreen toggle 77 | 78 | # change container layout (stacked, tabbed, toggle split) 79 | +s layout stacking 80 | +g layout tabbed 81 | +e layout toggle split 82 | 83 | # toggle tiling / floating 84 | +Shift+space floating toggle 85 | 86 | # change focus between tiling / floating windows 87 | +space focus mode_toggle 88 | 89 | # focus the parent container 90 | +a focus parent 91 | 92 | # focus the child container 93 | #+d focus child 94 | 95 | # resize floating window 96 | +right mouse button 97 | 98 | ## Multimedia Keys 99 | 100 | # Redirect sound to headphones 101 | +p 102 | 103 | ## App shortcuts 104 | +w starts Firefox 105 | +n starts Thunar 106 |  Button screenshot 107 | -------------------------------------------------------------------------------- /.config/i3/scripts/bandwidth2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (C) 2015 James Murphy 4 | # Licensed under the terms of the GNU GPL v2 only. 5 | # 6 | # i3blocks blocklet script to monitor bandwidth usage 7 | 8 | iface="${BLOCK_INSTANCE}" 9 | iface="${IFACE:-$iface}" 10 | dt="${DT:-3}" 11 | unit="${UNIT:-MB}" 12 | LABEL="${LABEL:-}" # down arrow up arrow 13 | printf_command="${PRINTF_COMMAND:-"printf \"${LABEL}%1.0f/%1.0f %s/s\\n\", rx, wx, unit;"}" 14 | 15 | function default_interface { 16 | ip route | awk '/^default via/ {print $5; exit}' 17 | } 18 | 19 | function check_proc_net_dev { 20 | if [ ! -f "/proc/net/dev" ]; then 21 | echo "/proc/net/dev not found" 22 | exit 1 23 | fi 24 | } 25 | 26 | function list_interfaces { 27 | check_proc_net_dev 28 | echo "Interfaces in /proc/net/dev:" 29 | grep -o "^[^:]\\+:" /proc/net/dev | tr -d " :" 30 | } 31 | 32 | while getopts i:t:u:p:lh opt; do 33 | case "$opt" in 34 | i) iface="$OPTARG" ;; 35 | t) dt="$OPTARG" ;; 36 | u) unit="$OPTARG" ;; 37 | p) printf_command="$OPTARG" ;; 38 | l) list_interfaces && exit 0 ;; 39 | h) printf \ 40 | "Usage: bandwidth3 [-i interface] [-t time] [-u unit] [-p printf_command] [-l] [-h] 41 | Options: 42 | -i\tNetwork interface to measure. Default determined using \`ip route\`. 43 | -t\tTime interval in seconds between measurements. Default: 3 44 | -u\tUnits to measure bytes in. Default: Mb 45 | \tAllowed units: Kb, KB, Mb, MB, Gb, GB, Tb, TB 46 | \tUnits may have optional it/its/yte/ytes on the end, e.g. Mbits, KByte 47 | -p\tAwk command to be called after a measurement is made. 48 | \tDefault: printf \"%%-5.1f/%%5.1f %%s/s\\\\n\", rx, wx, unit; 49 | \tExposed variables: rx, wx, tx, unit, iface 50 | -l\tList available interfaces in /proc/net/dev 51 | -h\tShow this help text 52 | " && exit 0;; 53 | esac 54 | done 55 | 56 | check_proc_net_dev 57 | 58 | iface="${iface:-$(default_interface)}" 59 | while [ -z "$iface" ]; do 60 | echo No default interface 61 | sleep "$dt" 62 | iface=$(default_interface) 63 | done 64 | 65 | case "$unit" in 66 | Kb|Kbit|Kbits) bytes_per_unit=$((1024 / 8));; 67 | KB|KByte|KBytes) bytes_per_unit=$((1024));; 68 | Mb|Mbit|Mbits) bytes_per_unit=$((1024 * 1024 / 8));; 69 | MB|MByte|MBytes) bytes_per_unit=$((1024 * 1024));; 70 | Gb|Gbit|Gbits) bytes_per_unit=$((1024 * 1024 * 1024 / 8));; 71 | GB|GByte|GBytes) bytes_per_unit=$((1024 * 1024 * 1024));; 72 | Tb|Tbit|Tbits) bytes_per_unit=$((1024 * 1024 * 1024 * 1024 / 8));; 73 | TB|TByte|TBytes) bytes_per_unit=$((1024 * 1024 * 1024 * 1024));; 74 | *) echo Bad unit "$unit" && exit 1;; 75 | esac 76 | 77 | scalar=$((bytes_per_unit * dt)) 78 | init_line=$(cat /proc/net/dev | grep "^[ ]*$iface:") 79 | if [ -z "$init_line" ]; then 80 | echo Interface not found in /proc/net/dev: "$iface" 81 | exit 1 82 | fi 83 | 84 | init_received=$(awk '{print $2}' <<< $init_line) 85 | init_sent=$(awk '{print $10}' <<< $init_line) 86 | 87 | (while true; do cat /proc/net/dev; sleep "$dt"; done) |\ 88 | stdbuf -oL grep "^[ ]*$iface:" |\ 89 | awk -v scalar="$scalar" -v unit="$unit" -v iface="$iface" ' 90 | BEGIN{old_received='"$init_received"';old_sent='"$init_sent"'} 91 | { 92 | received=$2 93 | sent=$10 94 | rx=(received-old_received)/scalar; 95 | wx=(sent-old_sent)/scalar; 96 | tx=rx+wr; 97 | old_received=received; 98 | old_sent=sent; 99 | if(rx >= 0 && wx >= 0){ 100 | '"$printf_command"'; 101 | fflush(stdout); 102 | } 103 | } 104 | ' 105 | -------------------------------------------------------------------------------- /.config/i3/scripts/battery-pinebook-pro: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #simple Shellscript for i3blocks on Pinebook pro 3 | #05012020 geri123@gmx.net Gerhard S. 4 | #battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed! 5 | PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity) 6 | STATUS=$(cat /sys/class/power_supply/cw2015-battery/status) 7 | case $(( 8 | $PERCENT >= 0 && $PERCENT <= 20 ? 1 : 9 | $PERCENT > 20 && $PERCENT <= 40 ? 2 : 10 | $PERCENT > 40 && $PERCENT <= 60 ? 3 : 11 | $PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in 12 | # 13 | (1) echo $STATUS:"" :$PERCENT%;; 14 | (2) echo $STATUS:"" :$PERCENT%;; 15 | (3) echo $STATUS:"" :$PERCENT%;; 16 | (4) echo $STATUS:"" :$PERCENT%;; 17 | (5) echo $STATUS:"" :$PERCENT%;; 18 | esac 19 | -------------------------------------------------------------------------------- /.config/i3/scripts/battery1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright 2014 Pierre Mavro 4 | # Copyright 2014 Vivien Didelot 5 | # 6 | # Licensed under the terms of the GNU GPL v3, or any later version. 7 | # 8 | # This script is meant to use with i3blocks. It parses the output of the "acpi" 9 | # command (often provided by a package of the same name) to read the status of 10 | # the battery, and eventually its remaining time (to full charge or discharge). 11 | # 12 | # The color will gradually change for a percentage below 85%, and the urgency 13 | # (exit code 33) is set if there is less that 5% remaining. 14 | 15 | # Edited by Andreas Lindlbauer 16 | 17 | use strict; 18 | use warnings; 19 | use utf8; 20 | 21 | # otherwise we get in console "Wide character in print at" 22 | binmode(STDOUT, ':utf8'); 23 | 24 | # my $acpi; 25 | my $upower; 26 | my $percent; 27 | my $bat_state; 28 | my $status; 29 | my $ac_adapt; 30 | my $full_text; 31 | my $short_text; 32 | my $label = '😅'; 33 | my $bat_number = $ENV{BLOCK_INSTANCE} || 0; 34 | 35 | open (UPOWER, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'percentage' |") or die; 36 | $upower = ; 37 | close(UPOWER); 38 | 39 | # fail on unexpected output 40 | if ($upower !~ /: (\d+)%/) { 41 | die "$upower\n"; 42 | } 43 | 44 | $percent = $1; 45 | $full_text = "$percent%"; 46 | 47 | open (BAT_STATE, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'state' |") or die; 48 | $bat_state = ; 49 | close(BAT_STATE); 50 | 51 | if ($bat_state !~ /: (\w+)/) { 52 | die "$bat_state\n"; 53 | } 54 | $status = $1; 55 | 56 | if ($status eq 'discharging') { 57 | $full_text .= ' '; 58 | } elsif ($status eq 'charging') { 59 | $full_text .= ' '; 60 | } elsif ($status eq 'Unknown') { 61 | open (AC_ADAPTER, "acpi -a |") or die; 62 | $ac_adapt = ; 63 | close(AC_ADAPTER); 64 | 65 | if ($ac_adapt =~ /: ([\w-]+)/) { 66 | $ac_adapt = $1; 67 | 68 | if ($ac_adapt eq 'on-line') { 69 | $full_text .= ' CHR'; 70 | } elsif ($ac_adapt eq 'off-line') { 71 | $full_text .= ' DIS'; 72 | } 73 | } 74 | } 75 | 76 | $short_text = $full_text; 77 | 78 | if ($percent < 20) { 79 | $label = ''; 80 | } elsif ($percent < 45) { 81 | $label = ''; 82 | } elsif ($percent < 70) { 83 | $label = ''; 84 | } elsif ($percent < 95) { 85 | $label = ''; 86 | } else { 87 | $label = ''; 88 | } 89 | 90 | # print text 91 | print " ${label}"; 92 | print " $full_text\n"; 93 | print " ${label}"; 94 | print " $short_text\n"; 95 | 96 | # consider color and urgent flag only on discharge 97 | if ($status eq 'discharging') { 98 | 99 | if ($percent < 20) { 100 | print "#FF0000\n"; 101 | } elsif ($percent < 40) { 102 | print "#FFAE00\n"; 103 | } elsif ($percent < 60) { 104 | print "#FFF600\n"; 105 | } elsif ($percent < 85) { 106 | print "#A8FF00\n"; 107 | } 108 | 109 | if ($percent < 5) { 110 | exit(33); 111 | } 112 | } 113 | 114 | exit(0); 115 | -------------------------------------------------------------------------------- /.config/i3/scripts/battery2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (C) 2016 James Murphy 4 | # Licensed under the GPL version 2 only 5 | # 6 | # A battery indicator blocklet script for i3blocks 7 | 8 | from subprocess import check_output 9 | import os 10 | import re 11 | 12 | config = dict(os.environ) 13 | status = check_output(['acpi'], universal_newlines=True) 14 | 15 | if not status: 16 | # stands for no battery found 17 | color = config.get("color_10", "red") 18 | fulltext = "\uf00d \uf240".format(color) 19 | percentleft = 100 20 | else: 21 | # if there is more than one battery in one laptop, the percentage left is 22 | # available for each battery separately, although state and remaining 23 | # time for overall block is shown in the status of the first battery 24 | batteries = status.split("\n") 25 | state_batteries=[] 26 | commasplitstatus_batteries=[] 27 | percentleft_batteries=[] 28 | time = "" 29 | for battery in batteries: 30 | if battery!='': 31 | state_batteries.append(battery.split(": ")[1].split(", ")[0]) 32 | commasplitstatus = battery.split(", ") 33 | if not time: 34 | time = commasplitstatus[-1].strip() 35 | # check if it matches a time 36 | time = re.match(r"(\d+):(\d+)", time) 37 | if time: 38 | time = ":".join(time.groups()) 39 | timeleft = " ({})".format(time) 40 | else: 41 | timeleft = "" 42 | 43 | p = int(commasplitstatus[1].rstrip("%\n")) 44 | if p>0: 45 | percentleft_batteries.append(p) 46 | commasplitstatus_batteries.append(commasplitstatus) 47 | state = state_batteries[0] 48 | commasplitstatus = commasplitstatus_batteries[0] 49 | if percentleft_batteries: 50 | percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries)) 51 | else: 52 | percentleft = 0 53 | 54 | # stands for charging 55 | color = config.get("color_charging", "yellow") 56 | FA_LIGHTNING = "\uf0e7".format(color) 57 | 58 | # stands for plugged in 59 | FA_PLUG = "\uf1e6" 60 | 61 | # stands for using battery 62 | FA_BATTERY = "\uf240" 63 | 64 | # stands for unknown status of battery 65 | FA_QUESTION = "\uf128" 66 | 67 | 68 | if state == "Discharging": 69 | fulltext = FA_BATTERY + " " 70 | elif state == "Full": 71 | fulltext = FA_PLUG + " " 72 | timeleft = "" 73 | elif state == "Unknown": 74 | fulltext = FA_QUESTION + " " + FA_BATTERY + " " 75 | timeleft = "" 76 | else: 77 | fulltext = FA_LIGHTNING + " " + FA_PLUG + " " 78 | 79 | def color(percent): 80 | if percent < 10: 81 | # exit code 33 will turn background red 82 | return config.get("color_10", "#FFFFFF") 83 | if percent < 20: 84 | return config.get("color_20", "#FF3300") 85 | if percent < 30: 86 | return config.get("color_30", "#FF6600") 87 | if percent < 40: 88 | return config.get("color_40", "#FF9900") 89 | if percent < 50: 90 | return config.get("color_50", "#FFCC00") 91 | if percent < 60: 92 | return config.get("color_60", "#FFFF00") 93 | if percent < 70: 94 | return config.get("color_70", "#FFFF33") 95 | if percent < 80: 96 | return config.get("color_80", "#FFFF66") 97 | return config.get("color_full", "#FFFFFF") 98 | 99 | form = '{}%' 100 | fulltext += form.format(color(percentleft), percentleft) 101 | #fulltext += timeleft 102 | 103 | print(fulltext) 104 | print(fulltext) 105 | if percentleft < 10: 106 | exit(33) 107 | -------------------------------------------------------------------------------- /.config/i3/scripts/blur-lock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PICTURE=/tmp/i3lock.png 4 | SCREENSHOT="scrot -z $PICTURE" 5 | 6 | BLUR="5x4" 7 | 8 | $SCREENSHOT 9 | convert $PICTURE -blur $BLUR $PICTURE 10 | i3lock -i $PICTURE 11 | rm $PICTURE 12 | -------------------------------------------------------------------------------- /.config/i3/scripts/cpu_usage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright 2014 Pierre Mavro 4 | # Copyright 2014 Vivien Didelot 5 | # Copyright 2014 Andreas Guldstrand 6 | # 7 | # Licensed under the terms of the GNU GPL v3, or any later version. 8 | 9 | use strict; 10 | use warnings; 11 | use utf8; 12 | use Getopt::Long; 13 | 14 | # default values 15 | my $t_warn = $ENV{T_WARN} // 50; 16 | my $t_crit = $ENV{T_CRIT} // 80; 17 | my $cpu_usage = -1; 18 | my $decimals = $ENV{DECIMALS} // 0; 19 | my $label = $ENV{LABEL} // ""; 20 | 21 | sub help { 22 | print "Usage: cpu_usage [-w ] [-c ] [-d ]\n"; 23 | print "-w : warning threshold to become yellow\n"; 24 | print "-c : critical threshold to become red\n"; 25 | print "-d : Use decimals for percentage (default is $decimals) \n"; 26 | exit 0; 27 | } 28 | 29 | GetOptions("help|h" => \&help, 30 | "w=i" => \$t_warn, 31 | "c=i" => \$t_crit, 32 | "d=i" => \$decimals, 33 | ); 34 | 35 | # Get CPU usage 36 | $ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is 37 | open (MPSTAT, 'mpstat 1 1 |') or die; 38 | while () { 39 | if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) { 40 | $cpu_usage = 100 - $1; # 100% - %idle 41 | last; 42 | } 43 | } 44 | close(MPSTAT); 45 | 46 | $cpu_usage eq -1 and die 'Can\'t find CPU information'; 47 | 48 | # Print short_text, full_text 49 | print "${label}"; 50 | printf "%02.${decimals}f%%\n", $cpu_usage; 51 | print "${label}"; 52 | printf "%02.${decimals}f%%\n", $cpu_usage; 53 | 54 | # Print color, if needed 55 | if ($cpu_usage >= $t_crit) { 56 | print "#FF0000\n"; 57 | exit 33; 58 | } elsif ($cpu_usage >= $t_warn) { 59 | print "#FFFC00\n"; 60 | } 61 | 62 | exit 0; 63 | -------------------------------------------------------------------------------- /.config/i3/scripts/disk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (C) 2014 Julien Bonjean 3 | 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | DIR="${DIR:-$BLOCK_INSTANCE}" 18 | DIR="${DIR:-$HOME}" 19 | ALERT_LOW="${ALERT_LOW:-$1}" 20 | ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%) 21 | 22 | LOCAL_FLAG="-l" 23 | if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then 24 | LOCAL_FLAG="" 25 | fi 26 | 27 | df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW ' 28 | /\/.*/ { 29 | # full text 30 | print label $4 31 | 32 | # short text 33 | print label $4 34 | 35 | use=$5 36 | 37 | # no need to continue parsing 38 | exit 0 39 | } 40 | 41 | END { 42 | gsub(/%$/,"",use) 43 | if (100 - use < alert_low) { 44 | # color 45 | print "#FF0000" 46 | } 47 | } 48 | ' 49 | -------------------------------------------------------------------------------- /.config/i3/scripts/empty_workspace: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | MAX_DESKTOPS=20 4 | 5 | WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS}) 6 | 7 | EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \ 8 | echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1) 9 | 10 | i3-msg workspace ${EMPTY_WORKSPACE} 11 | -------------------------------------------------------------------------------- /.config/i3/scripts/keyboard-layout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | KBD=$(/usr/bin/xkblayout-state print '%s') 4 | echo $KBD 5 | 6 | -------------------------------------------------------------------------------- /.config/i3/scripts/keyhint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | Main() { 4 | source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1 5 | 6 | local command=( 7 | eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list 8 | --column=key: --column=description: --column=command: 9 | "ESC" "close this app" "" 10 | "=" "modkey" "(set mod Mod4)" 11 | "+enter" "open a terminal" "" 12 | "+Shift+n" "new empty workspace" "" 13 | "+w" "open Browser" "" 14 | "+n" "open Filebrowser" "" 15 | "+d" "app menu" "" 16 | "+q" "close focused app" "" 17 | "Print-key" "screenshot" "" 18 | "+Shift+e" "logout menu" "" 19 | "F1" "open keybinding helper" "" 20 | ) 21 | 22 | "${command[@]}" 23 | } 24 | 25 | Main "$@" 26 | -------------------------------------------------------------------------------- /.config/i3/scripts/keyhint-2: -------------------------------------------------------------------------------- 1 | I3_CONFIG=$HOME/.config/i3/config 2 | mod_key=$(sed -nre 's/^set \$mod (.*)/\1/p' ${I3_CONFIG}) 3 | grep "^bindsym" ${I3_CONFIG} \ 4 | | sed "s/-\(-\w\+\)\+//g;s/\$mod/${mod_key}/g;s/Mod1/Alt/g;s/exec //;s/bindsym //;s/^\s\+//;s/^\([^ ]\+\) \(.\+\)$/\2: \1/;s/^\s\+//" \ 5 | | tr -s ' ' \ 6 | | rofi -dmenu -theme ~/.config/rofi/rofikeyhint.rasi 7 | -------------------------------------------------------------------------------- /.config/i3/scripts/memory: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (C) 2014 Julien Bonjean 3 | 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | TYPE="${BLOCK_INSTANCE:-mem}" 18 | 19 | awk -v type=$TYPE ' 20 | /^MemTotal:/ { 21 | mem_total=$2 22 | } 23 | /^MemFree:/ { 24 | mem_free=$2 25 | } 26 | /^Buffers:/ { 27 | mem_free+=$2 28 | } 29 | /^Cached:/ { 30 | mem_free+=$2 31 | } 32 | /^SwapTotal:/ { 33 | swap_total=$2 34 | } 35 | /^SwapFree:/ { 36 | swap_free=$2 37 | } 38 | END { 39 | if (type == "swap") { 40 | free=swap_free/1024/1024 41 | used=(swap_total-swap_free)/1024/1024 42 | total=swap_total/1024/1024 43 | } else { 44 | free=mem_free/1024/1024 45 | used=(mem_total-mem_free)/1024/1024 46 | total=mem_total/1024/1024 47 | } 48 | 49 | pct=0 50 | if (total > 0) { 51 | pct=used/total*100 52 | } 53 | 54 | # full text 55 | # printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct) 56 | 57 | # short text 58 | printf("%02.f%%\n", pct) 59 | 60 | # color 61 | if (pct > 90) { 62 | print("#FF0000") 63 | } else if (pct > 80) { 64 | print("#FFAE00") 65 | } else if (pct > 70) { 66 | print("#FFF600") 67 | } 68 | } 69 | ' /proc/meminfo 70 | -------------------------------------------------------------------------------- /.config/i3/scripts/openweather: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Edited by Andreas Lindlbauer 3 | 4 | temps=("#0600FF" "#0500FF" "#0400FF" "#0300FF" "#0200FF" "#0100FF" "#0000FF" "#0002FF" "#0012FF" "#0022FF" "#0032FF" "#0044FF" "#0054FF" "#0064FF" "#0074FF" "#0084FF" "#0094FF" "#00A4FF" "#00B4FF" "#00C4FF" "#00D4FF" "#00E4FF" "#00FFF4" "#00FFD0" "#00FFA8" "#00FF83" "#00FF5C" "#00FF36" "#00FF10" "#17FF00" "#3EFF00" "#65FF00" "#B0FF00" "#FDFF00" "#FFF000" "#FFDC00" "#FFC800" "#FFB400" "#FFA000" "#FF8C00" "#FF7800" "#FF6400" "#FF5000" "#FF3C00" "#FF2800" "#FF1400" "#FF0000") 5 | 6 | command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed. 7 | Aborting."; exit 1; } 8 | command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed. 9 | Aborting."; exit 1; } 10 | 11 | # To use this script you need to create an API key here https://home.openweathermap.org 12 | # You need to put your Open Weather APIKEY here: 13 | APIKEY="keykeykey" 14 | # And get your Latitute and Longitudes to put in here: 15 | LAT="XX.XXXX" 16 | LON="XX.XXXX" 17 | URL="http://api.openweathermap.org/data/2.5/onecall?lat=${LAT}&lon=${LON}&units=metric&exclude=minutely,hourly,daily&APPID=${APIKEY}" 18 | WEATHER_RESPONSE=$(wget -qO- "${URL}") 19 | 20 | WEATHER_CONDITION=$(echo "$WEATHER_RESPONSE" | jq '.current.weather[0].main' | sed 's/"//g') 21 | WEATHER_TEMP=$(echo "$WEATHER_RESPONSE" | jq '.current.feels_like') 22 | WEATHER_INT=${WEATHER_TEMP%.*} 23 | 24 | TIME_NOW=$( echo "$WEATHER_RESPONSE" | jq '.current.dt') 25 | SUNRISE=$( echo "$WEATHER_RESPONSE" | jq '.current.sunrise') 26 | SUNSET=$( echo "$WEATHER_RESPONSE" | jq '.current.sunset') 27 | DESCRIPTION=$( echo "$WEATHER_RESPONSE" | jq '.current.weather[0].description' | sed 's/"//g') 28 | WEATHER_ALERT=$( echo "$WEATHER_RESPONSE" | jq '.alerts[0].event' | sed 's/"//g') 29 | DAYTIME="n" 30 | 31 | if [[ "$TIME_NOW" > "$SUNRISE" ]] && [[ "$TIME_NOW" < "$SUNSET" ]]; then 32 | DAYTIME="d" 33 | fi 34 | 35 | case $WEATHER_CONDITION in 36 | 'Clouds') 37 | if [ "$DAYTIME" == "d" ]; then 38 | WEATHER_ICON="" 39 | else 40 | WEATHER_ICON="" 41 | fi 42 | ;; 43 | 'Rain') 44 | WEATHER_ICON="" 45 | ;; 46 | 'Drizzle') 47 | if [ "$DAYTIME" == "d" ]; then 48 | WEATHER_ICON="" 49 | else 50 | WEATHER_ICON="" 51 | fi 52 | ;; 53 | 'Thunderstorm') 54 | WEATHER_ICON="" 55 | ;; 56 | 'Snow') 57 | WEATHER_ICON="" 58 | ;; 59 | 'Clear') 60 | if [ "$DAYTIME" == "d" ]; then 61 | WEATHER_ICON="" 62 | else 63 | WEATHER_ICON="" 64 | fi 65 | ;; 66 | *) 67 | WEATHER_ICON="🌫" 68 | ;; 69 | esac 70 | 71 | WEATHER_COLOR="#FFFFFF" 72 | if [ "$WEATHER_INT" -lt "-11" ]; then 73 | WEATHER_COLOR="#0000FF" 74 | elif [ "$WEATHER_INT" -gt 35 ]; then 75 | WEATHER_COLOR="#FF0000" 76 | else 77 | WEATHER_INT=$(( WEATHER_INT + 11 )) 78 | WEATHER_COLOR="${temps[$WEATHER_INT]}" 79 | fi 80 | 81 | full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} " 82 | if [ "$WEATHER_ALERT" != "null" ]; then 83 | WARN_START=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].start') 84 | WARN_END=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].end') 85 | WARN_START=$(date -d @"$WARN_START" +%a_%k:%M) 86 | WARN_END=$(date -d @"$WARN_END" +%a_%k:%M) 87 | full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION}  ${WEATHER_ALERT} from ${WARN_START} to ${WARN_END}  " 88 | fi 89 | 90 | 91 | echo "${full_text}" 92 | echo "${WEATHER_TEMP}°C " 93 | echo "${WEATHER_COLOR}" 94 | -------------------------------------------------------------------------------- /.config/i3/scripts/openweather-city: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed. 4 | Aborting."; exit 1; } 5 | command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed. 6 | Aborting."; exit 1; } 7 | 8 | # To use this script you need to create an API key here https://home.openweathermap.org 9 | # You need to put your Open Weather APIKEY here: 10 | APIKEY="keykey" 11 | # find your City ID here: https://openweathermap.org/ 12 | # search for your city and copy the ID from the URL inside the browser. 13 | CITY_ID="idid" 14 | URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&units=metric&APPID=${APIKEY}" 15 | 16 | WEATHER_RESPONSE=$(wget -qO- "${URL}") 17 | 18 | WEATHER_CONDITION=$(echo $WEATHER_RESPONSE | jq '.weather[0].main' | sed 's/"//g') 19 | WEATHER_TEMP=$(echo $WEATHER_RESPONSE | jq '.main.temp') 20 | WIND_DIR=$( echo "$WEATHER_RESPONSE" | jq '.wind.deg') 21 | WIND_SPEED=$( echo "$WEATHER_RESPONSE" | jq '.wind.speed') 22 | 23 | WIND_SPEED=$(awk "BEGIN {print 60*60*$WIND_SPEED/1000}") 24 | WIND_DIR=$(awk "BEGIN {print int(($WIND_DIR % 360)/22.5)}") 25 | DIR_ARRAY=( N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N ) 26 | WIND_DIR=${DIR_ARRAY[WIND_DIR]} 27 | 28 | case $WEATHER_CONDITION in 29 | 'Clouds') 30 | WEATHER_ICON="" 31 | ;; 32 | 'Rain') 33 | WEATHER_ICON="" 34 | ;; 35 | 'Snow') 36 | WEATHER_ICON="" 37 | ;; 38 | *) 39 | WEATHER_ICON="" 40 | ;; 41 | esac 42 | 43 | echo "${WEATHER_ICON} ${WEATHER_TEMP}°C: ${WIND_SPEED} km/h ${WIND_DIR}" 44 | -------------------------------------------------------------------------------- /.config/i3/scripts/openweather.conf: -------------------------------------------------------------------------------- 1 | # Weather 2 | [Weather] 3 | command=~/.config/i3/scripts/openweather 4 | interval=1800 5 | color=#7275b3 6 | -------------------------------------------------------------------------------- /.config/i3/scripts/power-profiles: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Use rofi/zenity to change system runstate thanks to systemd. 4 | # 5 | # Note: this currently relies on associative array support in the shell. 6 | # 7 | # Inspired from i3pystatus wiki: 8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu 9 | # 10 | # Copyright 2015 Benjamin Chrétien 11 | # 12 | # This program is free software: you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation, either version 3 of the License, or 15 | # (at your option) any later version. 16 | 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program. If not, see . 24 | 25 | # power-profiles-daemon implementation: 26 | # needs package power-profiles-daemon installed and the service running see here: 27 | # https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon 28 | # used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/ppd-status 29 | 30 | 31 | ####################################################################### 32 | # BEGIN CONFIG # 33 | ####################################################################### 34 | 35 | # Use a custom lock script 36 | #LOCKSCRIPT="i3lock-extra -m pixelize" 37 | 38 | # Colors: FG (foreground), BG (background), HL (highlighted) 39 | FG_COLOR="#bbbbbb" 40 | BG_COLOR="#111111" 41 | HLFG_COLOR="#111111" 42 | HLBG_COLOR="#bbbbbb" 43 | BORDER_COLOR="#222222" 44 | 45 | # Options not related to colors 46 | #ROFI_TEXT=":" 47 | #ROFI_OPTIONS=(-width -11 -location 0 -hide-scrollbar -bw 30 -color-window "#dd310027,#dd0310027,#dd310027" -padding 5) 48 | #ROFI_OPTIONS=(-width -18 -location 4 -hide-scrollbar -color-window "#cc310027,#00a0009a,#cc310027" -padding 5 -font "Sourcecode Pro Regular 10, FontAwesome 9") 49 | ROFI_OPTIONS=(-theme ~/.config/rofi/power-profiles.rasi) 50 | # Zenity options 51 | ZENITY_TITLE="Power Profiles" 52 | ZENITY_TEXT="Set Profiles:" 53 | ZENITY_OPTIONS=(--column= --hide-header) 54 | 55 | ####################################################################### 56 | # END CONFIG # 57 | ####################################################################### 58 | 59 | # Whether to ask for user's confirmation 60 | enable_confirmation=false 61 | 62 | # Preferred launcher if both are available 63 | preferred_launcher="rofi" 64 | 65 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. 66 | 67 | where: 68 | -h show this help text 69 | -c ask for user confirmation 70 | -p preferred launcher (rofi or zenity) 71 | 72 | This script depends on: 73 | - systemd, 74 | - i3, 75 | - rofi or zenity." 76 | 77 | # Check whether the user-defined launcher is valid 78 | launcher_list=(rofi zenity) 79 | function check_launcher() { 80 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then 81 | echo "Supported launchers: ${launcher_list[*]}" 82 | exit 1 83 | else 84 | # Get array with unique elements and preferred launcher first 85 | # Note: uniq expects a sorted list, so we cannot use it 86 | i=1 87 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ 88 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) 89 | fi 90 | } 91 | 92 | # Parse CLI arguments 93 | while getopts "hcp:" option; do 94 | case "${option}" in 95 | h) echo "${usage}" 96 | exit 0 97 | ;; 98 | c) enable_confirmation=true 99 | ;; 100 | p) preferred_launcher="${OPTARG}" 101 | check_launcher "${preferred_launcher}" 102 | ;; 103 | *) exit 1 104 | ;; 105 | esac 106 | done 107 | 108 | # Check whether a command exists 109 | function command_exists() { 110 | command -v "$1" &> /dev/null 2>&1 111 | } 112 | 113 | # systemctl required 114 | if ! command_exists systemctl ; then 115 | exit 1 116 | fi 117 | 118 | # default_menu_options defined as an associative array 119 | typeset -A default_menu_options 120 | 121 | # The default options with keys/commands 122 | 123 | default_menu_options=( 124 | [ Performance]="powerprofilesctl set performance" 125 | [ Balanced]="powerprofilesctl set balanced" 126 | [ Power Saver]="powerprofilesctl set power-saver" 127 | [ Cancel]="" 128 | ) 129 | 130 | # The menu that will be displayed 131 | typeset -A menu 132 | menu=() 133 | 134 | # Only add power profiles that are available to menu 135 | for key in "${!default_menu_options[@]}"; do 136 | grep_arg=${default_menu_options[${key}]##* } 137 | if powerprofilesctl list | grep -q "$grep_arg"; then 138 | menu[${key}]=${default_menu_options[${key}]} 139 | fi 140 | done 141 | unset grep_arg 142 | unset default_menu_options 143 | 144 | menu_nrows=${#menu[@]} 145 | 146 | # Menu entries that may trigger a confirmation message 147 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" 148 | 149 | launcher_exe="" 150 | launcher_options="" 151 | rofi_colors="" 152 | 153 | function prepare_launcher() { 154 | if [[ "$1" == "rofi" ]]; then 155 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ 156 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") 157 | launcher_exe="rofi" 158 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ 159 | "${rofi_colors}" "${ROFI_OPTIONS[@]}") 160 | elif [[ "$1" == "zenity" ]]; then 161 | launcher_exe="zenity" 162 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ 163 | "${ZENITY_OPTIONS[@]}") 164 | fi 165 | } 166 | 167 | for l in "${launcher_list[@]}"; do 168 | if command_exists "${l}" ; then 169 | prepare_launcher "${l}" 170 | break 171 | fi 172 | done 173 | 174 | # No launcher available 175 | if [[ -z "${launcher_exe}" ]]; then 176 | exit 1 177 | fi 178 | 179 | launcher=(${launcher_exe} "${launcher_options[@]}") 180 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")" 181 | 182 | function ask_confirmation() { 183 | if [ "${launcher_exe}" == "rofi" ]; then 184 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ 185 | "${rofi_colors}" "${ROFI_OPTIONS[@]}") 186 | [ "${confirmed}" == "Yes" ] && confirmed=0 187 | elif [ "${launcher_exe}" == "zenity" ]; then 188 | zenity --question --text "Are you sure you want to ${selection,,}?" 189 | confirmed=$? 190 | fi 191 | 192 | if [ "${confirmed}" == 0 ]; then 193 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}" 194 | fi 195 | } 196 | 197 | if [[ $? -eq 0 && ! -z ${selection} ]]; then 198 | if [[ "${enable_confirmation}" = true && \ 199 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then 200 | ask_confirmation 201 | else 202 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}" 203 | fi 204 | fi 205 | -------------------------------------------------------------------------------- /.config/i3/scripts/powermenu: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Use rofi/zenity to change system runstate thanks to systemd. 4 | # 5 | # Note: this currently relies on associative array support in the shell. 6 | # 7 | # Inspired from i3pystatus wiki: 8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu 9 | # 10 | # Copyright 2015 Benjamin Chrétien 11 | # 12 | # This program is free software: you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation, either version 3 of the License, or 15 | # (at your option) any later version. 16 | 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program. If not, see . 24 | 25 | # modified to work with latest rofi update by joekamprad 26 | 27 | ####################################################################### 28 | # BEGIN CONFIG # 29 | ####################################################################### 30 | 31 | # Use a custom lock script 32 | #LOCKSCRIPT="i3lock-extra -m pixelize" 33 | 34 | # Colors: FG (foreground), BG (background), HL (highlighted) 35 | FG_COLOR="#bbbbbb" 36 | BG_COLOR="#111111" 37 | HLFG_COLOR="#111111" 38 | HLBG_COLOR="#bbbbbb" 39 | BORDER_COLOR="#222222" 40 | 41 | # Options not related to colors (most rofi options do not work anymore) 42 | ROFI_OPTIONS=(-theme ~/.config/rofi/powermenu.rasi) 43 | # Zenity options 44 | ZENITY_TITLE="Power Menu" 45 | ZENITY_TEXT="Action:" 46 | ZENITY_OPTIONS=(--column= --hide-header) 47 | 48 | ####################################################################### 49 | # END CONFIG # 50 | ####################################################################### 51 | 52 | # Whether to ask for user's confirmation 53 | enable_confirmation=false 54 | 55 | # Preferred launcher if both are available 56 | preferred_launcher="rofi" 57 | 58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. 59 | 60 | where: 61 | -h show this help text 62 | -c ask for user confirmation 63 | -p preferred launcher (rofi or zenity) 64 | 65 | This script depends on: 66 | - systemd, 67 | - i3, 68 | - rofi or zenity." 69 | 70 | # Check whether the user-defined launcher is valid 71 | launcher_list=(rofi zenity) 72 | function check_launcher() { 73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then 74 | echo "Supported launchers: ${launcher_list[*]}" 75 | exit 1 76 | else 77 | # Get array with unique elements and preferred launcher first 78 | # Note: uniq expects a sorted list, so we cannot use it 79 | i=1 80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ 81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) 82 | fi 83 | } 84 | 85 | # Parse CLI arguments 86 | while getopts "hcp:" option; do 87 | case "${option}" in 88 | h) echo "${usage}" 89 | exit 0 90 | ;; 91 | c) enable_confirmation=true 92 | ;; 93 | p) preferred_launcher="${OPTARG}" 94 | check_launcher "${preferred_launcher}" 95 | ;; 96 | *) exit 1 97 | ;; 98 | esac 99 | done 100 | 101 | # Check whether a command exists 102 | function command_exists() { 103 | command -v "$1" &> /dev/null 2>&1 104 | } 105 | 106 | # systemctl required 107 | if ! command_exists systemctl ; then 108 | exit 1 109 | fi 110 | 111 | # menu defined as an associative array 112 | typeset -A menu 113 | 114 | # Menu with keys/commands 115 | 116 | menu=( 117 | [ Shutdown]="systemctl poweroff" 118 | [ Reboot]="systemctl reboot" 119 | [ Suspend]="systemctl suspend" 120 | [ Hibernate]="systemctl hibernate" 121 | [ Lock]="~/.config/i3/scripts/blur-lock" 122 | [ Logout]="i3-msg exit" 123 | [ Cancel]="" 124 | ) 125 | 126 | menu_nrows=${#menu[@]} 127 | 128 | # Menu entries that may trigger a confirmation message 129 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" 130 | 131 | launcher_exe="" 132 | launcher_options="" 133 | rofi_colors="" 134 | 135 | function prepare_launcher() { 136 | if [[ "$1" == "rofi" ]]; then 137 | rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ 138 | -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") 139 | launcher_exe="rofi" 140 | launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ 141 | "${rofi_colors}" "${ROFI_OPTIONS[@]}") 142 | elif [[ "$1" == "zenity" ]]; then 143 | launcher_exe="zenity" 144 | launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ 145 | "${ZENITY_OPTIONS[@]}") 146 | fi 147 | } 148 | 149 | for l in "${launcher_list[@]}"; do 150 | if command_exists "${l}" ; then 151 | prepare_launcher "${l}" 152 | break 153 | fi 154 | done 155 | 156 | # No launcher available 157 | if [[ -z "${launcher_exe}" ]]; then 158 | exit 1 159 | fi 160 | 161 | launcher=(${launcher_exe} "${launcher_options[@]}") 162 | selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")" 163 | 164 | function ask_confirmation() { 165 | if [ "${launcher_exe}" == "rofi" ]; then 166 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ 167 | "${rofi_colors}" "${ROFI_OPTIONS[@]}") 168 | [ "${confirmed}" == "Yes" ] && confirmed=0 169 | elif [ "${launcher_exe}" == "zenity" ]; then 170 | zenity --question --text "Are you sure you want to ${selection,,}?" 171 | confirmed=$? 172 | fi 173 | 174 | if [ "${confirmed}" == 0 ]; then 175 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}" 176 | fi 177 | } 178 | 179 | if [[ $? -eq 0 && ! -z ${selection} ]]; then 180 | if [[ "${enable_confirmation}" = true && \ 181 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then 182 | ask_confirmation 183 | else 184 | i3-msg -q "exec --no-startup-id ${menu[${selection}]}" 185 | fi 186 | fi 187 | -------------------------------------------------------------------------------- /.config/i3/scripts/ppd-status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # power-profiles-daemon implementation: 4 | # needs package power-profiles-daemon installed and the service running see here: 5 | # https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon 6 | # used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/power-profiles 7 | 8 | # script to show current power profile 9 | 10 | current_profile=$(/usr/bin/powerprofilesctl get) 11 | echo "$current_profile" 12 | -------------------------------------------------------------------------------- /.config/i3/scripts/temperature: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2014 Pierre Mavro 3 | # Copyright 2014 Vivien Didelot 4 | # Copyright 2014 Andreas Guldstrand 5 | # Copyright 2014 Benjamin Chretien 6 | 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | # Edited by Andreas Lindlbauer 21 | 22 | use strict; 23 | use warnings; 24 | use utf8; 25 | use Getopt::Long; 26 | 27 | binmode(STDOUT, ":utf8"); 28 | 29 | # default values 30 | my $t_warn = $ENV{T_WARN} || 70; 31 | my $t_crit = $ENV{T_CRIT} || 90; 32 | my $chip = $ENV{SENSOR_CHIP} || ""; 33 | my $temperature = -9999; 34 | my $label = "😀 "; 35 | 36 | sub help { 37 | print "Usage: temperature [-w ] [-c ] [--chip ]\n"; 38 | print "-w : warning threshold to become yellow\n"; 39 | print "-c : critical threshold to become red\n"; 40 | print "--chip : sensor chip\n"; 41 | exit 0; 42 | } 43 | 44 | GetOptions("help|h" => \&help, 45 | "w=i" => \$t_warn, 46 | "c=i" => \$t_crit, 47 | "chip=s" => \$chip); 48 | 49 | # Get chip temperature 50 | open (SENSORS, "sensors -u $chip |") or die; 51 | while () { 52 | if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { 53 | $temperature = $1; 54 | last; 55 | } 56 | } 57 | close(SENSORS); 58 | 59 | $temperature eq -9999 and die 'Cannot find temperature'; 60 | 61 | if ($temperature < 45) { 62 | $label = ''; 63 | } elsif ($temperature < 55) { 64 | $label = ''; 65 | } elsif ($temperature < 65) { 66 | $label = ''; 67 | } elsif ($temperature < 75) { 68 | $label = ''; 69 | } else { 70 | $label = ''; 71 | } 72 | # Print short_text, full_text 73 | print "${label}"; 74 | print " $temperature°C\n"; 75 | print "${label}"; 76 | print " $temperature°C\n"; 77 | 78 | # Print color, if needed 79 | if ($temperature >= $t_crit) { 80 | print "#FF0000\n"; 81 | exit 33; 82 | } elsif ($temperature >= $t_warn) { 83 | print "#FFFC00\n"; 84 | } 85 | 86 | exit 0; 87 | -------------------------------------------------------------------------------- /.config/i3/scripts/volume: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (C) 2014 Julien Bonjean 3 | # Copyright (C) 2014 Alexander Keller 4 | 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | # original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume 19 | # check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md 20 | #------------------------------------------------------------------------ 21 | 22 | # The second parameter overrides the mixer selection 23 | # For PulseAudio users, eventually use "pulse" 24 | # For Jack/Jack2 users, use "jackplug" 25 | # For ALSA users, you may use "default" for your primary card 26 | # or you may use hw:# where # is the number of the card desired 27 | if [[ -z "$MIXER" ]] ; then 28 | MIXER="default" 29 | if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then 30 | # pulseaudio is running, but not all installations use "pulse" 31 | if amixer -D pulse info >/dev/null 2>&1 ; then 32 | MIXER="pulse" 33 | fi 34 | fi 35 | [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" 36 | MIXER="${2:-$MIXER}" 37 | fi 38 | 39 | # The instance option sets the control to report and configure 40 | # This defaults to the first control of your selected mixer 41 | # For a list of the available, use `amixer -D $Your_Mixer scontrols` 42 | if [[ -z "$SCONTROL" ]] ; then 43 | SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | 44 | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | 45 | head -n1 46 | )}" 47 | fi 48 | 49 | # The first parameter sets the step to change the volume by (and units to display) 50 | # This may be in in % or dB (eg. 5% or 3dB) 51 | if [[ -z "$STEP" ]] ; then 52 | STEP="${1:-5%}" 53 | fi 54 | 55 | # AMIXER(1): 56 | # "Use the mapped volume for evaluating the percentage representation like alsamixer, to be 57 | # more natural for human ear." 58 | NATURAL_MAPPING=${NATURAL_MAPPING:-0} 59 | if [[ "$NATURAL_MAPPING" != "0" ]] ; then 60 | AMIXER_PARAMS="-M" 61 | fi 62 | 63 | #------------------------------------------------------------------------ 64 | 65 | capability() { # Return "Capture" if the device is a capture device 66 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL | 67 | sed -n "s/ Capabilities:.*cvolume.*/Capture/p" 68 | } 69 | 70 | volume() { 71 | amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability) 72 | } 73 | 74 | format() { 75 | 76 | perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' 77 | perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' 78 | # If dB was selected, print that instead 79 | perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') 80 | perl_filter+='"; exit}' 81 | output=$(perl -ne "$perl_filter") 82 | echo "$LABEL$output" 83 | } 84 | 85 | #------------------------------------------------------------------------ 86 | 87 | case $BLOCK_BUTTON in 88 | 3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute 89 | 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase 90 | 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease 91 | esac 92 | 93 | volume | format 94 | -------------------------------------------------------------------------------- /.config/i3/scripts/volume_brightness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator 3 | 4 | # taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator 5 | 6 | # See README.md for usage instructions 7 | bar_color="#7f7fff" 8 | volume_step=1 9 | brightness_step=2.5 10 | max_volume=100 11 | 12 | # Uses regex to get volume from pactl 13 | function get_volume { 14 | pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1 15 | } 16 | 17 | # Uses regex to get mute status from pactl 18 | function get_mute { 19 | pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)' 20 | } 21 | 22 | # Uses regex to get brightness from xbacklight 23 | function get_brightness { 24 | xbacklight | grep -Po '[0-9]{1,3}' | head -n 1 25 | } 26 | 27 | # Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume 28 | function get_volume_icon { 29 | volume=$(get_volume) 30 | mute=$(get_mute) 31 | if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then 32 | volume_icon="" 33 | elif [ "$volume" -lt 50 ]; then 34 | volume_icon="" 35 | else 36 | volume_icon="" 37 | fi 38 | } 39 | 40 | # Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome 41 | function get_brightness_icon { 42 | brightness_icon="" 43 | } 44 | 45 | # Displays a volume notification using dunstify 46 | function show_volume_notif { 47 | volume=$(get_mute) 48 | get_volume_icon 49 | dunstify -i audio-volume-muted-blocking -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color 50 | } 51 | 52 | # Displays a brightness notification using dunstify 53 | function show_brightness_notif { 54 | brightness=$(get_brightness) 55 | get_brightness_icon 56 | dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness%" -h int:value:$brightness -h string:hlcolor:$bar_color 57 | } 58 | 59 | # Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down" 60 | case $1 in 61 | volume_up) 62 | # Unmutes and increases volume, then displays the notification 63 | pactl set-sink-mute @DEFAULT_SINK@ 0 64 | volume=$(get_volume) 65 | if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then 66 | pactl set-sink-volume @DEFAULT_SINK@ $max_volume% 67 | else 68 | pactl set-sink-volume @DEFAULT_SINK@ +$volume_step% 69 | fi 70 | show_volume_notif 71 | ;; 72 | 73 | volume_down) 74 | # Raises volume and displays the notification 75 | pactl set-sink-volume @DEFAULT_SINK@ -$volume_step% 76 | show_volume_notif 77 | ;; 78 | 79 | volume_mute) 80 | # Toggles mute and displays the notification 81 | pactl set-sink-mute @DEFAULT_SINK@ toggle 82 | show_volume_notif 83 | ;; 84 | 85 | brightness_up) 86 | # Increases brightness and displays the notification 87 | # xbacklight -inc $brightness_step -time 0 88 | brightnessctl s +5% 89 | show_brightness_notif 90 | ;; 91 | 92 | brightness_down) 93 | # Decreases brightness and displays the notification 94 | # xbacklight -dec $brightness_step -time 0 95 | brightnessctl s 5%- 96 | show_brightness_notif 97 | ;; 98 | esac 99 | -------------------------------------------------------------------------------- /.config/i3/scripts/vpn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (C) 2021 Andreas Lindlbauer 4 | # Licensed under the terms of EUPLv1.2. 5 | # 6 | # i3blocks blocklet script to monitor the (nord)vpn connection 7 | 8 | vpnstatus="📢" 9 | nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' ) 10 | if [ "${nordvpn_output}" = "Status: Connected" ]; then 11 | vpnstatus="🥸" 12 | elif [ "${nordvpn_output}" = "A new version of NordVPN is available! Please update the application." ]; then 13 | nordvpn_output=$(nordvpn status | cat -v | head -2 | tail -1 | sed -e 's/\^M-^M ^M//g' ) 14 | if [ "${nordvpn_output}" = "Status: Connected" ]; then 15 | vpnstatus="🥴" 16 | elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then 17 | vpnstatus="📢" 18 | fi 19 | elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then 20 | vpnstatus="📢" 21 | elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then 22 | vpnstatus="Something's very wrong" 23 | fi 24 | 25 | echo "$vpnstatus" 26 | -------------------------------------------------------------------------------- /.config/redshift/hooks/brightness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Set brightness via xbrightness when redshift status changes 4 | 5 | # Set brightness values for each status. 6 | # Range from 1 to 100 is valid 7 | brightness_day=100 8 | brightness_transition=50 9 | brightness_night=12 10 | # Set fade time for changes to one minute 11 | fade_time=60000 12 | 13 | if [ "$1" = period-changed ]; then 14 | case $3 in 15 | night) 16 | xbacklight -set $brightness_night -time $fade_time 17 | ;; 18 | transition) 19 | xbacklight -set $brightness_transition -time $fade_time 20 | ;; 21 | daytime) 22 | xbacklight -set $brightness_day -time $fade_time 23 | ;; 24 | esac 25 | fi -------------------------------------------------------------------------------- /.config/redshift/redshift.conf: -------------------------------------------------------------------------------- 1 | ; Global settings for redshift 2 | [redshift] 3 | ; Set the day and night screen temperatures 4 | temp-day=7200 5 | temp-night=3600 6 | 7 | ; Disable the smooth fade between temperatures when Redshift starts and stops. 8 | ; 0 will cause an immediate change between screen temperatures. 9 | ; 1 will gradually apply the new screen temperature over a couple of seconds. 10 | fade=1 11 | 12 | ; Solar elevation thresholds. 13 | ; By default, Redshift will use the current elevation of the sun to determine 14 | ; whether it is daytime, night or in transition (dawn/dusk). When the sun is 15 | ; above the degrees specified with elevation-high it is considered daytime and 16 | ; below elevation-low it is considered night. 17 | ;elevation-high=3 18 | ;elevation-low=-6 19 | 20 | ; Custom dawn/dusk intervals. 21 | ; Instead of using the solar elevation, the time intervals of dawn and dusk 22 | ; can be specified manually. The times must be specified as HH:MM in 24-hour 23 | ; format. 24 | ;dawn-time=6:00-7:45 25 | ;dusk-time=18:35-20:15 26 | 27 | ; Set the screen brightness. Default is 1.0. 28 | ;brightness=0.9 29 | ; It is also possible to use different settings for day and night 30 | ; since version 1.8. 31 | ; brightness-day=0.8 32 | ; brightness-night=0.2 33 | ; Set the screen gamma (for all colors, or each color channel 34 | ; individually) 35 | ; gamma=0.8:0.4:0.2 36 | ;gamma=0.8:0.7:0.8 37 | ; This can also be set individually for day and night since 38 | ; version 1.10. 39 | ;gamma-day=0.8:0.7:0.8 40 | ;gamma-night=0.6 41 | 42 | ; Set the location-provider: 'geoclue2', 'manual' 43 | ; type 'redshift -l list' to see possible values. 44 | ; The location provider settings are in a different section. 45 | location-provider=manual 46 | 47 | ; Set the adjustment-method: 'randr', 'vidmode' 48 | ; type 'redshift -m list' to see all possible values. 49 | ; 'randr' is the preferred method, 'vidmode' is an older API. 50 | ; but works in some cases when 'randr' does not. 51 | ; The adjustment method settings are in a different section. 52 | adjustment-method=randr 53 | 54 | ; Configuration of the location-provider: 55 | ; type 'redshift -l PROVIDER:help' to see the settings. 56 | ; ex: 'redshift -l manual:help' 57 | ; Keep in mind that longitudes west of Greenwich (e.g. the Americas) 58 | ; are negative numbers. 59 | [manual] 60 | lat=10.823099 61 | lon=106.629662 62 | 63 | ; Configuration of the adjustment-method 64 | ; type 'redshift -m METHOD:help' to see the settings. 65 | ; ex: 'redshift -m randr:help' 66 | ; In this example, randr is configured to adjust only screen 0. 67 | ; Note that the numbering starts from 0, so this is actually the first screen. 68 | ; If this option is not specified, Redshift will try to adjust all screens. 69 | [randr] 70 | screen=0 -------------------------------------------------------------------------------- /.config/starship.toml: -------------------------------------------------------------------------------- 1 | [aws] 2 | symbol = " " 3 | format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]' 4 | 5 | [battery] 6 | full_symbol = '🔋 ' 7 | charging_symbol = '⚡️ ' 8 | discharging_symbol = '💀 ' 9 | 10 | [[battery.display]] # 'bold red' style and discharging_symbol when capacity is between 0% and 10% 11 | threshold = 10 12 | style = 'bold red' 13 | 14 | [[battery.display]] # 'bold yellow' style and 💦 symbol when capacity is between 10% and 30% 15 | threshold = 30 16 | style = 'bold yellow' 17 | discharging_symbol = '💦' 18 | 19 | # when capacity is over 30%, the battery indicator will not be displayed 20 | 21 | [buf] 22 | symbol = " " 23 | 24 | [c] 25 | symbol = " " 26 | 27 | [character] 28 | success_symbol = '[➜](bold green)' 29 | error_symbol = '[✗](bold red)' 30 | vimcmd_symbol = "[<](bold green)" 31 | 32 | [cmd_duration] 33 | format = '\[[⏱ $duration]($style)\]' 34 | 35 | [conda] 36 | symbol = " " 37 | 38 | [dart] 39 | symbol = " " 40 | 41 | [directory] 42 | read_only = " " 43 | 44 | [docker_context] 45 | symbol = " " 46 | format = '\[[$symbol$context]($style)\]' 47 | 48 | [elixir] 49 | symbol = " " 50 | 51 | [elm] 52 | symbol = " " 53 | 54 | format = 'AA $fill BB $fill CC' 55 | [fill] 56 | symbol = '-' 57 | style = 'bold green' 58 | 59 | [fossil_branch] 60 | symbol = " " 61 | 62 | [git_branch] 63 | symbol = " " 64 | # truncation_length = 4 65 | truncation_symbol = '' 66 | # format = '\[[$symbol$branch]($style)\]' 67 | 68 | [git_state] 69 | format = '[\($state( $progress_current of $progress_total)\)]($style) ' 70 | cherry_pick = '[🍒 PICKING](bold red)' 71 | 72 | [git_status] 73 | format = '([\[$all_status$ahead_behind\]]($style))' 74 | # ahead = ">" 75 | # behind = "<" 76 | # diverged = "<>" 77 | # renamed = "r" 78 | # deleted = "x" 79 | 80 | conflicted = '🏳' 81 | # ahead = '🏎💨' 82 | # behind = '😰' 83 | # diverged = '😵' 84 | up_to_date = '✓' 85 | untracked = '🤷' 86 | stashed = '📦 contained ${count}' 87 | modified = '📝' 88 | staged = '[++\($count\)](green)' 89 | renamed = '👅' 90 | deleted = '🗑' 91 | ahead = '⇡${count}' 92 | diverged = '⇕⇡${ahead_count}⇣${behind_count}' 93 | behind = '⇣${count}' 94 | 95 | [golang] 96 | symbol = " " 97 | # format = 'via [🏎💨 $version](bold cyan) ' 98 | format = '\[[$symbol($version)]($style)\]' 99 | 100 | [guix_shell] 101 | symbol = " " 102 | 103 | [haskell] 104 | symbol = " " 105 | 106 | [haxe] 107 | symbol = "⌘ " 108 | 109 | [hg_branch] 110 | symbol = " " 111 | 112 | [hostname] 113 | ssh_symbol = " " 114 | ssh_only = false 115 | format = 'at [home](bold green) ' 116 | trim_at = "." 117 | disabled = false 118 | 119 | [java] 120 | symbol = " " 121 | format = '\[[$symbol($version)]($style)\]' 122 | 123 | [julia] 124 | symbol = " " 125 | 126 | [kubernetes] 127 | format = '\[[$symbol$context( \($namespace\))]($style)\]' 128 | 129 | [lua] 130 | symbol = " " 131 | format = '\[[$symbol($version)]($style)\]' 132 | 133 | [memory_usage] 134 | symbol = " " 135 | format = '\[$symbol[$ram( | $swap)]($style)\]' 136 | 137 | [meson] 138 | symbol = "喝 " 139 | 140 | [nim] 141 | symbol = " " 142 | 143 | [nix_shell] 144 | symbol = " " 145 | 146 | [nodejs] 147 | symbol = " " 148 | format = '\[[$symbol($version)]($style)\]' 149 | 150 | [os.symbols] 151 | Alpaquita = " " 152 | Alpine = " " 153 | Amazon = " " 154 | Android = " " 155 | Arch = " " 156 | Artix = " " 157 | CentOS = " " 158 | Debian = " " 159 | DragonFly = " " 160 | Emscripten = " " 161 | EndeavourOS = " " 162 | Fedora = " " 163 | FreeBSD = " " 164 | Garuda = "﯑ " 165 | Gentoo = " " 166 | HardenedBSD = "ﲊ " 167 | Illumos = " " 168 | Linux = " " 169 | Mabox = " " 170 | Macos = " " 171 | Manjaro = " " 172 | Mariner = " " 173 | MidnightBSD = " " 174 | Mint = " " 175 | NetBSD = " " 176 | NixOS = " " 177 | OpenBSD = " " 178 | openSUSE = " " 179 | OracleLinux = " " 180 | Pop = " " 181 | Raspbian = " " 182 | Redhat = " " 183 | RedHatEnterprise = " " 184 | Redox = " " 185 | Solus = "ﴱ " 186 | SUSE = " " 187 | Ubuntu = " " 188 | Unknown = " " 189 | Windows = " " 190 | 191 | [package] 192 | symbol = " " 193 | format = '\[[$symbol$version]($style)\]' 194 | 195 | [pijul_channel] 196 | symbol = "🪺 " 197 | 198 | [python] 199 | symbol = " " 200 | format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]' 201 | 202 | [rlang] 203 | symbol = "ﳒ " 204 | 205 | [ruby] 206 | symbol = " " 207 | 208 | [rust] 209 | symbol = " " 210 | format = '\[[$symbol($version)]($style)\]' 211 | 212 | [scala] 213 | symbol = " " 214 | 215 | [spack] 216 | symbol = "🅢 " 217 | 218 | [sudo] 219 | format = '\[[as $symbol]\]' 220 | 221 | [time] 222 | disabled = false 223 | format = '🕙[\[ $time \]]($style) ' 224 | time_format = '%T' 225 | utc_time_offset = '-5' 226 | time_range = '10:00:00-14:00:00' 227 | 228 | [username] 229 | style_user = 'blue bold' 230 | style_root = 'black bold' 231 | format = '[$user]($style) ' 232 | disabled = false 233 | show_always = true 234 | 235 | [custom.stunnel] 236 | when = "ps aux | grep stunnel | grep -v grep" 237 | command = "ps -o etime= -p $(ps aux | grep stunnel | grep -v grep | awk '{print $2}')" 238 | style = "red" 239 | format = "[TUNNEL OPEN for $output]($style)" 240 | -------------------------------------------------------------------------------- /.config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | -- Pull in the wezterm API 2 | local wezterm = require 'wezterm' 3 | 4 | -- This table will hold the configuration. 5 | local config = {} 6 | 7 | -- In newer versions of wezterm, use the config_builder which will 8 | -- help provide clearer error messages 9 | if wezterm.config_builder then 10 | config = wezterm.config_builder() 11 | end 12 | 13 | config.font = wezterm.font 'JetBrains Mono' 14 | config.font_size = 14 15 | config.color_scheme = "Dracula (Official)" 16 | config.tab_bar_at_bottom = true 17 | config.use_fancy_tab_bar = false 18 | config.window_decorations = "RESIZE" 19 | 20 | config.window_background_opacity = 0.92 21 | 22 | local act = wezterm.action 23 | 24 | config.keys = { 25 | { 26 | key = 'E', 27 | mods = 'CTRL|SHIFT', 28 | action = act.PromptInputLine { 29 | description = 'Enter new name for tab', 30 | action = wezterm.action_callback(function(window, _, line) 31 | -- line will be nil if they hit escape without entering anything 32 | -- An empty string if they just hit enter 33 | -- Or the actual line of text they wrote 34 | if line then 35 | window:active_tab():set_title(line) 36 | end 37 | end), 38 | }, 39 | }, 40 | -- other keys 41 | } 42 | 43 | -- and finally, return the configuration to wezterm 44 | return config -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [core] 2 | excludesfile = ~/.gitignore 3 | editor = nano 4 | ignorecase = false 5 | 6 | [push] 7 | default = simple 8 | 9 | [color] 10 | status = auto 11 | diff = auto 12 | branch = auto 13 | interactive = auto 14 | grep = auto 15 | ui = auto 16 | 17 | [alias] 18 | g = git 19 | a = add 20 | co = checkout 21 | ci = commit 22 | ca = commit -a 23 | pr = pull --rebase 24 | st = status 25 | br = branch 26 | ba = branch -a 27 | bm = branch --merged 28 | bn = branch --no-merged 29 | 30 | [ghq] 31 | root = ~/workspace 32 | 33 | [user] 34 | email = anicedfaant@gmail.com 35 | name = ngockhoi96 -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Example markdownlint configuration with all properties set to their default value 2 | 3 | # Default state for all rules 4 | default: true 5 | 6 | # Path to configuration file to extend 7 | extends: null 8 | 9 | # MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md001.md 10 | MD001: true 11 | 12 | # MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md003.md 13 | MD003: 14 | # Heading style 15 | style: "consistent" 16 | 17 | # MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md004.md 18 | MD004: 19 | # List style 20 | style: "consistent" 21 | 22 | # MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md005.md 23 | MD005: true 24 | 25 | # MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md007.md 26 | MD007: 27 | # Spaces for indent 28 | indent: 2 29 | # Whether to indent the first level of the list 30 | start_indented: false 31 | # Spaces for first level indent (when start_indented is set) 32 | start_indent: 2 33 | 34 | # MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md009.md 35 | MD009: 36 | # Spaces for line break 37 | br_spaces: 2 38 | # Allow spaces for empty lines in list items 39 | list_item_empty_lines: false 40 | # Include unnecessary breaks 41 | strict: false 42 | 43 | # MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md010.md 44 | MD010: 45 | # Include code blocks 46 | code_blocks: true 47 | # Fenced code languages to ignore 48 | ignore_code_languages: [] 49 | # Number of spaces for each hard tab 50 | spaces_per_tab: 1 51 | 52 | # MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md011.md 53 | MD011: true 54 | 55 | # MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md012.md 56 | MD012: 57 | # Consecutive blank lines 58 | maximum: 1 59 | 60 | # MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md013.md 61 | MD013: 62 | # Number of characters 63 | line_length: 800 64 | # Number of characters for headings 65 | heading_line_length: 80 66 | # Number of characters for code blocks 67 | code_block_line_length: 80 68 | # Include code blocks 69 | code_blocks: true 70 | # Include tables 71 | tables: true 72 | # Include headings 73 | headings: true 74 | # Strict length checking 75 | strict: false 76 | # Stern length checking 77 | stern: false 78 | 79 | # MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md014.md 80 | MD014: true 81 | 82 | # MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md018.md 83 | MD018: true 84 | 85 | # MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md019.md 86 | MD019: true 87 | 88 | # MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md020.md 89 | MD020: true 90 | 91 | # MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md021.md 92 | MD021: true 93 | 94 | # MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md022.md 95 | MD022: 96 | # Blank lines above heading 97 | lines_above: 1 98 | # Blank lines below heading 99 | lines_below: 1 100 | 101 | # MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md023.md 102 | MD023: true 103 | 104 | # MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md024.md 105 | MD024: 106 | # Only check sibling headings 107 | siblings_only: false 108 | 109 | # MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md025.md 110 | MD025: 111 | # Heading level 112 | level: 1 113 | # RegExp for matching title in front matter 114 | front_matter_title: "^\\s*title\\s*[:=]" 115 | 116 | # MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md026.md 117 | MD026: 118 | # Punctuation characters 119 | punctuation: ".,;:!。,;:!" 120 | 121 | # MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md027.md 122 | MD027: true 123 | 124 | # MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md028.md 125 | MD028: true 126 | 127 | # MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md029.md 128 | MD029: 129 | # List style 130 | style: "one_or_ordered" 131 | 132 | # MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md030.md 133 | MD030: 134 | # Spaces for single-line unordered list items 135 | ul_single: 1 136 | # Spaces for single-line ordered list items 137 | ol_single: 1 138 | # Spaces for multi-line unordered list items 139 | ul_multi: 1 140 | # Spaces for multi-line ordered list items 141 | ol_multi: 1 142 | 143 | # MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md031.md 144 | MD031: 145 | # Include list items 146 | list_items: true 147 | 148 | # MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md032.md 149 | MD032: true 150 | 151 | # MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md033.md 152 | MD033: 153 | # Allowed elements 154 | allowed_elements: ["details", "summary", "ul", "li", "a", "em", "br"] 155 | 156 | # MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md034.md 157 | MD034: true 158 | 159 | # MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md035.md 160 | MD035: 161 | # Horizontal rule style 162 | style: "consistent" 163 | 164 | # MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md036.md 165 | MD036: 166 | # Punctuation characters 167 | punctuation: ".,;:!?。,;:!?" 168 | 169 | # MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md037.md 170 | MD037: true 171 | 172 | # MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md038.md 173 | MD038: true 174 | 175 | # MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md039.md 176 | MD039: true 177 | 178 | # MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md040.md 179 | MD040: 180 | # List of languages 181 | allowed_languages: [] 182 | # Require language only 183 | language_only: false 184 | 185 | # MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md041.md 186 | MD041: 187 | # Heading level 188 | level: 1 189 | # RegExp for matching title in front matter 190 | front_matter_title: "^\\s*title\\s*[:=]" 191 | 192 | # MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md042.md 193 | MD042: true 194 | 195 | # MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md043.md 196 | MD043: 197 | # List of headings 198 | headings: [ 199 | "# Linux Setup", 200 | "## Table of Contents", 201 | "## Introduction", 202 | "## Contents", 203 | "### Dependencies", 204 | "### i3 configs", 205 | "### Shell configs", 206 | "## Credits" 207 | ] 208 | # Match case of headings 209 | match_case: false 210 | 211 | # MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md044.md 212 | MD044: 213 | # List of proper names 214 | names: [] 215 | # Include code blocks 216 | code_blocks: true 217 | # Include HTML elements 218 | html_elements: true 219 | 220 | # MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md045.md 221 | MD045: true 222 | 223 | # MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md046.md 224 | MD046: 225 | # Block style 226 | style: "consistent" 227 | 228 | # MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md047.md 229 | MD047: true 230 | 231 | # MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md048.md 232 | MD048: 233 | # Code fence style 234 | style: "consistent" 235 | 236 | # MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md049.md 237 | MD049: 238 | # Emphasis style 239 | style: "consistent" 240 | 241 | # MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md050.md 242 | MD050: 243 | # Strong style 244 | style: "consistent" 245 | 246 | # MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md051.md 247 | MD051: true 248 | 249 | # MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md052.md 250 | MD052: 251 | # Include shortcut syntax 252 | shortcut_syntax: false 253 | 254 | # MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md053.md 255 | MD053: 256 | # Ignored definitions 257 | ignored_definitions: 258 | - "//" 259 | 260 | # MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md054.md 261 | MD054: 262 | # Allow autolinks 263 | autolink: true 264 | # Allow inline links and images 265 | inline: true 266 | # Allow full reference links and images 267 | full: true 268 | # Allow collapsed reference links and images 269 | collapsed: true 270 | # Allow shortcut reference links and images 271 | shortcut: true 272 | # Allow URLs as inline links 273 | url_inline: true 274 | 275 | # MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md055.md 276 | MD055: 277 | # Table pipe style 278 | style: "consistent" 279 | 280 | # MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md056.md 281 | MD056: true -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux Setup 2 | 3 | ![desktop screenshot](./images/desktop-screenshot-01.png) 4 | 5 | ![desktop screenshot](./images/desktop-screenshot-02.png) 6 | 7 | ![desktop screenshot](./images/desktop-screenshot-03.png) 8 | 9 | ## Table of Contents 10 | 11 | - [Linux Setup](#linux-setup) 12 | - [Table of Contents](#table-of-contents) 13 | - [Introduction](#introduction) 14 | - [Contents](#contents) 15 | - [Dependencies](#dependencies) 16 | - [i3 configs](#i3-configs) 17 | - [Shell configs](#shell-configs) 18 | - [Credits](#credits) 19 | 20 | ## Introduction 21 | 22 | ✨ This is my Linux setup and _dotfiles_. **Feel free** to use it 🚀🚀🚀. 23 | 24 |
25 | 26 | > [!WARNING] 27 | > 28 | > - This is the setting for my personal _laptop_. It may be different if used for a _PC_ or other devices. 29 | > - **Be careful** when copy all settings unless you know what that entails, just read information **in detail** for each repository. 30 | 31 |
32 | 33 | 📝 Basically, I use: 34 | 35 |
36 | 🪐 Fedora 37 | 38 | - Download ISO file on [link](https://fedoraproject.org/spins/cosmic/download) based on area. 39 | - Dual boots with [Ventoy](https://github.com/ventoy/Ventoy). 40 | ![Desktop screenshot](./images/ventoy-disk-screenshot.png) 41 | 42 |
43 | 44 |
45 | 46 | 🤯 Cosmic - Desktop Environment. 47 | 48 |
49 | 50 |
51 | 52 | 🛠️ dnf - RPM package management system. 53 | 54 | 55 | - _DNF5_ is a command-line package manager that automates the process of installing, upgrading, configuring, and removing computer programs in a consistent manner. It supports RPM packages, modulemd modules, and comps groups and environments. 56 | - Here is an example when using `dnf` to install Firefox Developer Edition. 57 | ![Desktop screenshot](./images/yay-install-screenshot.png) 58 | 59 |
60 | 61 |
62 | 63 | 🥳 Many thanks to my colleagues at **NDVN** for inspiring me and guiding me towards _Linux_. You guys are amazing and kind. 64 | 65 | [`⬆ BACK TO TOP ⬆`](#table-of-contents) 66 | 67 | ## Contents 68 | 69 | ### Dependencies 70 | 71 | ```bash 72 | yay -S [package-name] 73 | ``` 74 | 75 | Here is a list of packages: 76 | 77 | `extra/wezterm` `tmux` `extra/neofetch` `extra/brightnessctl` `picom-git` `polybar` `fish` `extra/fisher` `git` `peco` `neovim` `eza` `starship` `htop` `redshift` `ttf-jetbrains-mono-nerd` `extra/noto-fonts-emoji` `nitrogen` `betterlockscreen` `flameshot` `visual-studio-code-bin` `jetbrains-toolbox` `docker` `docker-compose` `go` `i3lock-color` `arttime-git` `rofi-bluetooth-git` `extra/blueman` `network-dmenu-git` `appimagelauncher` `postman-bin` `firefox-developer-edition` `google-chrome` `microsoft-edge-dev-bin` `teams` `slack-desktop` `aur/prospect-mail` `extra/discord` `extra/telegram-desktop` `obsidian` `extra/calc` `aur/networkmanager-dmenu-git` 78 | 79 | [`⬆ BACK TO TOP ⬆`](#table-of-contents) 80 | 81 | ### i3 configs 82 | 83 | - [weztem](https://wezfurlong.org/wezterm/index.html) - A cross-platform terminal emulator and multiplexer. 84 | - [picom-git](https://wiki.archlinux.org/title/Picom) - A compositor for _Xorg_. 85 | - [polybar](https://github.com/polybar/polybar) - build beautiful and highly customizable status bars for their desktop environment. 86 | - [polybar-themes](https://github.com/adi1090x/polybar-themes) - A huge collection of polybar themes with different styles, colors and variants. 87 | - [rofi](https://github.com/adi1090x/rofi) - A huge collection of Rofi based custom Applets, Launchers & Powermenus. 88 | - [ibus-bamboo](https://github.com/BambooEngine/ibus-bamboo) - Bộ gõ Tiếng Việt 89 | - [flameshot](https://flameshot.org/) - A cross-platform tool to take screenshots. 90 | - [nitrogen](https://github.com/l3ib/nitrogen/) - Background browser and setter for X windows. 91 | - [betterlockscreen](https://github.com/betterlockscreen/betterlockscreen) - 🍀 sweet looking lockscreen for linux system 92 | - [redshift](https://github.com/jonls/redshift) - Adjusts the color temperature of your screen according to your surroundings. 93 | 94 | [`⬆ BACK TO TOP ⬆`](#table-of-contents) 95 | 96 | ### Shell configs 97 | 98 | - [fish](https://github.com/fish-shell/fish-shell) - The user-friendly command line shell. 99 | - [fisher](https://github.com/jorgebucaran/fisher) - A plugin manager for Fish. 100 | - [dracula-fish](https://github.com/dracula/fish) - Dark theme for fish. 101 | - [z for fish](https://github.com/jethrokuan/z) - Pure-fish z directory jumping. 102 | - [ghq](https://github.com/x-motemen/ghq) - Remote repository management made easy. 103 | - [peco](https://github.com/peco/peco) - Simplistic interactive filtering tool. 104 | - [volta](https://volta.sh/) - The Hassle-Free JavaScript Tool Manager. 105 | - [eza](https://github.com/eza-community/eza) - A modern, maintained replacement for ls. 106 | - [starship](https://starship.rs/) - The minimal, blazing-fast, and infinitely customizable prompt for any shell! 107 | - [go](https://go.dev/) 108 | - [rust](https://www.rust-lang.org/) 109 | 110 | [`⬆ BACK TO TOP ⬆`](#table-of-contents) 111 | 112 | ## Credits 113 | 114 | This config has heavy inspiration from: 115 | 116 | - [devaslife](https://github.com/craftzdog/dotfiles-public) - Takuya Matsuyama 117 | - [mantran1611](https://github.com/manhtran1611/dotfiles) - Manh Tran 118 | 119 | [`⬆ BACK TO TOP ⬆`](#table-of-contents) 120 | -------------------------------------------------------------------------------- /images/desktop-screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/desktop-screenshot-01.png -------------------------------------------------------------------------------- /images/desktop-screenshot-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/desktop-screenshot-02.png -------------------------------------------------------------------------------- /images/desktop-screenshot-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/desktop-screenshot-03.png -------------------------------------------------------------------------------- /images/i3wm-intro-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/i3wm-intro-screenshot.png -------------------------------------------------------------------------------- /images/ventoy-disk-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/ventoy-disk-screenshot.png -------------------------------------------------------------------------------- /images/webarebear-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/webarebear-01.jpg -------------------------------------------------------------------------------- /images/webarebear-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/webarebear-02.jpg -------------------------------------------------------------------------------- /images/yay-install-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anIcedAntFA/linux-setup/43c4fe26c35c2f015d7b5d5abbbf2e8426099515/images/yay-install-screenshot.png --------------------------------------------------------------------------------