From 6b46b3f53cf9a1d04679204f2b947ae3856c735f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 23 Aug 2024 19:43:06 +0200 Subject: [PATCH] Add desired posh theme --- profiles/Generic/config.nix | 1 + profiles/manuel/config.nix | 9 ++ profiles/manuel/manuel.omp.json | 173 ++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 profiles/manuel/config.nix create mode 100644 profiles/manuel/manuel.omp.json diff --git a/profiles/Generic/config.nix b/profiles/Generic/config.nix index fc24cedb..729006ef 100644 --- a/profiles/Generic/config.nix +++ b/profiles/Generic/config.nix @@ -3,6 +3,7 @@ fs = import ../../lib/modules/partition/fs.nix; in { imports = [ + ../manuel/config.nix ../../lib/modules/valhalla.nix ]; diff --git a/profiles/manuel/config.nix b/profiles/manuel/config.nix new file mode 100644 index 00000000..16c6fe3c --- /dev/null +++ b/profiles/manuel/config.nix @@ -0,0 +1,9 @@ +{ ... }: { + valhalla.users.manuel = { + oh-my-posh = { + theme = { + source = ./manuel.omp.json; + }; + }; + }; +} diff --git a/profiles/manuel/manuel.omp.json b/profiles/manuel/manuel.omp.json new file mode 100644 index 00000000..83b4db18 --- /dev/null +++ b/profiles/manuel/manuel.omp.json @@ -0,0 +1,173 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "version": 2, + "blocks": [ + { + "type": "prompt", + "alignment": "left", + "segments": [ + { + "type": "os", + "style": "diamond", + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "background_templates": [ + "{{ if eq .OS \"ubuntu\" }}#EA531A{{ end }}", + "{{ if eq .OS \"debian\" }}#D80150{{ end }}", + "{{ if eq .OS \"arch\" }}#1793D1{{ end }}" + ], + "foreground": "p:white", + "template": "{{ if ne .OS \"windows\" }}{{ .Icon }} {{ end }}" + }, + { + "type": "session", + "style": "diamond", + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b0", + "background": "p:yellow", + "foreground": "p:black", + "properties": { + "display_host": false + }, + "template": " {{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }} " + }, + { + "type": "path", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "background": "p:orange", + "foreground": "p:black", + "properties": { + "home_icon": "~", + "style": "folder" + }, + "template": " \udb80\ude4b {{ path .Path .Location }} " + }, + { + "type": "dotnet", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "foreground": "p:black", + "background": "#00ffff", + "template": " \udb81\ude10 {{ .Full }} " + }, + { + "type": "java", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "background": "#4063d8", + "template": " \udb82\udf37 {{ .Full }} " + }, + { + "type": "python", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "background": "#906cff", + "template": " \udb80\udf20 {{ .Full }} " + }, + { + "type": "git", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "trailing_diamond": "\ue0b4", + "background": "p:green", + "background_templates": [ + "{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}", + "{{ if gt .Ahead 0 }}#49416D{{ end }}", + "{{ if gt .Behind 0 }}#7A306C{{ end }}" + ], + "foreground": "p:black", + "foreground_templates": [ + "{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}", + "{{ if gt .Ahead 0 }}p:white{{ end }}" + ], + "properties": { + "branch_max_length": 25, + "fetch_stash_count": true, + "fetch_status": true, + "fetch_upstream_icon": true, + "upstream_icons": { + "codeberg.org": "\uf330 ", + "git.nuth.ch": "\uf335", + "git.jonascosta.ch": "\uf339 ", + "git.romhackersworld.eu": "\uf339 ", + "aur.archlinux.org": "\uf303 " + } + }, + "templates": [ + "{{ if .UpstreamURL }} {{ url .UpstreamIcon .UpstreamURL }}{{ end }}", + " {{ .HEAD }} ", + "{{ if .BranchStatus }}{{ .BranchStatus }} {{ end }}", + "{{ if .Working.Changed }} \uf044 {{ .Working.String }} {{ end }}", + "{{ if and (.Working.Changed) (or (.Staging.Changed) (gt .StashCount 0)) }} | {{ end }}", + "{{ if .Staging.Changed }} \uf046 {{ .Staging.String }} {{ end }}", + "{{ if and (.Staging.Changed) (gt .StashCount 0) }} | {{ end }}", + "{{ if gt .StashCount 0 }} \udb80\udd93 {{ .StashCount }}{{ end }} " + ] + }, + { + "type": "node", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "background": "#6ca35e", + "foreground": "p:white", + "properties": { + "fetch_version": true + }, + "template": " \udb80\udf99 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} " + }, + { + "type": "root", + "style": "powerline", + "powerline_symbol": "\ue0b0", + "background": "p:yellow", + "foreground": "p:white", + "properties": { + "root_icon": "\uf0e7" + } + }, + { + "type": "executiontime", + "style": "plain", + "background": "#83769c", + "foreground": "p:white", + "properties": { + "always_enabled": true + }, + "template": "\ue0b0 \udb81\udead {{ .FormattedMs }}\u2800" + }, + { + "type": "text", + "style": "diamond", + "background": "p:blue", + "trailing_diamond": "\ue0b4", + "background_templates": [ + "{{ if gt .Code 0 }}p:red{{ end }}" + ], + "foreground": "p:white", + "properties": { + "always_enabled": true + }, + "template": "\ue0b0 {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} " + } + ] + } + ], + "transient_prompt": { + "background": "transparent", + "foreground": "p:black", + "template": "\ue0b6<,p:yellow> {{ .Folder }} \ue0b0 " + }, + "final_space": true, + "palette": { + "black": "#262B44", + "blue": "#4B95E9", + "green": "#59C9A5", + "orange": "#F07623", + "red": "#D81E5B", + "white": "#E0DEF4", + "yellow": "#F3AE35" + } +}