{"id":931,"date":"2017-11-10T17:09:10","date_gmt":"2017-11-10T16:09:10","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=931"},"modified":"2018-11-19T17:15:38","modified_gmt":"2018-11-19T16:15:38","slug":"bash-prompts","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/bash-prompts\/","title":{"rendered":"Bash Prompts"},"content":{"rendered":"<pre class=\"\">smiley () { echo -e \":\\\\$(($??50:51))\"; } \r\nexport PS1=\"\\h\\$(smiley) \\e[30;1m\\w\\e[0m\\n\\$ \"<\/pre>\n<p>More advanced bash prompts:<\/p>\n<p><strong>Powerline <\/strong>(Source:\u00a0<a href=\"https:\/\/wiki.archlinux.org\/index.php\/Powerline\">https:\/\/wiki.archlinux.org\/index.php\/Powerline<\/a>)<\/p>\n<pre class=\"lang:default decode:true \">sudo pacman -Sy powerline powerline-fonts<\/pre>\n<p>Add the following to your\u00a0<b>~\/.bashrc<\/b>:<\/p>\n<pre class=\"\">powerline-daemon -q\r\nPOWERLINE_BASH_CONTINUATION=1\r\nPOWERLINE_BASH_SELECT=1\r\n. \/usr\/share\/powerline\/bindings\/bash\/powerline.sh\r\n<\/pre>\n<p>Show git branch\u00a0 (Source: <a href=\"https:\/\/github.com\/powerline\/powerline\/issues\/186#issuecomment-247810572\">https:\/\/github.com\/powerline\/powerline\/issues\/186#issuecomment-247810572<\/a>)<\/p>\n<pre class=\"lang:default decode:true \">mkdir -p ~\/.config\/powerline\r\ncat &lt;&lt;-'EOF' &gt; ~\/.config\/powerline\/config.json\r\n{\r\n    \"ext\": {\r\n        \"shell\": {\r\n            \"theme\": \"default_leftonly\"\r\n        }\r\n    }\r\n}\r\nEOF\r\npowerline-daemon --replace<\/pre>\n<p>Windows fonts (https:\/\/github.com\/powerline\/fonts)<\/p>\n<p>eg.\u00a0<a href=\"https:\/\/github.com\/powerline\/fonts\/raw\/master\/DejaVuSansMono\/DejaVu%20Sans%20Mono%20for%20Powerline.ttf\">https:\/\/github.com\/powerline\/fonts\/raw\/master\/DejaVuSansMono\/DejaVu%20Sans%20Mono%20for%20Powerline.ttf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>smiley () { echo -e &#8220;:\\\\$(($??50:51))&#8221;; } export PS1=&#8221;\\h\\$(smiley) \\e[30;1m\\w\\e[0m\\n\\$ &#8221; More advanced bash prompts: Powerline (Source:\u00a0https:\/\/wiki.archlinux.org\/index.php\/Powerline) sudo pacman -Sy powerline powerline-fonts Add the following to your\u00a0~\/.bashrc: powerline-daemon -q POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 . \/usr\/share\/powerline\/bindings\/bash\/powerline.sh Show git branch\u00a0 (Source: https:\/\/github.com\/powerline\/powerline\/issues\/186#issuecomment-247810572) mkdir -p ~\/.config\/powerline cat &lt;&lt;-&#8216;EOF&#8217; &gt; ~\/.config\/powerline\/config.json { &#8220;ext&#8221;: { &#8220;shell&#8221;: { &#8220;theme&#8221;: &#8220;default_leftonly&#8221; } } } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-931","post","type-post","status-publish","format-standard","hentry","category-other-scripts"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":6,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":1637,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/931\/revisions\/1637"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}