💾 Archived View for pixeldreams.tokyo › technomancy › cute-ion-theme.gmi captured on 2023-11-14 at 08:06:48. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-09-08)
-=-=-=-=-=-=-
31 august, 2023
idk why i thought this would make me cool but i made a slackbuild to install
ion shell (from redox os) and spent time learning the scripting language to
reimpliment my shell theme
my .config/ion/initrc:
fn get_depth dir:str -- returns the depth of a directory in the filesystem let dir = [@split($dir '/')] echo $len(@dir) end fn PROMPT -- prints a lovely prompt for the user let user = " ${USER}\@ " let escaped_pwd = $replace($PWD '@' '\@') let dir = [@split($escaped_pwd '/')] let depth:int = $(get_depth $pwd) let home_depth:int = $(get_depth $HOME) let diff = $((depth - home_depth)) test $diff -gt 3 && let dir = [@dir[..$home_depth] '...' @dir[-3..]] let dir = $join(@dir '/') let dir = $replacen($dir $HOME '~' 1) test $USER = "root" && let sigil = '#' || let sigil = '