diff --git a/aliases/key_aliases.tmpl b/aliases/key_aliases.tmpl index 6327170..bb09863 100644 --- a/aliases/key_aliases.tmpl +++ b/aliases/key_aliases.tmpl @@ -57,8 +57,9 @@ b "bat" # ba "bat *" awkp "awk -F',' '{print \$0}'" cpr "cp -r" -fdc "fd -i" -fde "fd -e" +fd "fdfind" +fdc "fdfind -i" +fde "fdfind -e" grep "grep --color=auto -n" grpr "grep -r" rgc "rg -i" @@ -290,6 +291,12 @@ apr "apt remove" apu "apt upgrade" {{ end }} +{{ if eq .linux_os "ubuntu" }} +ai "sudo apt install" +ar "sudo apt remove" +au "sudo apt upgrade" +{{ end }} + # ]]] apt # # ]]] pkg management # diff --git a/aliases/key_dirs.tmpl b/aliases/key_dirs.tmpl index bbbde72..cdf1522 100644 --- a/aliases/key_dirs.tmpl +++ b/aliases/key_dirs.tmpl @@ -72,7 +72,6 @@ ttdr ~/.timetrace/records tx ~/linux-config/txt wd ~/.config/watson -{{ if eq .chezmoi.hostname "nzxt" }} b1 ~/coding/mf-site/themes/base16 2d ~/coding/godot-demos/2d-plat ada ~/coding/ada-mario @@ -115,8 +114,6 @@ te ~/Pictures/twitch-emotes # ]]] gaming # -{{ end }} - {{ if eq .chezmoi.hostname "x1-carbon" }} adb ~/coding/ada-mario/build adm ~/coding/ada-mario/media diff --git a/dot_Xmodmap-ubuntu b/dot_Xmodmap-ubuntu new file mode 100644 index 0000000..a6fe30a --- /dev/null +++ b/dot_Xmodmap-ubuntu @@ -0,0 +1,8 @@ +clear Lock + +keycode 66 = Caps_Lock +keycode 9 = Escape + +pointer = 1 2 3 6 7 4 5 10 11 12 8 9 +! side thumb button as middle click +! pointer = 1 10 3 6 7 4 5 2 11 12 8 9 diff --git a/dot_config/fish/completions/pass.fish b/dot_config/fish/completions/pass.fish new file mode 100644 index 0000000..0f57dd2 --- /dev/null +++ b/dot_config/fish/completions/pass.fish @@ -0,0 +1,115 @@ +# Copyright (C) 2012-2014 Dmitry Medvinsky . All Rights Reserved. +# This file is licensed under the GPLv2+. Please see COPYING for more information. + +set -l PROG 'pass' + +function __fish_pass_get_prefix + if set -q PASSWORD_STORE_DIR + realpath -- "$PASSWORD_STORE_DIR" + else + echo "$HOME/.password-store" + end +end + +function __fish_pass_needs_command + [ (count (commandline -opc)) -eq 1 ] +end + +function __fish_pass_uses_command + set -l cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +function __fish_pass_print_gpg_keys + gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/' +end + +function __fish_pass_print + set -l ext $argv[1] + set -l strip $argv[2] + set -l prefix (__fish_pass_get_prefix) + set -l matches $prefix/**$ext + printf '%s\n' $matches | sed "s#$prefix/\(.*\)$strip#\1#" +end + +function __fish_pass_print_entry_dirs + __fish_pass_print "/" +end + +function __fish_pass_print_entries + __fish_pass_print ".gpg" ".gpg" +end + +function __fish_pass_print_entries_and_dirs + __fish_pass_print_entry_dirs + __fish_pass_print_entries +end + +function __fish_pass_git_complete + set -l prefix (__fish_pass_get_prefix) + set -l git_cmd (commandline -opc) (commandline -ct) + set -e git_cmd[1 2] # Drop "pass git". + complete -C"git -C $prefix $git_cmd" +end + +complete -c $PROG -f -n '__fish_pass_needs_command' -a help -d 'Command: show usage help' +complete -c $PROG -f -n '__fish_pass_needs_command' -a version -d 'Command: show program version' + +complete -c $PROG -f -n '__fish_pass_needs_command' -a init -d 'Command: initialize new password storage' +complete -c $PROG -f -n '__fish_pass_uses_command init' -s p -l path -d 'Assign gpg-id for specified sub folder of password store' + +complete -c $PROG -f -n '__fish_pass_needs_command' -a ls -d 'Command: list passwords' +complete -c $PROG -f -n '__fish_pass_uses_command ls' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a insert -d 'Command: insert new password' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s e -l echo -d 'Echo the password on console' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s m -l multiline -d 'Provide multiline password entry' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -s f -l force -d 'Do not prompt before overwritting' +complete -c $PROG -f -n '__fish_pass_uses_command insert' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password' +complete -c $PROG -f -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a mv -d 'Command: rename existing password' +complete -c $PROG -f -n '__fish_pass_uses_command mv' -s f -l force -d 'Force rename' +complete -c $PROG -f -n '__fish_pass_uses_command mv' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a cp -d 'Command: copy existing password' +complete -c $PROG -f -n '__fish_pass_uses_command cp' -s f -l force -d 'Force copy' +complete -c $PROG -f -n '__fish_pass_uses_command cp' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a rm -d 'Command: remove existing password' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -s r -l recursive -d 'Remove password groups recursively' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -s f -l force -d 'Force removal' +complete -c $PROG -f -n '__fish_pass_uses_command rm' -a "(__fish_pass_print_entries_and_dirs)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a edit -d 'Command: edit password using text editor' +complete -c $PROG -f -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' +complete -c $PROG -f -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' +complete -c $PROG -f -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" +# When no command is given, `show` is defaulted. +complete -c $PROG -f -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' +complete -c $PROG -f -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" +complete -c $PROG -f -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" +complete -c $PROG -f -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" + +complete -c $PROG -f -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' +complete -c $PROG -f -n '__fish_pass_uses_command git' -a '(__fish_pass_git_complete)' +complete -c $PROG -f -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern' +complete -c $PROG -f -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern' +complete -c $PROG -f -n '__fish_pass_uses_command grep' -a '(begin + set -l cmd (commandline -opc) (commandline -ct) + set -e cmd[1 2] # Drop "pass grep". + complete -C"grep $cmd" +end)' diff --git a/dot_config/fish/config.fish.tmpl b/dot_config/fish/config.fish.tmpl index e72ec1f..de0190a 100755 --- a/dot_config/fish/config.fish.tmpl +++ b/dot_config/fish/config.fish.tmpl @@ -71,7 +71,7 @@ set -x HASTE_SERVER https://pste.gq set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64 set -x GOPATH ~/go # set -x PATH $GRAALVM_BIN $PATH ~/.local/bin ~/scripts ~/scripts/colors ~/go/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin -set -x PATH $PATH ~/.local/bin ~/scripts ~/scripts/colors $GOPATH/bin ~/.minetest/minetest/bin ~/.gem/ruby/*/bin ~/.yarn/bin +set -x PATH $PATH ~/.local/bin ~/scripts ~/scripts/colors $GOPATH/bin ~/.minetest/minetest/bin ~/.gem/ruby/*/bin ~/.yarn/bin /home/kevin/.linuxbrew/bin ~/.fnm/current/bin set -x PKG_CONFIG_PATH $PKG_CONFIG_PATH /usr/lib/pkgconfig # Java [[[ # @@ -87,6 +87,13 @@ set -x PATH $JAVA_HOME/bin $PATH # ]]] Java # +# pnpm +set -gx PNPM_HOME "/home/kevin/.local/share/pnpm" +if not string match -q -- $PNPM_HOME $PATH + set -gx PATH "$PNPM_HOME" $PATH +end +# pnpm end + # system ]]] # space prompt[[[ @@ -117,7 +124,7 @@ set -xU BROWSER "firefox" set -xU FZF_DEFAULT_COMMAND "find ." set -x LAPTOP_IP "192.168.0.19" -set -x PHONE_IP "192.168.0.101" +set -x PHONE_IP "192.168.0.104" set -x PIXEL_IP "192.168.0.18" set -x WORK_LAPTOP_IP "kmok@192.168.0.11" @@ -138,7 +145,7 @@ set -x FULLNODE_API_INFO wss://api.chain.love set -x IPAD_IMG 18 -source /home/kevin/coding/aws.fish +#source /home/kevin/coding/aws.fish set -x LIBVIRT_DEFAULT_URI qemu:///system diff --git a/dot_config/i3/config.tmpl b/dot_config/i3/config.tmpl index 2f5d870..c10f77e 100755 --- a/dot_config/i3/config.tmpl +++ b/dot_config/i3/config.tmpl @@ -83,7 +83,8 @@ bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail && bindsym $mod+Mod4+o workspace $ws11; exec obs # bindsym Mod4+p workspace $ws4; exec pgadmin3 # bindsym Mod4+p exec pycharm -bindsym Mod4+p exec passmenu +#bindsym Mod4+p exec passmenu +bindsym Mod4+p exec /home/kevin/scripts/passmenu # # bindsym Mod4+p exec sleep .2 && xdotool type '.catch ' # bindsym Mod4+$mod+p exec notify-send "ping" "$(ping -c 3 -W 1 8.8.8.8)" # bindsym Mod4+q exec qdirstat @@ -325,7 +326,7 @@ bindsym Control+$mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Back # ws names [[[ # -set $ws1 "1 " +set $ws1 "1  " {{ if eq .chezmoi.hostname "x1-carbon" }} set $secondary "HDMI2" set $main "eDP1" @@ -334,6 +335,9 @@ set $secondary "DVI-I-1" set $main "HDMI-0" {{ end }} +set $secondary "DVI-I-1" +set $main "HDMI-1" + # workspace $ws1 output $main workspace $ws1 output $secondary bindsym $mod+F1 workspace $ws1; exec $term @@ -341,7 +345,7 @@ bindsym Mod4+$mod+F1 workspace $ws1; exec chatterino bindsym Control+Shift+F1 workspace $ws1; exec $term -e fish -c 'tmux-attach school' # bindsym Control+Shift+F1 workspace $ws1; exec $term -e fish -c 'tmux-attach nft' -set $ws2 "2 " +set $ws2 "2  " set $work_laptop_ip "192.168.0.11" workspace $ws2 output $secondary bindsym $mod+F2 workspace $ws2; exec $term @@ -353,7 +357,7 @@ bindsym $mod+Shift+F2 workspace $ws2; exec $term -e mosh kmok@$work_laptop_ip -- # ws3 [[[ # -set $ws3 "3 " +set $ws3 "3  " # set $ws3 "3 " # workspace $ws3 output $main # bindsym $mod+F3 workspace $ws3; exec $browser @@ -373,7 +377,7 @@ bindsym Mod4+$mod+b layout tabbed; exec $term -e fish -c "buku-fzf fq" # ]]] ws3 # -set $ws4 "4 󱓧" +set $ws4 "4 󱓧 " workspace $ws4 output $secondary # bindsym $mod+F4 workspace $ws4; exec $term # bindsym Control+Shift+F4 workspace $ws4; exec $term -e fish -c 'tmux-attach misc' @@ -385,7 +389,7 @@ bindsym Mod4+g workspace $ws4; layout tabbed; exec gimp # ws5 [[[ # -set $ws5 "5 " +set $ws5 "5  " # workspace $ws5 output $secondary assign [class="Steam"] $ws5 bindsym $mod+F5 workspace $ws5; exec $browser @@ -416,7 +420,7 @@ for_window [class="ada-mario"] move absolute position 640 0 # ws6 [[[ # -set $ws6 "6 " +set $ws6 "6  " workspace $ws6 output $secondary assign [class="Slack"] $ws6 bindsym Mod4+d workspace $ws6; exec discord @@ -430,7 +434,7 @@ bindsym Mod4+k workspace $ws6; exec slack # ]]] ws6 # -set $ws7 "7 " +set $ws7 "7  " workspace $ws7 output $secondary # bindsym $mod+F7 workspace $ws7; exec $term # bindsym $mod+F7 workspace $ws7; exec $term -e mosh kmok@$work_laptop_ip -- tmux a -t nzxt @@ -440,7 +444,7 @@ bindsym $mod+Shift+F7 workspace $ws7; exec chromium https://txstreet.com/v/eth bindsym Mod4+a workspace $ws7; exec android-file-transfer # bindsym Mod4+v workspace $ws7; exec VBoxManage startvm "369-a1" -set $ws8 "8 " +set $ws8 "8  " # assign [class="jetbrains-"] $ws8 workspace $ws8 output $secondary # bindsym $mod+F8 workspace $ws8; exec $term @@ -449,13 +453,13 @@ bindsym $mod+F8 workspace $ws8; exec $term -e fish -c 'tmux-attach journal' bindsym Mod4+$mod+F8 workspace $ws8; exec libreoffice ~/Documents/sit-stand/sit-stand.ods bindsym $mod+Shift+F8 workspace $ws8; exec libreoffice ~/Documents/red-hat/workday.ods -set $ws9 "9 " +set $ws9 "9  " workspace $ws9 output $secondary # bindsym $mod+F9 workspace $ws9; exec $term # bindsym $mod+F9 workspace $ws9; exec $term -e tmux a -t config bindsym $mod+F9 workspace $ws9; exec $term -e fish -c 'tmux-attach config' -set $ws10 "10 " +set $ws10 "10  " # set $ws10 "10 🎵" assign [class="spotify"] $ws10 workspace $ws10 output $secondary @@ -467,7 +471,7 @@ bindsym Mod4+v workspace $ws10; exec $term -e alsamixer -c 1 # bindsym Mod4+s workspace $ws10; exec ~/scripts/spotify-clean bindsym Mod4+s workspace $ws10; exec spotify -set $ws11 "11 " +set $ws11 "11  " # set $ws11 "11 📊" # assign [class="Summoners War Exporter"] $ws11 workspace $ws11 output $secondary @@ -614,8 +618,8 @@ bar { font pango:$sb_font 18 {{ else }} # font pango:$sb_font 21 - font pango:$sb_font 20 - # font pango:$sb_font 17 + #font pango:$sb_font 20 + font pango:$sb_font 18 {{ end }} # output $main i3bar_command i3bar -t diff --git a/dot_config/i3blocks/i3blocks-secondary.conf.tmpl b/dot_config/i3blocks/i3blocks-secondary.conf.tmpl index 97c90fc..c576d9f 100755 --- a/dot_config/i3blocks/i3blocks-secondary.conf.tmpl +++ b/dot_config/i3blocks/i3blocks-secondary.conf.tmpl @@ -72,11 +72,11 @@ label= # {{ else }} # DATEFMT=+%H:%M # {{ end }} -DATEFMT=+%H:%M +#DATEFMT=+%H:%M # SHORTFMT=+%H:%M:%S -SHORTFMT=+%H:%M.%a-%m-%d -HEIGHT=180 -WIDTH=220 +#SHORTFMT=+%H:%M.%a-%m-%d +#HEIGHT=180 +#WIDTH=220 # ]]] time # diff --git a/dot_config/i3blocks/i3blocks.conf.tmpl b/dot_config/i3blocks/i3blocks.conf.tmpl index 40e0c1d..78d322f 100755 --- a/dot_config/i3blocks/i3blocks.conf.tmpl +++ b/dot_config/i3blocks/i3blocks.conf.tmpl @@ -15,8 +15,6 @@ color=#cbe4ff # ticker [[[ # -{{ if eq .chezmoi.hostname "nzxt" }} - # [ticker] # label=SOL  # TICKER=SOL-USD @@ -39,7 +37,8 @@ color=#cbe4ff [kraken] label=BTC -TICKER=BTCUSDC +#TICKER=BTCUSDC +command=/home/kevin/scripts/kraken BTCUSDC interval=30 # [ticker] @@ -49,7 +48,8 @@ interval=30 [kraken] label=SOL -TICKER=SOLUSD +#TICKER=SOLUSD +command=/home/kevin/scripts/kraken SOLUSD interval=30 # [kraken] @@ -59,24 +59,27 @@ interval=30 [dexscreener] label=PIXL -CHAIN=ethereum -PAIR=0x31c0ba10e4e12be6cdceb612e5e829d977532bfc +#CHAIN=ethereum +#PAIR=0x31c0ba10e4e12be6cdceb612e5e829d977532bfc +command=/home/kevin/scripts/dexscreener ethereum 0x31c0ba10e4e12be6cdceb612e5e829d977532bfc interval=30 -[kraken] -label=ETH -TICKER=ETHUSDC -interval=30 +#[kraken] +#label=ETH +#TICKER=ETHUSDC +#interval=30 [dexscreener] label=PENGU -CHAIN=solana -PAIR=B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV +#CHAIN=solana +#PAIR=B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV +command=/home/kevin/scripts/dexscreener solana B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV interval=5 [kraken] label=AVAX -TICKER=AVAXUSD +#TICKER=AVAXUSD +command=/home/kevin/scripts/kraken AVAXUSD interval=30 #[dexscreener] @@ -95,13 +98,10 @@ interval=30 # TICKER=^IXIC # interval=30 -{{ end }} - # ]]] ticker # # volume/spotify [[[ # -{{ if eq .chezmoi.hostname "nzxt" }} [volume] interval=once signal=1 @@ -123,7 +123,6 @@ interval=60 # # aqua # # color=#2d7272 # interval=5 -{{ end }} # ]]] volume/spotify # @@ -144,12 +143,10 @@ label= interval=5 {{ end }} -# {{ if eq .chezmoi.hostname "nzxt" }} # [wifi] # label= # instance=wlp4s0 # interval=10 -# {{ end }} # ]]] laptop # @@ -157,22 +154,17 @@ interval=5 [calendar] interval=5 -label= -# {{ if eq .chezmoi.hostname "nzxt" }} +label= # DATEFMT=+%H:%M -# {{ else }} # DATEFMT=+%H:%M.%a-%m-%d -# {{ end }} -DATEFMT=+%H:%M.%a-%m-%d # SHORTFMT=+%H:%M:%S -HEIGHT=180 -WIDTH=220 +#HEIGHT=180 +#WIDTH=220 # ]]] time # # sys.monitoring [[[ # -{{ if eq .chezmoi.hostname "nzxt" }} # [temperature] # label= # interval=5 @@ -193,7 +185,6 @@ WIDTH=220 # [name] # label= # interval=30 -{{ end }} # ]]] name # diff --git a/dot_config/i3blocks/scripts/executable_calendar b/dot_config/i3blocks/scripts/executable_calendar index 44a72e1..ab5cbeb 100755 --- a/dot_config/i3blocks/scripts/executable_calendar +++ b/dot_config/i3blocks/scripts/executable_calendar @@ -2,7 +2,8 @@ WIDTH=${WIDTH:-200} HEIGHT=${HEIGHT:-200} -DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"} +#DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"} +DATEFMT=${DATEFMT:-"+ %a %m.%d %H:%M"} SHORTFMT=${SHORTFMT:-"+%H:%M:%S"} OPTIND=1 diff --git a/private_dot_gnupg/gpg-agent.conf b/private_dot_gnupg/gpg-agent.conf new file mode 100644 index 0000000..da7b2f1 --- /dev/null +++ b/private_dot_gnupg/gpg-agent.conf @@ -0,0 +1,2 @@ +default-cache-ttl 86400 +max-cache-ttl 86400 diff --git a/scripts/executable_backup-pc b/scripts/executable_backup-pc index 1e5829f..f5f31c9 100755 --- a/scripts/executable_backup-pc +++ b/scripts/executable_backup-pc @@ -15,6 +15,9 @@ case $1 in x1 ) backup_dest="$mount_dir/laptop" ;; + ubuntu ) + backup_dest="$mount_dir/ubuntu" + ;; esac exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt" exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt" diff --git a/scripts/executable_dexscreener b/scripts/executable_dexscreener index 4e5e451..cb5efa8 100755 --- a/scripts/executable_dexscreener +++ b/scripts/executable_dexscreener @@ -7,12 +7,22 @@ price=$(echo "$raw" | jq -r ".pairs | .[] | .priceUsd") # printf "%0.4f\n" "$price" | cut -c 4- # elif (( $(echo "$price < .1" | bc -l) )); then # printf "%0.3f\n" "$price" | cut -c 4- -if (( $(echo "$price < .09" | bc -l) )); then +#if (( $(echo "$price < .09" | bc -l) )); then + #printf "%0.4f\n" "$price" | cut -c 4- +#elif (( $(echo "$price < .1" | bc -l) )); then + #printf "%0.3f\n" "$price" | cut -c 4- +#elif (( $(echo "$price < 1" | bc -l) )); then + #printf "%0.3f\n" "$price" | cut -c 3- +#elif (( $(echo "$price < 10" | bc -l) )); then + #printf "%0.2f\n" "$price" +#fi + +if [ $(echo "$price < 0.09" | bc -l) -eq 1 ]; then printf "%0.4f\n" "$price" | cut -c 4- -elif (( $(echo "$price < .1" | bc -l) )); then +elif [ $(echo "$price < 0.1" | bc -l) -eq 1 ]; then printf "%0.3f\n" "$price" | cut -c 4- -elif (( $(echo "$price < 1" | bc -l) )); then +elif [ $(echo "$price < 1" | bc -l) -eq 1 ]; then printf "%0.3f\n" "$price" | cut -c 3- -elif (( $(echo "$price < 10" | bc -l) )); then +elif [ $(echo "$price < 10" | bc -l) -eq 1 ]; then printf "%0.2f\n" "$price" fi diff --git a/scripts/executable_kraken b/scripts/executable_kraken index 4148425..7d0f349 100755 --- a/scripts/executable_kraken +++ b/scripts/executable_kraken @@ -7,16 +7,30 @@ else price=$(echo "$raw" | jq -r ".result.$1.b[0]") fi # echo "$price" -if (( $(echo "$price < 1" | bc -l) )); then +#if (( $(echo "$price < 1" | bc -l) )); then + #printf "%0.3f\n" "$price" | cut -c 3- +#elif (( $(echo "$price < 10" | bc -l) )); then + #printf "%0.3f\n" "$price" | cut -c 3- +#elif (( $(echo "$price < 1000" | bc -l) )); then + #printf "%'0.1f\n" "$price" | sed 's/,//' +#elif (( $(echo "$price < 10000" | bc -l) )); then + #printf "%'0.0f\n" "$price" | sed 's/,//' +#elif (( $(echo "$price > 100000" | bc -l) )); then + #printf "%'0.0f\n" "$price" | sed 's/,//' | cut -c -4 +#else + #echo "$price" | cut -c -3 +#fi + +if [ $(echo "$price < 1" | bc -l) -eq 1 ]; then printf "%0.3f\n" "$price" | cut -c 3- -elif (( $(echo "$price < 10" | bc -l) )); then +elif [ $(echo "$price < 10" | bc -l) -eq 1 ]; then printf "%0.3f\n" "$price" | cut -c 3- -elif (( $(echo "$price < 1000" | bc -l) )); then - printf "%'0.1f\n" "$price" | sed 's/,//' -elif (( $(echo "$price < 10000" | bc -l) )); then - printf "%'0.0f\n" "$price" | sed 's/,//' -elif (( $(echo "$price > 100000" | bc -l) )); then - printf "%'0.0f\n" "$price" | sed 's/,//' | cut -c -4 -else - echo "$price" | cut -c -3 +elif [ $(echo "$price < 100" | bc -l) -eq 1 ]; then + echo "$price" | numfmt --grouping | cut -c -2 +elif [ $(echo "$price < 1000" | bc -l) -eq 1 ]; then + echo "$price" | numfmt --grouping | cut -c -3 +elif [ $(echo "$price < 10000" | bc -l) -eq 1 ]; then + echo "$price" | numfmt --grouping +elif [ $(echo "$price > 100000" | bc -l) -eq 1 ]; then + echo "$price" | numfmt --grouping | cut -c -3 fi diff --git a/txt/exclude-dirs-backup.txt.tmpl b/txt/exclude-dirs-backup.txt.tmpl index b8df534..46dc3e2 100644 --- a/txt/exclude-dirs-backup.txt.tmpl +++ b/txt/exclude-dirs-backup.txt.tmpl @@ -17,8 +17,14 @@ /run /sys /tmp +/var/cache/apt/archives /var/cache/pacman /var/lib/systemd/coredump /var/lib/dhcpcd/proc /var/lib/docker/overlay2 /var/log/journal +/var/log +/var/tmp +/var/lib/apt/lists +/var/lib/dpkg/info +/var/lib/snapd