no need for wanikani progression here
This commit is contained in:
parent
1f7351914b
commit
e7df7f3578
4 changed files with 3 additions and 109 deletions
|
|
@ -2,36 +2,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
wanikani-current-reviews-script = builtins.path { path = ./wanikani-current-reviews.sh; };
|
||||
wanikani-level-script = builtins.path { path = ./wanikani-level.sh; };
|
||||
wanikani-progression-script = builtins.path { path = ./wanikani-progression.sh; };
|
||||
tmux-dracula = pkgs.tmuxPlugins.mkTmuxPlugin rec {
|
||||
pluginName = "dracula";
|
||||
version = "3.0.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "dracula";
|
||||
repo = "tmux";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-VY4PyaQRwTc6LWhPJg4inrQf5K8+bp0+eqRhR7+Iexk=";
|
||||
};
|
||||
postInstall = ''
|
||||
# i am adding my custom widget to the plugin here cp the wanikani.sh script to the plugin directory
|
||||
cp ${wanikani-current-reviews-script} $target/scripts/wanikani-current-reviews.sh
|
||||
cp ${wanikani-level-script} $target/scripts/wanikani-level.sh
|
||||
cp ${wanikani-progression-script} $target/scripts/wanikani-progression.sh
|
||||
'';
|
||||
meta = with pkgs.lib; {
|
||||
homepage = "https://draculatheme.com/tmux";
|
||||
description = "Feature packed Dracula theme for tmux!";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ ethancedwards8 ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
}: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
historyLimit = 100000;
|
||||
|
|
@ -43,9 +14,9 @@ in
|
|||
tmuxPlugins.sensible
|
||||
tmuxPlugins.better-mouse-mode
|
||||
{
|
||||
plugin = tmux-dracula;
|
||||
plugin = tmuxPlugins.dracula;
|
||||
extraConfig = ''
|
||||
set -g @dracula-plugins "custom:wanikani-level.sh custom:wanikani-progression.sh custom:wanikani-current-reviews.sh cpu-usage ram-usage gpu-usage battery"
|
||||
set -g @dracula-plugins "cpu-usage ram-usage gpu-usage battery"
|
||||
set -g @dracula-show-left-icon hostname
|
||||
set -g @dracula-git-show-current-symbol ✓
|
||||
set -g @dracula-git-no-repo-message "no-git"
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#!nix-shell -i bash -p jq curl
|
||||
get_wanikani()
|
||||
{
|
||||
wanikani_reviews=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?immediately_available_for_review=true" | jq '.total_count')
|
||||
echo "$wanikani_reviews reviews"
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
get_wanikani
|
||||
sleep 600
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#!nix-shell -i bash -p jq curl
|
||||
|
||||
get_wanikani()
|
||||
{
|
||||
wanikani_level_data=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/level_progressions")
|
||||
wanikani_level=$(echo $wanikani_level_data | jq '.data[-1].data.level')
|
||||
wanikani_level_start_date_string=$(echo $wanikani_level_data | jq '.data[-1].data.started_at')
|
||||
wanikani_level_start_timestamp=$(date -d "${wanikani_level_start_date_string//\"/}" +%s)
|
||||
|
||||
current_timestamp=$(date +%s)
|
||||
difference=$((current_timestamp - wanikani_level_start_timestamp))
|
||||
wanikani_level_creation_date=$((difference / 86400))
|
||||
echo "At $wanikani_level for $wanikani_level_creation_date days"
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
get_wanikani
|
||||
# sleep for 1 hour
|
||||
sleep 3600
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#!nix-shell -i bash -p jq curl python312
|
||||
|
||||
get_wanikani()
|
||||
{
|
||||
all_subjects=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/subjects")
|
||||
total_subjects=$(echo $all_subjects | jq '.total_count')
|
||||
|
||||
total=0
|
||||
for i in {0..9}
|
||||
do
|
||||
srs_level=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?srs_stages=$i" | jq '.total_count')
|
||||
# echo "SRS level $i: $srs_level"
|
||||
multiplied=$((srs_level * (i + 1)))
|
||||
# echo "SRS level $i multiplied: $multiplied"
|
||||
total=$((total + multiplied))
|
||||
# echo "Total: $total"
|
||||
done
|
||||
|
||||
# now i need the percentage of (total/(total_subjects*10))
|
||||
# python will be used for this and i need the result to be %23.234
|
||||
python_command="python3 -c 'print(f\"{$total/$total_subjects*10:.3f}\")'"
|
||||
# echo "Python command: $python_command"
|
||||
percentage=$(nix-shell -p python312 --run "$python_command")
|
||||
echo "%$percentage"
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
get_wanikani
|
||||
# sleep for 1 hour
|
||||
sleep 3600
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue