From a2245d53d8c8350ced062b46a658fa909ca6e536 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Fri, 2 Aug 2024 12:22:49 +0400 Subject: [PATCH] stuff --- .config/i3/config | 1 + .config/i3status/config | 7 ++++++- .local/bin/update-monero-price | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 .local/bin/update-monero-price diff --git a/.config/i3/config b/.config/i3/config index e7402a5..68ed7bb 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -30,6 +30,7 @@ bindsym $mod+Up exec --no-startup-id mpc volume +5 bindsym $mod+Down exec --no-startup-id mpc volume -5 bindsym $mod+o exec --no-startup-id alacritty -e ncmpcpp exec --no-startup-id /home/naiji/.local/bin/update-now-playing +exec --no-startup-id /home/naiji/.local/bin/update-monero-price # The combination of xss-lock, nm-applet and pactl is a popular choice, so # they are included here as an example. Modify as you see fit. diff --git a/.config/i3status/config b/.config/i3status/config index 7d31324..a788c0d 100644 --- a/.config/i3status/config +++ b/.config/i3status/config @@ -17,6 +17,7 @@ general { # order += "ipv6" order += "read_file now-playing" order += "read_file reminder" +order += "read_file now-monero" order += "volume master" order += "wireless _first_" order += "cpu_usage" @@ -35,7 +36,11 @@ read_file "reminder" { read_file "now-playing" { path = "/home/naiji/.local/share/i3status/now-playing" -} +} + +read_file "now-monero" { + path = "/home/naiji/.local/share/i3status/now-monero" +} cpu_usage { format = " cpu %usage " diff --git a/.local/bin/update-monero-price b/.local/bin/update-monero-price new file mode 100755 index 0000000..255bde0 --- /dev/null +++ b/.local/bin/update-monero-price @@ -0,0 +1,12 @@ +#!/bin/sh + +while : +do + current="$(curl https://api.nanopool.org/v1/xmr/prices | jq | grep usd | cut -d ':' -f 2 | cut -d ',' -f 1)" + if [ -n "$current" ] + then + echo " xmr:$current " > /home/naiji/.local/share/i3status/now-monero + fi + + sleep 3600 +done