{"id":19413096,"url":"https://github.com/joknarf/nerdps1","last_synced_at":"2025-04-24T12:31:23.093Z","repository":{"id":162550430,"uuid":"637073242","full_name":"joknarf/nerdps1","owner":"joknarf","description":"Nerd powerline prompt for bash/ksh/zsh","archived":false,"fork":false,"pushed_at":"2024-10-30T23:36:17.000Z","size":130,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-31T00:24:24.934Z","etag":null,"topics":["bash","bashrc","dynamic","island","ksh","kshrc","nerd-fonts","powerline","profile","prompt","ps1","shell","shell-script","term","terminal","zsh","zshrc"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joknarf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-06T12:27:03.000Z","updated_at":"2024-10-30T23:36:20.000Z","dependencies_parsed_at":"2023-09-24T20:27:29.784Z","dependency_job_id":"7b27b29e-c98f-4442-9df0-5103f48db270","html_url":"https://github.com/joknarf/nerdps1","commit_stats":{"total_commits":181,"total_committers":3,"mean_commits":"60.333333333333336","dds":"0.14364640883977897","last_synced_commit":"b09404c55b783d3f69f1e83e9230a29c7d0c7193"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joknarf%2Fnerdps1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joknarf%2Fnerdps1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joknarf%2Fnerdps1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joknarf%2Fnerdps1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joknarf","download_url":"https://codeload.github.com/joknarf/nerdps1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223952568,"owners_count":17230915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bashrc","dynamic","island","ksh","kshrc","nerd-fonts","powerline","profile","prompt","ps1","shell","shell-script","term","terminal","zsh","zshrc"],"created_at":"2024-11-10T12:30:45.419Z","updated_at":"2024-11-10T12:31:34.757Z","avatar_url":"https://github.com/joknarf.png","language":"Shell","readme":"# nerdps1\nTransportable Nerd prompt for bash/ksh/zsh (mksh/ash)\n\n*New: you can now use [thefly](https://github.com/joknarf/thefly) to teleport all you shell env/plugins*\n\n## Font for prompt\n\nFor better experience, install a Nerd font on your system/console (Windows console / Windows terminal / putty / git-bash / CmdEr / iTerm2 / Terminator / MobaXterm / VScode terminal / Pycharm terminal...):  \n[Consolas NF](https://github.com/wclr/my-nerd-fonts/raw/master/Consolas%20NF/Consolas%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf)  \n[Nerd Fonts](https://www.nerdfonts.com/)\n\non Unix, copy to `~/.fonts` and run `fc-cache -fv` then relaunch your terminal and set the font\n\n## Installation\n\n* You can install using a plugin manager like sheldon / zgenom ... : plugin joknarf/nerdps1\n\n* Or you can activate the nerdps1 prompt directly using:  \n`$ . \u003c(curl -s 'https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1')`\n* Or you can get your local copy using:  \n`$ curl -sL -o ~/nerdps1 'https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1'`  \nthen source it in your profile/rcfile:  \n`. ~/nerdps1`\n\n\n\u003cimg width=\"900\" alt=\"image\" src=\"https://github.com/joknarf/nerdps1/assets/10117818/ebc3f680-69b1-45d2-b1ce-b09b09b545f2\"\u003e\n\n\nFollowing information displayed:\n* exit code if command returns code is not 0\n* elapse time during command if command lasts more than 1s (bash / zsh / ksh \u003e2012)\n* user@hostname\n* current working directory\n* git branch if in git directory (colorized according to git status)\n* python VIRTUAL_ENV and other variables values with name in `ps1_info` variable\n* filesystem usage check of `ps1_fslist` (default \"/ /tmp\") according to `ps1_fslimits` (default \"95 100\")\n* 1min cpu load (colorized default `ps1_loadlimits` \"10 20\")\n* Available memory (colorized default `ps1_memlimits` \"300 100\" MB)\n* Time\n  \n## choose your style\nset `ps1_style` variable to available styles in your .nerdrc  \nYou can test using `ps1_style` function:\n\n![image](https://github.com/joknarf/nerdps1/assets/10117818/f8d32297-73f4-4827-9802-b635c9d9a481)\n\n\n## persistent prompt across sudo\n\nUsing functions `psudo` you can login to other users keeping your nerdps1 prompt, and even add your environment file to source after user profile is loaded.  \n* `psudo` is reproducing full login of user according to its shell (/etc/profile .profile ...) and adds the nerdps1 and your optional custom env file\n```shell\n$ psudo user [myenvfile]\n```\n* psudo uses `sudo -u user` command  \nThe login shell will be the user shell (must be one of bash/ksh/zsh)\n\n\n![image](https://user-images.githubusercontent.com/10117818/236661556-becd0184-4cb1-4b14-ab6c-5fc5c2f16f2e.png)\n\n`psudo` can be used multiple times to forward the prompt/environment to users (psudo user1 followed by psudo user2...)\n\n* psudo options:\n  * `-b` : use bash shell login instead of sudo user shell\n  * `-g` : don't load global profile (/etc/profile)\n  * `-u` : don't load user profile  \n\n## persistent prompt across ssh connection\n\nUsing functions pssh and psshu you can connect to remote servers with your nerdps1 prompt, and even add your local environment file to source after user profile.  \n* `pssh/psshu` is reproducing full login of user according to its shell (/etc/profile .profile ...) and adds the nerdps1 and your optional custom env file\n\n```shell\n$ pssh [user@]remote [myenvfile] [ssh options]\n$ psshu [user@]remote [myenvfile] [ssh options]\n```\n* pssh will use local nerdps1 to make a copy to remote.\n* psshu will use `$ps1_url` to download nerdps1.  \nInvocated shell is remote user shell (bash/ksh/zsh)\n\n`pssh\\psshu` can be used multiple times to forward prompt/environment (can be mixed with `psudo` too)\n\n* pssh/psshu options:\n  * `-b` : use bash shell login instead of remote user shell\n  * `-g` : don't load global profile (/etc/profile)\n  * `-u` : don't load user profile  \n\n![image](https://user-images.githubusercontent.com/10117818/236662496-00aafc19-a253-4a2d-a356-df900b28324c.png)\n\n* Overriding user login profile at ssh connexion with nerdps1 download\n  \n`$ ssh -t \u003cremote\u003e '. \u003c(curl -s https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1) login'`\n\nor in .ssh/config:\n```\n    RequestTTY force\n    RemoteCommand . \u003c(curl -s https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1) login\n```\n\n## using .nerdrc as your custom env file\n\nInstead of passing custom env file, you can create a `~/.nerdrc` env file that will be automatically sourced after user profile and forwarded by psudo/pssh/psshu.  \nYou can put all ps1_ variables to override nerdps1 defaults, and all functions/path/env settings you want to have everywhere !  \n\n## /tmp full proof\n\nnerdps1 will use /var/tmp if not enough space in /tmp. (ssh connections can occur even if /tmp full on remote)\n\n## Font rendering\n\nIf your terminal does not manage correctly nerd font symbols, you may switch to more commonly supported powerline font symbols, or even disable the segment separator symbols.  \nYou can use : `ps1_display` function/var to switch prompt display symbol characters:\n```\n$ ps1_display -h\nusage: ps1_display \u003coption\u003e\n    \u003coption\u003e: nerdicons, nerd, powerline, nofont, ascii\n```\n\n## Customizing prompt\n\nYou can add informations on the prompt using ps1_info variable:  \n* `ps1_info=\"MYVAR MYVAR2...\"` : will display content of variables\n* `ps1_info=\"(myfunc) (myfunc2)\"` : will display output of functions myfunc myfunc2\n\nYou can add custom colorized segment defining `ps1_addon()` function:\n* `ps1_addon() { pgrep rsyslogd \u003e/dev/null || echo 'red:syslog'; }`\noutput format of function:\n  `\u003cbgcolor\u003e[/\u003cfgcolor\u003e/\u003csepcolor\u003e]:\u003cmessage\u003e[|message]`\nempty output discards the segment.\n\nChanging prompt powerline, ps1_powerline variable represents the prompt:  \n*  segment setting : `symbol/bgcolor/fgcolor/sepcolor:function`\n    * function called is `ps1_function` (ps1_ prefixed)\n    * colors : `black red green yellow blue magenta cyan white`, prefix `l` for light color\n    * symbols : `\u003c \u003e ( )`\n    * when color is set to auto, the function output must be `\u003ccolor\u003e:\u003ctext\u003e` else only `\u003ctext\u003e`\n* right alignment separator : `|`\n* `ps1_powerline=\"(/auto:exit_status (/blue:userhost )/auto:git_branch )/lblack:cwd \u003e | (/lblue/black/blue:info (/auto:freemem (/blue:time )\"`\n![image](https://github.com/joknarf/nerdps1/assets/10117818/54fa6b66-03b5-4b04-8920-a461efcd9ca4)\n* `ps1_powerline=\"auto:exit_status blue:userhost \u003e/auto:git_branch \u003e/lblack:cwd \u003e | \u003c/lblue/black/blue:info \u003c/auto:freemem \u003c/blue:time\"`\n![image](https://github.com/joknarf/nerdps1/assets/10117818/f5d3bc4e-cf65-4889-af5b-817445575ef7)\n\n## color theme example\nused terminal colors in example:\n```json\n        {\n            \"name\": \"NerdPS1\",\n            \"background\": \"#000000\",\n            \"foreground\": \"#D3D7CF\",\n            \"black\": \"#000000\",\n            \"blue\": \"#2760AA\",\n            \"cyan\": \"#06989A\",\n            \"green\": \"#088A5B\",\n            \"purple\": \"#4c3d80\",\n            \"red\": \"#BA1611\",\n            \"white\": \"#D3D7CF\",\n            \"yellow\": \"#CF8700\",\n            \"brightBlack\": \"#243C4F\",\n            \"brightBlue\": \"#729FCF\",\n            \"brightCyan\": \"#34E2E2\",\n            \"brightGreen\": \"#59c566\",\n            \"brightPurple\": \"#AD7FA8\",\n            \"brightRed\": \"#EF2929\",\n            \"brightWhite\": \"#EEEEEC\",\n            \"brightYellow\": \"#FCE94F\"\n        }\n```\n","funding_links":[],"categories":["Themes"],"sub_categories":["ZSH on Windows"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoknarf%2Fnerdps1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoknarf%2Fnerdps1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoknarf%2Fnerdps1/lists"}