Browse Source

Tickers color scheme

ubuntu
Kevin Mok 4 days ago
parent
commit
6f8c0b08d7
  1. 4
      aliases/key_aliases.tmpl
  2. 7
      dot_config/i3/config.tmpl
  3. 11
      dot_config/i3blocks/i3blocks-secondary.conf.tmpl
  4. 18
      dot_config/i3blocks/i3blocks.conf.tmpl
  5. 2
      dot_config/i3blocks/scripts/executable_calendar
  6. 3
      dot_config/i3blocks/scripts/executable_dexscreener
  7. 3
      dot_config/i3blocks/scripts/executable_kraken
  8. 10
      dot_config/mimeapps.list
  9. 36
      scripts/executable_kraken

4
aliases/key_aliases.tmpl

@ -204,8 +204,8 @@ uzl "unzip -l"
# power options [[[ # # power options [[[ #
# s "systemctl suspend"
s "xset dpms force off"
s "systemctl suspend"
#s "xset dpms force off"
# sl "i3lock-fancy && systemctl suspend" # sl "i3lock-fancy && systemctl suspend"
# so "xset dpms force off" # so "xset dpms force off"
xx "exit" xx "exit"

7
dot_config/i3/config.tmpl

@ -33,7 +33,8 @@ exec --no-startup-id i3-msg workspace $ws6; exec discord
set $mod Mod1 set $mod Mod1
set $browser "firefox" set $browser "firefox"
set $browser_secondary "chromium"
#set $browser_secondary "chromium"
set $browser_secondary "google-chrome-stable"
# set $browser "chromium" # set $browser "chromium"
# set $browser_secondary "firefox" # set $browser_secondary "firefox"
set $scripts_path "/home/kevin/scripts" set $scripts_path "/home/kevin/scripts"
@ -336,7 +337,7 @@ set $main "HDMI-0"
{{ end }} {{ end }}
set $secondary "DVI-I-1" set $secondary "DVI-I-1"
set $main "HDMI-1"
set $main "HDMI-0"
# workspace $ws1 output $main # workspace $ws1 output $main
workspace $ws1 output $secondary workspace $ws1 output $secondary
@ -398,7 +399,7 @@ bindsym $mod+Mod4+F5 workspace $ws5; exec firefox -P nft
# bindsym $mod+Mod4+F5 workspace $ws5; exec firefox --private-window # bindsym $mod+Mod4+F5 workspace $ws5; exec firefox --private-window
bindsym Control+Shift+F5 workspace $ws5; exec firefox -P work bindsym Control+Shift+F5 workspace $ws5; exec firefox -P work
bindsym Mod4+f workspace $ws5; exec firefox --private-window google.ca bindsym Mod4+f workspace $ws5; exec firefox --private-window google.ca
bindsym $mod+Shift+F5 workspace $ws5; exec chromium
bindsym $mod+Shift+F5 workspace $ws5; exec $browser_secondary
# bindsym Mod4+g workspace $ws5; layout stacking; exec $term -e steam # bindsym Mod4+g workspace $ws5; layout stacking; exec $term -e steam
# bindsym Mod4+g workspace $ws5; layout tabbed; exec gimp # bindsym Mod4+g workspace $ws5; layout tabbed; exec gimp
# bindsym Mod4+g workspace $ws5; exec mgba-qt # bindsym Mod4+g workspace $ws5; exec mgba-qt

11
dot_config/i3blocks/i3blocks-secondary.conf.tmpl

@ -19,20 +19,18 @@ color=#cbe4ff
# sys.monitoring [[[ # # sys.monitoring [[[ #
{{ if eq .chezmoi.hostname "nzxt" }}
[temperature] [temperature]
label= label=
interval=5 interval=5
[cpu_usage] [cpu_usage]
label=
interval=2
label=
interval=5
[memory] [memory]
label=
label=
# color=#3da061 # color=#3da061
interval=2 interval=2
{{ end }}
# ]]] sys.monitoring # # ]]] sys.monitoring #
@ -67,11 +65,8 @@ interval=60
[calendar] [calendar]
interval=30 interval=30
label= label=
# {{ if eq .chezmoi.hostname "nzxt" }}
# DATEFMT=+%H:%M.%a-%m-%d # DATEFMT=+%H:%M.%a-%m-%d
# {{ else }}
# DATEFMT=+%H:%M # DATEFMT=+%H:%M
# {{ end }}
#DATEFMT=+%H:%M #DATEFMT=+%H:%M
# SHORTFMT=+%H:%M:%S # SHORTFMT=+%H:%M:%S
#SHORTFMT=+%H:%M.%a-%m-%d #SHORTFMT=+%H:%M.%a-%m-%d

18
dot_config/i3blocks/i3blocks.conf.tmpl

@ -38,7 +38,8 @@ color=#cbe4ff
[kraken] [kraken]
label=BTC label=BTC
#TICKER=BTCUSDC #TICKER=BTCUSDC
command=/home/kevin/scripts/kraken BTCUSDC
#command=/home/kevin/.config/i3blocks/scripts/kraken BTCUSDC
command=/home/kevin/.config/i3blocks/scripts/kraken BTCUSDC
interval=30 interval=30
# [ticker] # [ticker]
@ -49,7 +50,7 @@ interval=30
[kraken] [kraken]
label=SOL label=SOL
#TICKER=SOLUSD #TICKER=SOLUSD
command=/home/kevin/scripts/kraken SOLUSD
command=/home/kevin/.config/i3blocks/scripts/kraken SOLUSD
interval=30 interval=30
# [kraken] # [kraken]
@ -61,25 +62,26 @@ interval=30
label=PIXL label=PIXL
#CHAIN=ethereum #CHAIN=ethereum
#PAIR=0x31c0ba10e4e12be6cdceb612e5e829d977532bfc #PAIR=0x31c0ba10e4e12be6cdceb612e5e829d977532bfc
command=/home/kevin/scripts/dexscreener ethereum 0x31c0ba10e4e12be6cdceb612e5e829d977532bfc
command=/home/kevin/.config/i3blocks/scripts/dexscreener ethereum 0x31c0ba10e4e12be6cdceb612e5e829d977532bfc
interval=30 interval=30
#[kraken]
#label=ETH
[kraken]
label=ETH
#TICKER=ETHUSDC #TICKER=ETHUSDC
#interval=30
command=/home/kevin/.config/i3blocks/scripts/kraken ETHUSDC
interval=30
[dexscreener] [dexscreener]
label=PENGU label=PENGU
#CHAIN=solana #CHAIN=solana
#PAIR=B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV #PAIR=B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV
command=/home/kevin/scripts/dexscreener solana B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV
command=/home/kevin/.config/i3blocks/scripts/dexscreener solana B4Vwozy1FGtp8SELXSXydWSzavPUGnJ77DURV2k4MhUV
interval=5 interval=5
[kraken] [kraken]
label=AVAX label=AVAX
#TICKER=AVAXUSD #TICKER=AVAXUSD
command=/home/kevin/scripts/kraken AVAXUSD
command=/home/kevin/.config/i3blocks/scripts/kraken AVAXUSD
interval=30 interval=30
#[dexscreener] #[dexscreener]

2
dot_config/i3blocks/scripts/executable_calendar

@ -3,7 +3,7 @@
WIDTH=${WIDTH:-200} WIDTH=${WIDTH:-200}
HEIGHT=${HEIGHT:-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"}
DATEFMT=${DATEFMT:-"+ %a %-m/%d %H:%M"}
SHORTFMT=${SHORTFMT:-"+%H:%M:%S"} SHORTFMT=${SHORTFMT:-"+%H:%M:%S"}
OPTIND=1 OPTIND=1

3
dot_config/i3blocks/scripts/executable_dexscreener

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
. "/home/kevin/.cache/wal/colors.sh" . "/home/kevin/.cache/wal/colors.sh"
ticker=$(~/scripts/dexscreener $CHAIN $PAIR)
#ticker=$(~/scripts/dexscreener $CHAIN $PAIR)
ticker=$(~/scripts/dexscreener $1 $2)
printf "%s\n\n%s\n" "$ticker" "$color7" printf "%s\n\n%s\n" "$ticker" "$color7"

3
dot_config/i3blocks/scripts/executable_kraken

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
. "/home/kevin/.cache/wal/colors.sh" . "/home/kevin/.cache/wal/colors.sh"
ticker=$(~/scripts/kraken $TICKER)
#ticker=$(~/scripts/kraken $TICKER)
ticker=$(~/scripts/kraken $1)
printf "%s\n\n%s\n" "$ticker" "$color7" printf "%s\n\n%s\n" "$ticker" "$color7"

10
dot_config/mimeapps.list

@ -1,9 +1,9 @@
[Default Applications] [Default Applications]
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/about=firefox.desktop
x-scheme-handler/unknown=firefox.desktop
text/html=firefox_firefox.desktop
x-scheme-handler/http=firefox_firefox.desktop
x-scheme-handler/https=firefox_firefox.desktop
x-scheme-handler/about=firefox_firefox.desktop
x-scheme-handler/unknown=firefox_firefox.desktop
x-scheme-handler/ftp=firefox.desktop x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop x-scheme-handler/chrome=firefox.desktop
application/x-extension-htm=firefox.desktop application/x-extension-htm=firefox.desktop

36
scripts/executable_kraken

@ -1,3 +1,5 @@
#!/bin/bash
# price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]") # price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]")
raw=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1") raw=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1")
# echo $raw # echo $raw
@ -6,31 +8,31 @@ if [ "$1" = "BTCUSDC" ]; then
else else
price=$(echo "$raw" | jq -r ".result.$1.b[0]") price=$(echo "$raw" | jq -r ".result.$1.b[0]")
fi fi
# echo "$price"
#if (( $(echo "$price < 1" | bc -l) )); then
#if [ $(echo "$price < 1" | bc -l) -eq 1 ]; then
#printf "%0.3f\n" "$price" | cut -c 3- #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- #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
#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 | cut -c -3
#echo "$price" | cut -c -3 #echo "$price" | cut -c -3
#elif [ $(echo "$price > 100000" | bc -l) -eq 1 ]; then
#echo "$price" | numfmt --grouping | cut -c -3
#fi #fi
if [ $(echo "$price < 1" | bc -l) -eq 1 ]; then
if (( $(echo "$price < 1" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3- printf "%0.3f\n" "$price" | cut -c 3-
elif [ $(echo "$price < 10" | bc -l) -eq 1 ]; then
elif (( $(echo "$price < 10" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3- printf "%0.3f\n" "$price" | cut -c 3-
elif [ $(echo "$price < 100" | bc -l) -eq 1 ]; then
elif (( $(echo "$price < 100" | bc -l) )); then
echo "$price" | numfmt --grouping | cut -c -2 echo "$price" | numfmt --grouping | cut -c -2
elif [ $(echo "$price < 1000" | bc -l) -eq 1 ]; then
elif (( $(echo "$price < 1000" | bc -l) )); then
echo "$price" | numfmt --grouping | cut -c -3 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
elif (( $(echo "$price < 10000" | bc -l) )); then
echo "$price" | cut -c -3
elif (( $(echo "$price > 100000" | bc -l) )); then
echo "$price" | numfmt --grouping | cut -c -3 echo "$price" | numfmt --grouping | cut -c -3
fi fi
Loading…
Cancel
Save