mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
switch to multi-line powerline
This commit is contained in:
parent
5071dbed2d
commit
1236825f08
1 changed files with 21 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
pl = lib.importJSON ./powerline-chars.json;
|
||||||
|
|
||||||
theme = {
|
theme = {
|
||||||
BoldForeground = true;
|
BoldForeground = true;
|
||||||
|
@ -9,8 +10,19 @@ let
|
||||||
SeparatorFg = 16;
|
SeparatorFg = 16;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
customEnd = [{
|
||||||
|
Content = "$";
|
||||||
|
Foreground = 15;
|
||||||
|
Background = 245;
|
||||||
|
Separator = pl.left_hard_divider;
|
||||||
|
}];
|
||||||
|
|
||||||
|
plconfig = builtins.toFile "powerline-config.json" (builtins.toJSON {
|
||||||
|
modes.patched.Separator = pl.upper_left_triangle;
|
||||||
|
});
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"-modules=\${remote:+'user,host,'}nix-shell,git,jobs,cwd"
|
"-modules=\${remote:+'user,host,'}nix-shell,git,jobs,cwd,newline,customend"
|
||||||
"-git-assume-unchanged-size 0"
|
"-git-assume-unchanged-size 0"
|
||||||
"-theme /etc/powerline-theme.json"
|
"-theme /etc/powerline-theme.json"
|
||||||
"-path-aliases '~/git=~/git'"
|
"-path-aliases '~/git=~/git'"
|
||||||
|
@ -19,11 +31,18 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.powerline-go ];
|
environment.systemPackages = [
|
||||||
|
pkgs.powerline-go
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin
|
||||||
|
"powerline-go-customend"
|
||||||
|
"echo '${builtins.toJSON customEnd}'")
|
||||||
|
];
|
||||||
|
|
||||||
environment.etc."powerline-theme.json".text = builtins.toJSON theme;
|
environment.etc."powerline-theme.json".text = builtins.toJSON theme;
|
||||||
|
|
||||||
programs.bash.interactiveShellInit = ''
|
programs.bash.interactiveShellInit = ''
|
||||||
|
install -D ${plconfig} ~/.config/powerline-go/config.json
|
||||||
function _update_ps1() {
|
function _update_ps1() {
|
||||||
local remote=y
|
local remote=y
|
||||||
[ "$XDG_SESSION_TYPE" = "x11" ] && unset remote
|
[ "$XDG_SESSION_TYPE" = "x11" ] && unset remote
|
||||||
|
|
Loading…
Reference in a new issue