From 989ea4515f83db5fb8098fbb8180b7c3938dcf3c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 17 May 2024 21:43:08 +1000 Subject: [PATCH] feat: Add music player and some more git stuff --- .zshrc | 10 +++++++++- theme.omp.json | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index af39f1a..e85cfaf 100644 --- a/.zshrc +++ b/.zshrc @@ -132,6 +132,14 @@ alias hcurl='curl --doh-url https://hnsdoh.com/dns-query' alias ls='exa' alias ll='exa --long --group --header --icons --classify' - +# Music alias +alias pause="playerctl play-pause" +alias play="playerctl play" +# Next/Prev and wait a second to let the song change +alias next="playerctl next && sleep .2" +alias prev="playerctl previous && sleep .2" +alias v+="playerctl volume 1+" +alias v-="playerctl volume 1-" +alias music="echo 'Currently playing: $(playerctl metadata --format '{{artist}} - {{title}}')\nUsage: play, pause, next, prev, v+, v-'" eval "$(zoxide init --cmd cd zsh)" diff --git a/theme.omp.json b/theme.omp.json index 23a6ab0..0656edc 100644 --- a/theme.omp.json +++ b/theme.omp.json @@ -42,7 +42,7 @@ "type": "git", "style": "plain", "foreground": "white", - "template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[{{ .HEAD }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]" + "template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[{{ .HEAD }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]{{if .BranchStatus }}-[{{ .BranchStatus }}]{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}]{{ end }}" }, { "type": "flutter", @@ -57,6 +57,15 @@ "type": "prompt", "alignment": "right", "segments": [ + { + "type": "command", + "style": "plain", + "foreground": "#340452", + "properties": { + "shell": "bash", + "command": "[ \"$(playerctl status)\" = \"Playing\" ] && echo \"$(playerctl metadata title) - $(playerctl metadata artist)\"||" + } + }, { "type": "executiontime", "style": "plain",