some changes idk
This commit is contained in:
parent
a9f0e0bd12
commit
f84813da9a
|
@ -1,26 +0,0 @@
|
|||
{ lib, rustPlatform, fetchFromGitea, pkgs, stdenv, ... }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "dttyper";
|
||||
version = "1.4.0";
|
||||
|
||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkgs.pkg-config ];
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
buildInputs = lib.optionals stdenv.isLinux [ pkgs.openssl ];
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "git.berryez.xyz";
|
||||
owner = "berry";
|
||||
repo = "dttyper";
|
||||
rev = "89203be0677520d4e6945254419e7ae7377581ae";
|
||||
hash = "sha256-ZlCvMgb8yE3zDmCteyy8XXvgz+clpccV3gtXKHyZGlo=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-dpN7hHpqSur6KjtEikVjQMqnF8PW27ax7ccpQNU5vdA=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Terminal-based typing test which exports each test into an influx bd";
|
||||
homepage = "https://git.berryez.xyz/berry/dttyper";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, pkgs, stdenv, ... }:
|
||||
buildGoModule rec {
|
||||
pname = "goki";
|
||||
version = "0.1.1";
|
||||
|
||||
src = fetchFromGitHub
|
||||
{
|
||||
owner = "abeleinin";
|
||||
repo = "goki";
|
||||
rev = "b2c4ee6f0e040ce9ac2b089ab01438066e47bb9f";
|
||||
hash = "sha256-ThAQ/VgIBjKyAmo2oZARh3nqo8wB6nuv/HYRCOSbe8U=";
|
||||
};
|
||||
|
||||
|
||||
vendorHash = "sha256-SCX/eXXnwnCNZ11jw+ZNeJ42HUhI5MnV+AaO89BTKJs=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "An intelligent flashcard management tool for the terminal! ";
|
||||
homepage = "https://github.com/abeleinin/goki";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, pkgs
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "gpu-screen-recorder";
|
||||
version = "unstable-2023-11-18";
|
||||
|
||||
# printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
src = fetchurl {
|
||||
url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.r418.5a8900e.tar.gz";
|
||||
hash = "sha256-Dal6KxQOTqoNH6e8lYk5XEXGFG/vzbguNFZ9yk9nKe0=";
|
||||
};
|
||||
sourceRoot = ".";
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
xorg.libXcomposite
|
||||
libpulseaudio
|
||||
ffmpeg
|
||||
wayland
|
||||
libdrm
|
||||
libva
|
||||
xorg.libXrandr
|
||||
linuxKernel.packages.linux_xanmod_stable.nvidia_x11
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
./build.sh
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install -Dt $out/bin gpu-screen-recorder gsr-kms-server
|
||||
mkdir $out/bin/.wrapped
|
||||
mv $out/bin/gpu-screen-recorder $out/bin/.wrapped/
|
||||
makeWrapper "$out/bin/.wrapped/gpu-screen-recorder" "$out/bin/gpu-screen-recorder" \
|
||||
--prefix LD_LIBRARY_PATH : ${pkgs.libglvnd}/lib \
|
||||
--prefix LD_LIBRARY_PATH : ${pkgs.linuxKernel.packages.linux_xanmod_stable.nvidia_x11}/lib \
|
||||
--prefix PATH : $out/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A screen recorder that has minimal impact on system performance by recording a window using the GPU only";
|
||||
homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ babbaj ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{ pkgs, config, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
cmus
|
||||
playerctl
|
||||
jamesdsp
|
||||
yt-dlp
|
||||
#picard # audio metadata
|
||||
#ncmpc
|
||||
#mpd
|
||||
];
|
||||
|
||||
home-manager.users.grape = {
|
||||
services.mpd-mpris = {
|
||||
enable = false;
|
||||
mpd = {
|
||||
useLocal = true;
|
||||
};
|
||||
};
|
||||
# running it via home manager, as by default it has no permission to access my audio drivers
|
||||
services.mpd = {
|
||||
enable = false;
|
||||
musicDirectory = "/home/grape/Music";
|
||||
playlistDirectory = "/home/grape/Music/playlists";
|
||||
network = {
|
||||
port = 6600;
|
||||
listenAddress = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{ lib, rustPlatform, fetchFromGitea, pkgs, stdenv, ... }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "romodoro";
|
||||
version = "0.1.4";
|
||||
|
||||
nativeBuildInputs = [
|
||||
# adding unstable rustc
|
||||
pkgs.unstable.rustc
|
||||
pkgs.pkg-config
|
||||
pkgs.git
|
||||
pkgs.cmake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
pkgs.alsa-oss
|
||||
pkgs.alsa-lib.dev
|
||||
pkgs.alsa-utils
|
||||
pkgs.git
|
||||
];
|
||||
|
||||
src = fetchFromGitea
|
||||
{
|
||||
domain = "git.berryez.xyz";
|
||||
owner = "berry";
|
||||
repo = "romodoro";
|
||||
rev = "11414e11c99bebee6fee1561c5f8158405b05708";
|
||||
hash = "sha256-7OnY8pUrDZ26sbpE7Yco6k3UhcB+7Ipd6FskHG97m58=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-FTolAioLPwLoFRWRepdAcirS5zSKKTCGR8qGyevABNA=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A TUI pomodoro written in rust";
|
||||
homepage = "https://git.berryez.xyz/berry/romodoro";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
[
|
||||
|
||||
{
|
||||
name = "Stats";
|
||||
tags = [ "metrics" ];
|
||||
keyword = "grafana";
|
||||
url = "http://stats.barna.local";
|
||||
}
|
||||
{
|
||||
name = "Slskd - Soulseek server";
|
||||
tags = [ "music" "piracy" ];
|
||||
keyword = "slskd";
|
||||
url = "http://32.54.31.5:5030";
|
||||
}
|
||||
{
|
||||
name = "Gitea - berryez";
|
||||
tags = [ "git" "code" ];
|
||||
keyword = "gitea";
|
||||
url = "https://git.berryez.xyz";
|
||||
}
|
||||
{
|
||||
name = "NUR";
|
||||
tags = [ "nixos" ];
|
||||
keyword = "nur";
|
||||
url = "https://nur.nix-community.org/";
|
||||
}
|
||||
|
||||
]
|
||||
|
6
init.sh
Executable file
6
init.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#! /bin/sh
|
||||
|
||||
mkdir ~/Pictures
|
||||
mkdir ~/Pictures/screenshots
|
||||
mkdir ~/Videos
|
||||
mkdir ~/Videos/replays
|
51
kzszs10_james_dsp.conf
Normal file
51
kzszs10_james_dsp.conf
Normal file
|
@ -0,0 +1,51 @@
|
|||
bass_enable=false
|
||||
bass_maxgain=5
|
||||
compander_enable=false
|
||||
compander_granularity=2
|
||||
compander_response=95.0;200.0;400.0;800.0;1600.0;3400.0;7500.0;0;0;0;0;0;0;0
|
||||
compander_time_freq_transforms=0
|
||||
compander_timeconstant=0.22000
|
||||
convolver_enable=false
|
||||
convolver_file=
|
||||
convolver_optimization_mode=0
|
||||
convolver_waveform_edit=-80;-100;0;0;0;0
|
||||
crossfeed_bs2b_fcut=700
|
||||
crossfeed_bs2b_feed=60
|
||||
crossfeed_enable=false
|
||||
crossfeed_mode=0
|
||||
ddc_enable=false
|
||||
ddc_file=
|
||||
graphiceq_enable=true
|
||||
graphiceq_param=GraphicEQ: 20 -3.1; 21 -3.3; 22 -3.3; 23 -3.3; 24 -3.4; 26 -3.6; 27 -3.7; 29 -3.9; 30 -3.9; 32 -4; 34 -4; 36 -4.1; 38 -4.2; 40 -4.2; 43 -4.3; 45 -4.3; 48 -4.3; 50 -4.4; 53 -4.4; 56 -4.5; 59 -4.7; 63 -4.8; 66 -4.9; 70 -5; 74 -5.2; 78 -5.4; 83 -5.6; 87 -5.8; 92 -6; 97 -6.2; 103 -6.5; 109 -6.8; 115 -7; 121 -7.1; 128 -7.3; 136 -7.4; 143 -7.5; 151 -7.6; 160 -7.6; 169 -7.5; 178 -7.5; 188 -7.4; 199 -7.2; 210 -7; 222 -6.8; 235 -6.6; 248 -6.4; 262 -6.2; 277 -5.9; 292 -5.6; 309 -5.3; 326 -5; 345 -4.7; 364 -4.4; 385 -4; 406 -3.7; 429 -3.4; 453 -3.1; 479 -2.8; 506 -2.5; 534 -2.2; 565 -1.9; 596 -1.7; 630 -1.5; 665 -1.3; 703 -1.1; 743 -0.9; 784 -1.2; 829 -0.9; 875 -0.2; 924 -0.5; 977 -0.9; 1032 -1.2; 1090 -1.6; 1151 -1.9; 1216 -2.2; 1284 -2.5; 1357 -2.8; 1433 -3.1; 1514 -3.5; 1599 -3.9; 1689 -4.4; 1784 -5; 1885 -5.6; 1991 -6.2; 2103 -6.5; 2221 -6.4; 2347 -5.8; 2479 -4.9; 2618 -4.1; 2766 -3.6; 2921 -3.5; 3086 -3.8; 3260 -4.1; 3443 -4.6; 3637 -5.2; 3842 -5.2; 4058 -4; 4287 -2.5; 4528 -1.2; 4783 -1.6; 5052 -3.1; 5337 -4.6; 5637 -5.9; 5955 -4.9; 6290 -3.2; 6644 -1.8; 7018 -0.5; 7414 -0.8; 7831 -1.4; 8272 -1.7; 8738 -2.3; 9230 -3; 9749 -3.6; 10298 -3.9; 10878 -4; 11490 -4.1; 12137 -4.1; 12821 -4.2; 13543 -4.2; 14305 -4.1; 15110 -4.1; 15961 -4; 16860 -3.9; 17809 -3.8; 18812 -3.6; 19871 -3.5
|
||||
liveprog_enable=true
|
||||
liveprog_file=/home/grape/.config/jamesdsp/liveprog/dynamicbass.eel
|
||||
master_enable=true
|
||||
master_limrelease=223
|
||||
master_limthreshold=-5
|
||||
master_postgain=4
|
||||
reverb_bassboost=0.25000
|
||||
reverb_decay=2.09000
|
||||
reverb_delay=0.00000
|
||||
reverb_enable=false
|
||||
reverb_finaldry=-7.00000
|
||||
reverb_finalwet=-9.00000
|
||||
reverb_lfo_spin=0.70000
|
||||
reverb_lfo_wander=0.30000
|
||||
reverb_lpf_bass=600
|
||||
reverb_lpf_damp=9000
|
||||
reverb_lpf_input=18000
|
||||
reverb_lpf_output=17000
|
||||
reverb_osf=1
|
||||
reverb_reflection_amount=0.30000
|
||||
reverb_reflection_factor=1.00000
|
||||
reverb_reflection_width=0.70000
|
||||
reverb_wet=-8.00000
|
||||
reverb_width=1.00000
|
||||
stereowide_enable=false
|
||||
stereowide_level=60
|
||||
tone_enable=true
|
||||
tone_eq=25.0;40.0;63.0;100.0;160.0;250.0;400.0;630.0;1000.0;1600.0;2500.0;4000.0;6300.0;10000.0;16000.0;8.38776;8.22449;8.06122;8.08163;3.26531;1.65306;1.4898;-0.142857;0.244898;-0.979591;0.102041;-0.816327;0.163264;-0.918367;0.591837
|
||||
tone_filtertype=0
|
||||
tone_interpolation=0
|
||||
tube_enable=false
|
||||
tube_pregain=200
|
10
nix/apps/music.nix
Executable file
10
nix/apps/music.nix
Executable file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, config, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
#cmus
|
||||
playerctl
|
||||
jamesdsp
|
||||
yt-dlp
|
||||
feishin
|
||||
];
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@
|
|||
isDefault = true;
|
||||
id = 0;
|
||||
# TODO fix impurity
|
||||
extraConfig = builtins.readFile "/etc/nixos/opt/firefox/user.js"; # custom userjs config
|
||||
userChrome = builtins.readFile "/etc/nixos/opt/firefox/userChrome.css"; # browser styles
|
||||
userContent = builtins.readFile "/etc/nixos/opt/firefox/userContent.css"; # browser styles
|
||||
extraConfig = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/user.js"; # custom userjs config
|
||||
userChrome = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/userChrome.css"; # browser styles
|
||||
userContent = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/userContent.css"; # browser styles
|
||||
|
||||
extensions =
|
||||
[
|
|
@ -10,5 +10,8 @@
|
|||
--prefix LD_LIBRARY_PATH : ${pkgs.libglvnd}/lib \
|
||||
--prefix LD_LIBRARY_PATH : ${config.boot.kernelPackages.nvidia_x11}/lib
|
||||
'')
|
||||
# for scripts
|
||||
pkgs.xdotool
|
||||
pkgs.jq
|
||||
];
|
||||
}
|
|
@ -3,11 +3,7 @@ let
|
|||
scripts = "~/.config/scripts";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
# for replay
|
||||
xdotool
|
||||
jq
|
||||
];
|
||||
|
||||
|
||||
home-manager.users.grape.xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
|
@ -64,6 +60,8 @@ in
|
|||
|
||||
"mod4+t" = "exec alacritty";
|
||||
"mod4+r" = "exec firefox";
|
||||
"mod4+m" = "exec feishin";
|
||||
"mod4+p" = "exec keepassxc";
|
||||
|
||||
|
||||
# power off
|
|
@ -72,6 +72,8 @@
|
|||
"80:class_g *= 'rofi'"
|
||||
"80:class_g *= 'lutris'"
|
||||
"80:class_g *= 'Mumble'"
|
||||
"80:class_g *= 'Feishin'"
|
||||
"80:class_g *= 'feishin'"
|
||||
"80:class_g *= 'Element'"
|
||||
"85:class_g *= 'Logseq'"
|
||||
"85:class_g *= 'Codium'"
|
|
@ -156,7 +156,7 @@ in
|
|||
|
||||
"module/fs-data" = {
|
||||
"inherit" = "fs-base";
|
||||
mount-0 = "/mnt/terra";
|
||||
mount-0 = "/media/terra";
|
||||
interval = 30;
|
||||
label-mounted = "%free%(%total%)";
|
||||
};
|
|
@ -14,7 +14,7 @@ let
|
|||
seperatorColor = "#FAD000";
|
||||
};
|
||||
|
||||
script = "~/.config/scripts";
|
||||
script = "~/dotfiles/scripts";
|
||||
in
|
||||
{
|
||||
|
||||
|
@ -59,13 +59,7 @@ in
|
|||
click-right = "pavucontrol";
|
||||
};
|
||||
|
||||
"module/timew" = {
|
||||
exec = "${script}/timew.sh";
|
||||
format = "%{T2}%{F#191830}%{F-}%{T-}<label>%{T2}%{F#191830}%{F-}%{T-}";
|
||||
interval = "1";
|
||||
label-background = "#191830";
|
||||
type = "custom/script";
|
||||
};
|
||||
|
||||
|
||||
"module/replay" = {
|
||||
type = "custom/script";
|
||||
|
@ -115,7 +109,7 @@ in
|
|||
foreground = "#FFFFFF";
|
||||
height = "34";
|
||||
modules-center = "cava";
|
||||
modules-left = "audio-capsule a music-capsule a timew";
|
||||
modules-left = "audio-capsule a music-capsule";
|
||||
modules-right = " wireless-network a replay";
|
||||
padding-left = "5";
|
||||
padding-right = "5";
|
|
@ -71,7 +71,9 @@
|
|||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.initrd.luks.devices."luks-f7e86dde-55a5-4306-a7c2-cf2d93c9ee0b".device = "/dev/disk/by-uuid/f7e86dde-55a5-4306-a7c2-cf2d93c9ee0b";
|
||||
#boot.initrd.luks.devices."luks-f7e86dde-55a5-4306-a7c2-cf2d93c9ee0b".device = "/dev/disk/by-uuid/f7e86dde-55a5-4306-a7c2-cf2d93c9ee0b"; # old dead ssd rip 24.07.28
|
||||
boot.initrd.luks.devices."luks-da1b2f8c-877a-4c39-8965-a4af625718c".device = "/dev/disk/by-uuid/da1b2f8c-877a-4c39-8965-a4af6a25718c";
|
||||
|
||||
networking.hostName = "strix";
|
||||
|
||||
# Enable networking
|
20
etc/hardware-configuration.nix → nix/hardware-configuration.nix
Executable file → Normal file
20
etc/hardware-configuration.nix → nix/hardware-configuration.nix
Executable file → Normal file
|
@ -5,8 +5,7 @@
|
|||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" ];
|
||||
|
@ -15,27 +14,26 @@
|
|||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/7610257f-16f7-41c2-a0d9-4e9f08f2b3e9";
|
||||
{ device = "/dev/disk/by-uuid/c5e13eac-4cdf-490b-85f4-c14038313ada";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-bbb8e429-bee1-4b5e-8ce8-c54f5f4f29a2".device = "/dev/disk/by-uuid/bbb8e429-bee1-4b5e-8ce8-c54f5f4f29a2";
|
||||
boot.initrd.luks.devices."luks-53201bbc-c763-4d15-8bf8-a173550fab91".device = "/dev/disk/by-uuid/53201bbc-c763-4d15-8bf8-a173550fab91";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/4362-33EF";
|
||||
{ device = "/dev/disk/by-uuid/9DDA-7820";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/terra" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/f2b24250-0cf5-43d4-806f-7f024922781a";
|
||||
fileSystems."/media/terra" =
|
||||
{ device = "/dev/disk/by-uuid/f2b24250-0cf5-43d4-806f-7f024922781a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[{ device = "/dev/disk/by-uuid/c680b02d-7de7-4cd7-855b-daec64833e3b"; }];
|
||||
[ { device = "/dev/disk/by-uuid/b719003b-1ae0-4377-97f1-4447b4514de8"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
@ -1,42 +1,51 @@
|
|||
#!/bin/sh
|
||||
|
||||
if info=$(cmus-remote -Q 2> /dev/null); then
|
||||
status=$(echo "$info" | grep -v "set " | grep -v "tag " | grep "status " | cut -d ' ' -f 2)
|
||||
# The name of polybar bar which houses the main spotify module and the control modules.
|
||||
PARENT_BAR="now-playing"
|
||||
PARENT_BAR_PID=$(pgrep -a "polybar" | grep "$PARENT_BAR" | cut -d" " -f1)
|
||||
|
||||
if [ "$status" = "playing" ] || [ "$status" = "paused" ] || [ "$status" = "stopped" ]; then
|
||||
title=$(echo "$info" | grep -v 'set ' | grep " title " | cut -d ' ' -f 3-)
|
||||
artist=$(echo "$info" | grep -v 'set ' | grep " artist " | cut -d ' ' -f 3-)
|
||||
position=$(echo "$info" | grep -v "set " | grep -v "tag " | grep "position " | cut -d ' ' -f 2)
|
||||
duration=$(echo "$info" | grep -v "set " | grep -v "tag " | grep "duration " | cut -d ' ' -f 2)
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="Feishin"
|
||||
|
||||
if [ "$artist" ] || [ "$title" ]; then
|
||||
if [ "$duration" -ge 0 ]; then
|
||||
pos_minutes=$(printf "%02d" $((position / 60)))
|
||||
pos_seconds=$(printf "%02d" $((position % 60)))
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ duration(position) }} {{ title }} - {{ artist }}"
|
||||
|
||||
dur_minutes=$(printf "%02d" $((duration / 60)))
|
||||
dur_seconds=$(printf "%02d" $((duration % 60)))
|
||||
# Sends $2 as message to all polybar PIDs that are part of $1
|
||||
update_hooks() {
|
||||
while IFS= read -r id
|
||||
do
|
||||
polybar-msg -p "$id" hook spotify-play-pause $2 1>/dev/null 2>&1
|
||||
done < <(echo "$1")
|
||||
}
|
||||
|
||||
info_string="| $pos_minutes:$pos_seconds / $dur_minutes:$dur_seconds"
|
||||
fi
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
info_string="$artist - $title $info_string"
|
||||
|
||||
if [ "$status" = "playing" ]; then
|
||||
echo "#1 $info_string"
|
||||
elif [ "$status" = "paused" ]; then
|
||||
echo "#2 $info_string"
|
||||
elif [ "$status" = "stopped" ]; then
|
||||
echo "#3 $info_string"
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
echo "Music offline"
|
||||
STATUS="No player is running"
|
||||
fi
|
||||
|
||||
if [ "$1" == "--status" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
echo "Music offline"
|
||||
fi
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "No music is playing"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
update_hooks "$PARENT_BAR_PID" 2
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "No player is running" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
echo "Music offline"
|
||||
update_hooks "$PARENT_BAR_PID" 1
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
else
|
||||
echo "Music offline"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue