mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 05:42:22 +00:00
switch to ZSH, do a bunch of nix stuff
This commit is contained in:
parent
c744349bca
commit
fbd2f97beb
12 changed files with 1228 additions and 39 deletions
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"optOut": false,
|
"optOut": false,
|
||||||
"lastUpdateCheck": 1593429304363
|
"lastUpdateCheck": 1593814336821
|
||||||
}
|
}
|
503
files/.config/polybar/.notifs
Normal file
503
files/.config/polybar/.notifs
Normal file
|
@ -0,0 +1,503 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@LegendOfMiracles#1719 I'm top
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Ich brauch 15 min länger xD - 14:46
|
||||||
|
|
||||||
|
Also 15 15 - 14:46
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Er packt auch die Parameter aus und ruft dann die Methode auf.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Celine Zippert: Hier noch in light
|
||||||
|
|
||||||
|
|
||||||
|
Niklas Rennhofer: danke
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
let alac = pkgs.alacritty in
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(
|
||||||
|
self: super: {
|
||||||
|
alacritty =
|
||||||
|
(
|
||||||
|
pkgs.writeScriptBin "alacritty" ''
|
||||||
|
#!/bin/sh
|
||||||
|
exec nixGLIntel ${alac}/bin/alacritty "$@"
|
||||||
|
''
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];```
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ElKowar#4689 oohhh where did u find this beauty
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
PROMPT='0,000000{11}┌─
|
||||||
|
└─%(#.0,000000{red}
|
||||||
|
```
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
||||||
|
Read them by running the command 'home-manager news'.
|
||||||
|
|
|
@ -108,7 +108,7 @@ font-4 = "Symbola:size=9;2"
|
||||||
|
|
||||||
|
|
||||||
modules-left = xmonad
|
modules-left = xmonad
|
||||||
modules-center = timerDisplay spotify gitlab-pipeline player-mpv-tail time
|
modules-center = timerDisplay spotify gitlab-pipeline player-mpv-tail time polynotifications
|
||||||
modules-right = pulseaudio-control updates-arch gpuinfo filesystem memory cpu date
|
modules-right = pulseaudio-control updates-arch gpuinfo filesystem memory cpu date
|
||||||
|
|
||||||
tray-position = ${env:TRAY_POSITION:right}
|
tray-position = ${env:TRAY_POSITION:right}
|
||||||
|
@ -218,3 +218,13 @@ click-middle = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash to
|
||||||
click-left = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash next-sink
|
click-left = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash next-sink
|
||||||
scroll-up = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash up
|
scroll-up = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash up
|
||||||
scroll-down = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash down
|
scroll-down = bash ~/.config/polybar/polybar-scripts/pulseaudio-control.bash down
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[module/polynotifications]
|
||||||
|
type = custom/script
|
||||||
|
# Change the path to where you downloaded polynotifications
|
||||||
|
exec = ~/.config/polybar/polynotifications/polynotifications.sh
|
||||||
|
format = <label>
|
||||||
|
label-padding = 1
|
||||||
|
tail = true
|
||||||
|
|
1
files/.config/polybar/polynotifications
Submodule
1
files/.config/polybar/polynotifications
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit bf8ad4a5a5a1d8af7d1a392a736d353c40d03ac1
|
|
@ -1,5 +1,12 @@
|
||||||
|
{ pkgs, myConf, ... }:
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = (
|
||||||
|
pkgs.writeScriptBin "alacritty" ''
|
||||||
|
#!/bin/sh
|
||||||
|
exec nixGLIntel ${pkgs.alacritty}/bin/alacritty "$@"
|
||||||
|
''
|
||||||
|
);
|
||||||
settings = {
|
settings = {
|
||||||
window = {
|
window = {
|
||||||
padding.x = 20;
|
padding.x = 20;
|
||||||
|
@ -11,7 +18,7 @@
|
||||||
style = "Block";
|
style = "Block";
|
||||||
unfocused_hollow = true;
|
unfocused_hollow = true;
|
||||||
};
|
};
|
||||||
shell = "/bin/fish";
|
shell = "/home/leon/.nix-profile/bin/zsh";
|
||||||
mouse = {
|
mouse = {
|
||||||
double_click.threshold = 300;
|
double_click.threshold = 300;
|
||||||
triple_click.threshold = 300;
|
triple_click.threshold = 300;
|
||||||
|
@ -20,38 +27,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
background_opacity = 1;
|
background_opacity = 1;
|
||||||
fonts = {
|
font = {
|
||||||
size = 12;
|
size = 12;
|
||||||
|
#normal.family = "Iosevka";
|
||||||
normal.family = "Terminus (TTF)";
|
normal.family = "Terminus (TTF)";
|
||||||
offset.x = 0;
|
offset.x = 0;
|
||||||
offset.y = 0;
|
offset.y = 0;
|
||||||
};
|
};
|
||||||
|
colors = myConf.colors;
|
||||||
colors = {
|
|
||||||
primary = {
|
|
||||||
background = "#282828";
|
|
||||||
foreground = "#ebdbb2";
|
|
||||||
};
|
|
||||||
normal = {
|
|
||||||
black = "#282828";
|
|
||||||
red = "#cc241d";
|
|
||||||
green = "#98971a";
|
|
||||||
yellow = "#d79921";
|
|
||||||
blue = "#458588";
|
|
||||||
magenta = "#b16286";
|
|
||||||
cyan = "#689d6a";
|
|
||||||
white = "#a89984";
|
|
||||||
};
|
|
||||||
bright = {
|
|
||||||
black = "#928374";
|
|
||||||
red = "#fb4934";
|
|
||||||
green = "#b8bb26";
|
|
||||||
yellow = "#fabd2f";
|
|
||||||
blue = "#83a598";
|
|
||||||
magenta = "#d3869b";
|
|
||||||
cyan = "#8ec07c";
|
|
||||||
white = "#ebdbb2";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
482
files/nix-stuff/nixpkgs/config/deer.zsh
Normal file
482
files/nix-stuff/nixpkgs/config/deer.zsh
Normal file
|
@ -0,0 +1,482 @@
|
||||||
|
# -*- mode: shell-script -*-
|
||||||
|
# vim: set ft=zsh :
|
||||||
|
#########################################################################
|
||||||
|
# Copyright (C) 2014-2015 Wojciech Siewierski #
|
||||||
|
# #
|
||||||
|
# This program is free software: you can redistribute it and/or modify #
|
||||||
|
# it under the terms of the GNU General Public License as published by #
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or #
|
||||||
|
# (at your option) any later version. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, #
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||||
|
# GNU General Public License for more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License #
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
zstyle -s ":deer:" height DEER_HEIGHT || DEER_HEIGHT=22
|
||||||
|
|
||||||
|
|
||||||
|
typeset -Ag DEER_KEYS
|
||||||
|
function ()
|
||||||
|
{
|
||||||
|
while [ -n "$2" ]; do
|
||||||
|
DEER_KEYS[$1]=${DEER_KEYS[$1]:-$2}
|
||||||
|
shift 2
|
||||||
|
done
|
||||||
|
} down j \
|
||||||
|
page_down J \
|
||||||
|
up k \
|
||||||
|
page_up K \
|
||||||
|
enter l \
|
||||||
|
leave h \
|
||||||
|
next_parent ']' \
|
||||||
|
prev_parent '[' \
|
||||||
|
search / \
|
||||||
|
filter f \
|
||||||
|
toggle_hidden H \
|
||||||
|
quit q \
|
||||||
|
append_path a \
|
||||||
|
append_abs_path A \
|
||||||
|
insert_path i \
|
||||||
|
insert_abs_path I \
|
||||||
|
multi_insert_dwim s \
|
||||||
|
multi_insert_abs S \
|
||||||
|
chdir c \
|
||||||
|
chdir_selected C \
|
||||||
|
rifle r \
|
||||||
|
edit e \
|
||||||
|
|
||||||
|
|
||||||
|
# Select the Nth next file. Pass a negative argument for the previous file.
|
||||||
|
deer-move()
|
||||||
|
{
|
||||||
|
local FILES MOVEMENT INDEX
|
||||||
|
MOVEMENT=$1
|
||||||
|
|
||||||
|
FILES=($DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-/:t)
|
||||||
|
$DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-^/:t))
|
||||||
|
|
||||||
|
INDEX=${(k)FILES[(re)$DEER_BASENAME[$DEER_DIRNAME]]}
|
||||||
|
|
||||||
|
if (( INDEX+MOVEMENT <= 0 )); then
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME]=$FILES[1]
|
||||||
|
elif (( INDEX+MOVEMENT > $#FILES )); then
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME]=$FILES[$#FILES]
|
||||||
|
else
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME]=$FILES[$INDEX+$MOVEMENT]
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Select the first visible directory (or file if there are no
|
||||||
|
# directories) in the current directory. Useful when changing the file
|
||||||
|
# filter.
|
||||||
|
deer-refocus()
|
||||||
|
{
|
||||||
|
local TMP
|
||||||
|
TMP=($DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-/:t)
|
||||||
|
$DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-^/:t))
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME]=$TMP[1]
|
||||||
|
|
||||||
|
[ -n "$DEER_BASENAME[$DEER_DIRNAME]" ] # Return if there were any files at all.
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enter the selected directory
|
||||||
|
deer-enter()
|
||||||
|
{
|
||||||
|
# Abort if there is no file focused at all or if it is not a
|
||||||
|
# directory.
|
||||||
|
[ -n "$DEER_BASENAME[$DEER_DIRNAME]" -a \
|
||||||
|
-d "$DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]" ] || return
|
||||||
|
|
||||||
|
DEER_DIRNAME=${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]
|
||||||
|
|
||||||
|
if [ -z $DEER_BASENAME[$DEER_DIRNAME] ]; then
|
||||||
|
deer-refocus
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Move to the parent directory
|
||||||
|
deer-leave()
|
||||||
|
{
|
||||||
|
[ $DEER_DIRNAME = / ] && return
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME:h]=$DEER_DIRNAME:t
|
||||||
|
DEER_DIRNAME=$DEER_DIRNAME:h
|
||||||
|
}
|
||||||
|
|
||||||
|
# Display a given prompt, read a string and save it into $BUFFER.
|
||||||
|
deer-prompt()
|
||||||
|
{
|
||||||
|
BUFFER=""
|
||||||
|
PREDISPLAY="$1/ "
|
||||||
|
POSTDISPLAY=""
|
||||||
|
|
||||||
|
local region_highlight
|
||||||
|
region_highlight=("P0 $#1 fg=green")
|
||||||
|
zle recursive-edit
|
||||||
|
}
|
||||||
|
|
||||||
|
# Read a pattern and select the first matching file.
|
||||||
|
deer-search()
|
||||||
|
{
|
||||||
|
deer-prompt "search"
|
||||||
|
|
||||||
|
local TMP
|
||||||
|
TMP=($DEER_DIRNAME/${~BUFFER}${DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-:t))
|
||||||
|
[ -n "$TMP[1]" ] && DEER_BASENAME[$DEER_DIRNAME]=$TMP[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Read a pattern and use it as a new filter.
|
||||||
|
deer-filter()
|
||||||
|
{
|
||||||
|
deer-prompt "filter"
|
||||||
|
|
||||||
|
if [ -n "$BUFFER" ] && [[ ! $BUFFER == *\** ]]; then
|
||||||
|
BUFFER=*$BUFFER*
|
||||||
|
fi
|
||||||
|
|
||||||
|
deer-apply-filter $BUFFER || deer-apply-filter
|
||||||
|
}
|
||||||
|
|
||||||
|
deer-apply-filter()
|
||||||
|
{
|
||||||
|
DEER_FILTER[$DEER_DIRNAME]=$1
|
||||||
|
deer-refocus
|
||||||
|
}
|
||||||
|
|
||||||
|
# Draw an arrow pointing to the selected file.
|
||||||
|
deer-mark-file-list()
|
||||||
|
{
|
||||||
|
local MARKED=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
print -l -- "$@" \
|
||||||
|
| grep -Fx -B5 -A$DEER_HEIGHT -- "$MARKED" \
|
||||||
|
| perl -pe 'BEGIN{$name = shift}
|
||||||
|
if ($name."\n" eq $_) {
|
||||||
|
$_="-> $_"
|
||||||
|
} else {
|
||||||
|
$_=" $_"
|
||||||
|
}' -- "$MARKED"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Draw the file lists in the form of Miller columns.
|
||||||
|
deer-refresh()
|
||||||
|
{
|
||||||
|
local FILES PREVIEW PARENTFILES OUTPUT REL_DIRNAME
|
||||||
|
local SEPARATOR="------"
|
||||||
|
|
||||||
|
PREDISPLAY=$OLD_LBUFFER
|
||||||
|
REL_DIRNAME=${${DEER_DIRNAME%/}#$DEER_STARTDIR}/
|
||||||
|
[ -n "$DEER_STARTDIR" ] && REL_DIRNAME=${REL_DIRNAME#/}
|
||||||
|
LBUFFER=$REL_DIRNAME$DEER_BASENAME[$DEER_DIRNAME]
|
||||||
|
RBUFFER=""
|
||||||
|
local TMP_FILTER
|
||||||
|
TMP_FILTER=${DEER_FILTER[$DEER_DIRNAME]}
|
||||||
|
POSTDISPLAY=${TMP_FILTER:+ filt:$TMP_FILTER}
|
||||||
|
region_highlight=("P0 $#PREDISPLAY fg=black,bold"
|
||||||
|
"0 $#REL_DIRNAME fg=blue,bold"
|
||||||
|
"$#BUFFER $[$#BUFFER+$#POSTDISPLAY] fg=yellow,bold")
|
||||||
|
|
||||||
|
|
||||||
|
FILES=($DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-/:t)
|
||||||
|
$SEPARATOR
|
||||||
|
$DEER_DIRNAME/${~DEER_FILTER[$DEER_DIRNAME]:-'*'}(N$DEER_GLOBFLAGS-^/:t))
|
||||||
|
PARENTFILES=($DEER_DIRNAME:h/${~DEER_FILTER[$DEER_DIRNAME:h]:-'*'}(N$DEER_GLOBFLAGS-/:t))
|
||||||
|
|
||||||
|
local IFS=$'\n'
|
||||||
|
FILES=($(deer-mark-file-list "$DEER_BASENAME[$DEER_DIRNAME]" $FILES))
|
||||||
|
PARENTFILES=($(deer-mark-file-list "$DEER_DIRNAME:t" $PARENTFILES))
|
||||||
|
unset IFS
|
||||||
|
|
||||||
|
FILES=(${(F)FILES[1,$DEER_HEIGHT]})
|
||||||
|
PARENTFILES=(${(F)PARENTFILES[1,$DEER_HEIGHT]})
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] ]; then
|
||||||
|
if file $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] | grep -Fq text; then
|
||||||
|
PREVIEW="--- Preview: ---"$'\n'$(head -n$DEER_HEIGHT $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME])
|
||||||
|
|
||||||
|
# Replace '/' with '∕' (division slash, U+2215) to allow using it as a
|
||||||
|
# paste(1)/column(1) separator.
|
||||||
|
PREVIEW=${PREVIEW//\//∕}
|
||||||
|
else
|
||||||
|
PREVIEW="--- Binary file, preview unavailable ---"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# I'm really sorry about what you see below.
|
||||||
|
# It basically means: PREVIEW=(directories separator files)
|
||||||
|
PREVIEW=($DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]/${~DEER_FILTER[$DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]]:-'*'}(N$DEER_GLOBFLAGS-/:t)
|
||||||
|
$SEPARATOR
|
||||||
|
$DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]/${~DEER_FILTER[$DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]]:-'*'}(N$DEER_GLOBFLAGS-^/:t))
|
||||||
|
PREVIEW=${(F)PREVIEW[1,$DEER_HEIGHT]}
|
||||||
|
fi
|
||||||
|
|
||||||
|
OUTPUT="$(paste -d/ <(<<< $PARENTFILES \
|
||||||
|
| awk '{print substr($0,1,16)}') \
|
||||||
|
<(<<< $FILES) \
|
||||||
|
<(<<< $PREVIEW) \
|
||||||
|
| sed 's,/, / ,g' \
|
||||||
|
| column -t -s/ 2> /dev/null \
|
||||||
|
| awk -v width=$COLUMNS '{print substr($0,1,width-1)}')"
|
||||||
|
zle -M -- $OUTPUT
|
||||||
|
zle -R
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run `deer-add' with the same arguments, restore the shell state and
|
||||||
|
# then exit.
|
||||||
|
deer-restore()
|
||||||
|
{
|
||||||
|
deer-add "$@"
|
||||||
|
PREDISPLAY=""
|
||||||
|
POSTDISPLAY=""
|
||||||
|
region_highlight=()
|
||||||
|
LBUFFER=$OLD_LBUFFER
|
||||||
|
RBUFFER=$OLD_RBUFFER
|
||||||
|
zle reset-prompt
|
||||||
|
zle -M ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add the given string before or after the cursor.
|
||||||
|
deer-add()
|
||||||
|
{
|
||||||
|
case $1 in
|
||||||
|
--append)
|
||||||
|
OLD_LBUFFER+=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--insert)
|
||||||
|
OLD_RBUFFER=$2$OLD_RBUFFER
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get the quoted relative path from the absolute unquoted path.
|
||||||
|
deer-get-relative()
|
||||||
|
{
|
||||||
|
local TMP
|
||||||
|
TMP=${1:-${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]}
|
||||||
|
TMP="`python -c '
|
||||||
|
import sys, os
|
||||||
|
print(os.path.relpath(sys.argv[1], sys.argv[2]))
|
||||||
|
' $TMP ${DEER_STARTDIR:-$PWD}`"
|
||||||
|
print -R $TMP:q
|
||||||
|
}
|
||||||
|
|
||||||
|
# Tries to guess a directory to start in from the current argument.
|
||||||
|
deer-set-initial-directory()
|
||||||
|
{
|
||||||
|
autoload -U split-shell-arguments modify-current-argument
|
||||||
|
local REPLY REPLY2 reply
|
||||||
|
local DIRECTORY
|
||||||
|
|
||||||
|
((--CURSOR))
|
||||||
|
split-shell-arguments
|
||||||
|
((++CURSOR))
|
||||||
|
|
||||||
|
# Find the longest existing directory path in the current argument.
|
||||||
|
DEER_STARTDIR=${(Q)${${reply[$REPLY]%%[[:space:]]#}:a}%/}
|
||||||
|
while [ -n "$DEER_STARTDIR" -a \
|
||||||
|
! -d "$DEER_STARTDIR" ]; do
|
||||||
|
DEER_STARTDIR=${DEER_STARTDIR%/*}
|
||||||
|
done
|
||||||
|
|
||||||
|
DEER_DIRNAME=${DEER_STARTDIR:-$PWD}
|
||||||
|
}
|
||||||
|
|
||||||
|
# The main entry function.
|
||||||
|
deer-launch()
|
||||||
|
{
|
||||||
|
emulate -L zsh
|
||||||
|
setopt extended_glob
|
||||||
|
local DEER_DIRNAME DEER_STARTDIR DEER_GLOBFLAGS
|
||||||
|
local -A DEER_FILTER DEER_BASENAME
|
||||||
|
local REPLY OLD_LBUFFER OLD_RBUFFER
|
||||||
|
|
||||||
|
local GREP_OPTIONS
|
||||||
|
GREP_OPTIONS=""
|
||||||
|
|
||||||
|
OLD_LBUFFER=$LBUFFER
|
||||||
|
OLD_RBUFFER=$RBUFFER
|
||||||
|
|
||||||
|
deer-set-initial-directory
|
||||||
|
|
||||||
|
DEER_GLOBFLAGS=""
|
||||||
|
|
||||||
|
if [ -n "$NUMERIC" ]; then
|
||||||
|
for i in {1..$NUMERIC}; do
|
||||||
|
deer-leave
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# Don't change cwd but initialize the variables.
|
||||||
|
deer-leave
|
||||||
|
deer-enter
|
||||||
|
fi
|
||||||
|
|
||||||
|
deer-refresh
|
||||||
|
while read -k; do
|
||||||
|
case $REPLY in
|
||||||
|
# Movement
|
||||||
|
$DEER_KEYS[up])
|
||||||
|
deer-move -1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[page_up])
|
||||||
|
deer-move -5
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[down])
|
||||||
|
deer-move 1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[page_down])
|
||||||
|
deer-move 5
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[enter])
|
||||||
|
deer-enter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[leave])
|
||||||
|
deer-leave
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[next_parent])
|
||||||
|
deer-leave
|
||||||
|
deer-move 1
|
||||||
|
deer-enter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[prev_parent])
|
||||||
|
deer-leave
|
||||||
|
deer-move -1
|
||||||
|
deer-enter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
# Search
|
||||||
|
$DEER_KEYS[search])
|
||||||
|
deer-search
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
# Filter
|
||||||
|
$DEER_KEYS[filter])
|
||||||
|
deer-filter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[toggle_hidden])
|
||||||
|
if [ -z $DEER_GLOBFLAGS ]; then
|
||||||
|
DEER_GLOBFLAGS="D" # show hidden files
|
||||||
|
else
|
||||||
|
DEER_GLOBFLAGS=""
|
||||||
|
fi
|
||||||
|
# make sure the focus is on a visible file
|
||||||
|
DEER_BASENAME[$DEER_DIRNAME]=
|
||||||
|
deer-leave
|
||||||
|
deer-enter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
# Quit
|
||||||
|
$DEER_KEYS[quit])
|
||||||
|
deer-restore
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
# Insert the path and quit.
|
||||||
|
$DEER_KEYS[append_path])
|
||||||
|
deer-restore --append "`deer-get-relative` "
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[append_abs_path])
|
||||||
|
deer-restore --append "${${DEER_DIRNAME%/}:q}/${DEER_BASENAME[$DEER_DIRNAME]:q} "
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[insert_path])
|
||||||
|
deer-restore --insert " `deer-get-relative`"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[insert_abs_path])
|
||||||
|
deer-restore --insert " ${${DEER_DIRNAME%/}:q}/${DEER_BASENAME[$DEER_DIRNAME]:q}"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
# Insert the path and don't quit yet.
|
||||||
|
$DEER_KEYS[multi_insert_dwim])
|
||||||
|
if [ "$OLD_LBUFFER[-1]" = "/" ]; then
|
||||||
|
OLD_LBUFFER+="{"
|
||||||
|
fi
|
||||||
|
# replacement used to insert ',' instead of '{' as a separator in {foo,bar,...} lists
|
||||||
|
deer-add --append "`deer-get-relative`"${${OLD_LBUFFER[-1]/\{/,}:- }
|
||||||
|
deer-move 1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
# Insert the absolute path and don't quit yet.
|
||||||
|
$DEER_KEYS[multi_insert_abs])
|
||||||
|
deer-add --append " ${${DEER_DIRNAME%/}:q}/${DEER_BASENAME[$DEER_DIRNAME]:q}"
|
||||||
|
deer-move 1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
# Quit and change the shell's current directory to the selected one.
|
||||||
|
$DEER_KEYS[chdir])
|
||||||
|
deer-leave
|
||||||
|
;&
|
||||||
|
$DEER_KEYS[chdir_selected])
|
||||||
|
if [[ -d $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] && \
|
||||||
|
-x $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] ]]; then
|
||||||
|
cd -- $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]
|
||||||
|
deer-restore
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$DEER_KEYS[edit])
|
||||||
|
if [[ -f $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] ]]; then
|
||||||
|
"${EDITOR:-vim}" $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
# See rifle(1) manpage (included with ranger(1)).
|
||||||
|
$DEER_KEYS[rifle])
|
||||||
|
if [[ -f $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME] ]]; then
|
||||||
|
rifle $DEER_DIRNAME/$DEER_BASENAME[$DEER_DIRNAME]
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
# Arrow keys
|
||||||
|
$'\e')
|
||||||
|
read -k
|
||||||
|
case $REPLY in
|
||||||
|
'[')
|
||||||
|
read -k
|
||||||
|
case $REPLY in
|
||||||
|
'A')
|
||||||
|
deer-move -1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
'B')
|
||||||
|
deer-move 1
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
'C')
|
||||||
|
deer-enter
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
'D')
|
||||||
|
deer-leave
|
||||||
|
deer-refresh
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if zle; then
|
||||||
|
deer-launch
|
||||||
|
else
|
||||||
|
deer()
|
||||||
|
{
|
||||||
|
deer-launch "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
~
|
42
files/nix-stuff/nixpkgs/config/prompt.zsh
Normal file
42
files/nix-stuff/nixpkgs/config/prompt.zsh
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
local __bright_cyan="#8ec07c"
|
||||||
|
local __bright_white="#ebdbb2"
|
||||||
|
local __bright_green="#b8bb26"
|
||||||
|
|
||||||
|
dir() {
|
||||||
|
local CUTOFF=3
|
||||||
|
local IFS=/
|
||||||
|
local my_path=($(print -P '%~'))
|
||||||
|
local p
|
||||||
|
for p in $my_path; do
|
||||||
|
printf %s "${s}${p[0,$CUTOFF]}"
|
||||||
|
local s=/
|
||||||
|
done
|
||||||
|
printf '%s\n' "${p:$CUTOFF}"
|
||||||
|
}
|
||||||
|
|
||||||
|
git_status() {
|
||||||
|
local BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\s*\(.*\)/\1/')
|
||||||
|
|
||||||
|
if [ ! -z $BRANCH ]; then
|
||||||
|
echo -n "(%F{$__bright_cyan}$BRANCH"
|
||||||
|
[ ! -z "$(git status --short)" ] && echo -n "%F{$__bright_white}*%f)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _my_prompt() {
|
||||||
|
|
||||||
|
echo -n "╭───"
|
||||||
|
echo -n "%F{$__bright_cyan}$USER"
|
||||||
|
echo -n "%F{$__bright_white} in"
|
||||||
|
echo -n "%F{$__bright_green} $(dir)"
|
||||||
|
echo -n "%F{$__bright_white} $(git_status)"
|
||||||
|
echo
|
||||||
|
# %3{stuff%} tell's zsh that the characters are printed as 3 chars wide
|
||||||
|
echo -n "%3{╰─λ%} "
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setopt prompt_subst
|
||||||
|
autoload -U colors && colors
|
||||||
|
PS1='$(_my_prompt)'
|
117
files/nix-stuff/nixpkgs/config/zsh.nix
Normal file
117
files/nix-stuff/nixpkgs/config/zsh.nix
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
{ myConf, pkgs ? import <nixpkgs> }:
|
||||||
|
let
|
||||||
|
makeAbbrs = with builtins; abbrs: concatStringsSep "\n"
|
||||||
|
(
|
||||||
|
attrValues
|
||||||
|
(mapAttrs (k: v: ''abbr --session ${k}="${v}" >/dev/null 2>&1'') abbrs)
|
||||||
|
);
|
||||||
|
|
||||||
|
abbrs = makeAbbrs {
|
||||||
|
gc = "git commit -m";
|
||||||
|
gp = "git push";
|
||||||
|
gaa = "git add --all";
|
||||||
|
gs = "git status";
|
||||||
|
cxmonad = "cd ~/.xmonad && nvim ~/.xmonad/lib/Config.hs && cd -";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
defaultKeymap = "viins";
|
||||||
|
dotDir = "~/.config";
|
||||||
|
history = {
|
||||||
|
save = 10000;
|
||||||
|
share = true;
|
||||||
|
ignoreDups = true;
|
||||||
|
ignoreSpace = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
localVariables = {
|
||||||
|
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "bg=${myConf.colors.accentDark}"; # why does this not work D:
|
||||||
|
};
|
||||||
|
|
||||||
|
initExtra = ''
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
autoload -Uz promptinit
|
||||||
|
promptinit
|
||||||
|
|
||||||
|
zstyle ":completion:*" menu select
|
||||||
|
zstyle ':completion::complete:*' gain-privileges 1
|
||||||
|
compinit
|
||||||
|
_comp_options+=(globdots)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function man() {
|
||||||
|
env \
|
||||||
|
LESS_TERMCAP_md=$(tput bold; tput setaf 4) \
|
||||||
|
LESS_TERMCAP_me=$(tput sgr0) \
|
||||||
|
LESS_TERMCAP_mb=$(tput blink) \
|
||||||
|
LESS_TERMCAP_us=$(tput setaf 2) \
|
||||||
|
LESS_TERMCAP_ue=$(tput sgr0) \
|
||||||
|
LESS_TERMCAP_so=$(tput smso) \
|
||||||
|
LESS_TERMCAP_se=$(tput rmso) \
|
||||||
|
PAGER="''${commands[less]:-$PAGER}" \
|
||||||
|
man "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
#source ~/nixpkgs/config/deer.zsh
|
||||||
|
#zle -N deer
|
||||||
|
#bindkey '\ek' deer
|
||||||
|
|
||||||
|
${abbrs}
|
||||||
|
${builtins.readFile ./prompt.zsh}
|
||||||
|
'';
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
{
|
||||||
|
name = "zsh-autosuggestions";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zsh-users";
|
||||||
|
repo = "zsh-autosuggestions";
|
||||||
|
rev = "v0.6.4";
|
||||||
|
sha256 = "0h52p2waggzfshvy1wvhj4hf06fmzd44bv6j18k3l9rcx6aixzn6";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "history-substring-search";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zsh-users";
|
||||||
|
repo = "zsh-history-substring-search";
|
||||||
|
rev = "v1.0.2";
|
||||||
|
sha256 = "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "zsh-abbr";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "olets";
|
||||||
|
repo = "zsh-abbr";
|
||||||
|
rev = "v3.3.3";
|
||||||
|
sha256 = "0aln7ashadbgharfn4slhimbw624ai82p4yizsxwvz70y4dv0wpg";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# look at this https://github.com/zdharma/fast-syntax-highlighting
|
||||||
|
name = "zsh-syntax-highlighting";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zsh-users";
|
||||||
|
repo = "zsh-syntax-highlighting";
|
||||||
|
rev = "0.7.1";
|
||||||
|
sha256 = "03r6hpb5fy4yaakqm3lbf4xcvd408r44jgpv4lnzl9asp4sb9qc0";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "fast-syntax-highlighting";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zdharma";
|
||||||
|
repo = "fast-syntax-highlighting";
|
||||||
|
rev = "v1.55";
|
||||||
|
sha256 = "0h7f27gz586xxw7cc0wyiv3bx0x3qih2wwh05ad85bh2h834ar8d";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,8 +1,24 @@
|
||||||
|
# https://nixos.wiki/wiki/Wrappers_vs._Dotfiles
|
||||||
|
# https://nixos.org/nixos/manual/index.html#sec-writing-modules
|
||||||
|
|
||||||
|
# do this to change to fork
|
||||||
|
# nix-channel --add https://github.com/ElKowar/home-manager/archive/alacritty-package-option.tar.gz home-manager
|
||||||
|
# nix-channel --update
|
||||||
|
# nix-env -u home-manager
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
elkowar_local = import ./local/default.nix {};
|
elkowar_local = import ./local/default.nix {};
|
||||||
|
myConf = import ./myConfig.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
elkowar_local.bashtop
|
elkowar_local.bashtop
|
||||||
pkgs.htop
|
pkgs.htop
|
||||||
|
@ -19,9 +35,10 @@ in
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
#alacritty = import ./config/alacritty.nix; # <- https://github.com/guibou/nixGL
|
alacritty = import ./config/alacritty.nix { inherit pkgs; inherit myConf; }; # <- https://github.com/guibou/nixGL
|
||||||
#firefox = import ./config/firefox.nix;
|
#firefox = import ./config/firefox.nix;
|
||||||
feh = import ./config/feh.nix;
|
feh = import ./config/feh.nix;
|
||||||
|
zsh = import ./config/zsh.nix { inherit pkgs; inherit myConf; };
|
||||||
lsd = {
|
lsd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableAliases = true;
|
enableAliases = true;
|
||||||
|
@ -54,12 +71,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
|
||||||
kdeconnect.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
home.username = "leon";
|
home.username = "leon";
|
||||||
home.homeDirectory = "/home/leon";
|
home.homeDirectory = "/home/leon";
|
||||||
|
|
||||||
|
|
9
files/nix-stuff/nixpkgs/links.md
Normal file
9
files/nix-stuff/nixpkgs/links.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
writers:
|
||||||
|
https://nixos.wiki/wiki/Nix-writers
|
||||||
|
|
||||||
|
variable replacement:
|
||||||
|
builtins.readFile (pkgs.substituteAll { src = ./nixhello.txt; name = "Major Tom"; })
|
||||||
|
that will replace all @name@ in the file with Major Tom
|
||||||
|
https://nixos.org/nixpkgs/manual/#fun-substituteAll
|
||||||
|
|
||||||
|
|
32
files/nix-stuff/nixpkgs/myConfig.nix
Normal file
32
files/nix-stuff/nixpkgs/myConfig.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
monospaceFont = "Terminus (TTF)";
|
||||||
|
colors = rec {
|
||||||
|
accent = light.cyan;
|
||||||
|
accentDark = normal.cyan;
|
||||||
|
|
||||||
|
primary = {
|
||||||
|
background = "#282828";
|
||||||
|
foreground = "#ebdbb2";
|
||||||
|
};
|
||||||
|
normal = {
|
||||||
|
black = "#282828";
|
||||||
|
red = "#cc241d";
|
||||||
|
green = "#98971a";
|
||||||
|
yellow = "#d79921";
|
||||||
|
blue = "#458588";
|
||||||
|
magenta = "#b16286";
|
||||||
|
cyan = "#689d6a";
|
||||||
|
white = "#a89984";
|
||||||
|
};
|
||||||
|
light = {
|
||||||
|
black = "#928374";
|
||||||
|
red = "#fb4934";
|
||||||
|
green = "#b8bb26";
|
||||||
|
yellow = "#fabd2f";
|
||||||
|
blue = "#83a598";
|
||||||
|
magenta = "#d3869b";
|
||||||
|
cyan = "#8ec07c";
|
||||||
|
white = "#ebdbb2";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs = [pkgs.ytop pkgs.pscircle pkgs.asciiquarium pkgs.cmatrix ];
|
buildInputs = [ pkgs.ytop pkgs.pscircle pkgs.asciiquarium pkgs.cmatrix ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue