forked from pub-solar/os
Initial PubSolarOS commit
This commit is contained in:
parent
57291aa029
commit
ddcf369f41
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ up
|
|||
hosts/up-*
|
||||
.direnv
|
||||
doc/index.html
|
||||
tags
|
||||
|
|
14
flake.nix
14
flake.nix
|
@ -21,9 +21,17 @@
|
|||
|
||||
pkgs.url = "path:./pkgs";
|
||||
pkgs.inputs.nixpkgs.follows = "nixos";
|
||||
|
||||
# PubSolarOS additions
|
||||
|
||||
nix-dram.url = "github:dramforever/nix-dram";
|
||||
|
||||
# This is a fix so that the neovim-flake dependency of neovim-nightly doesn't shit itself
|
||||
nixpkgs.url = "nixpkgs";
|
||||
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, pkgs, digga, nixos, ci-agent, home, nixos-hardware, nur, ... }:
|
||||
outputs = inputs@{ self, pkgs, digga, nixos, ci-agent, home, nixos-hardware, nix-dram, nur, neovim-nightly, ... }:
|
||||
digga.lib.mkFlake {
|
||||
inherit self inputs;
|
||||
|
||||
|
@ -36,6 +44,8 @@
|
|||
./pkgs/default.nix
|
||||
pkgs.overlay # for `srcs`
|
||||
nur.overlay
|
||||
nix-dram.overlay
|
||||
neovim-nightly.overlay
|
||||
];
|
||||
};
|
||||
latest = { };
|
||||
|
@ -72,6 +82,8 @@
|
|||
profiles = [ ./profiles ./users ];
|
||||
suites = { profiles, users, ... }: with profiles; rec {
|
||||
base = [ core users.nixos users.root ];
|
||||
pubsolaros = [ core base-user users.root ];
|
||||
anonymous = [ pubsolaros users.nixos ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
53
modules/audio/.config/vimpc/vimpcrc
Normal file
53
modules/audio/.config/vimpc/vimpcrc
Normal file
|
@ -0,0 +1,53 @@
|
|||
echo Parsing config file
|
||||
|
||||
" Set the default tab
|
||||
set window playlist
|
||||
|
||||
" Set the windows to show at startup
|
||||
set windows playlist,library,browse,help
|
||||
|
||||
" Stop playing music when we quit
|
||||
"set stoponquit
|
||||
|
||||
" A silly example of an alias
|
||||
"alias smiths deleteall; findartist! The Smiths; play 1
|
||||
|
||||
" Example maps
|
||||
" map the F key to change to the browse window, go to the first line and enter search mode
|
||||
"map F :browse<C-M>gg/
|
||||
" map @ to switch to add next, add a song, then change back
|
||||
"map @ :set add next<C-M>a:set add end<C-M>
|
||||
|
||||
map i <Up>
|
||||
map j <Left>
|
||||
map k <Down>
|
||||
|
||||
map h i
|
||||
|
||||
map q ZQ
|
||||
map Q ZQ
|
||||
|
||||
map <space>l :tabnext<CR>
|
||||
map <space>j :tabprevious<CR>
|
||||
|
||||
" Turn consume on when we connect
|
||||
"consume on
|
||||
|
||||
" Ensure that the database is up to date each connect
|
||||
update
|
||||
|
||||
" A more complex example, When we start vimpc
|
||||
" - clear the playlist
|
||||
" - add all songs
|
||||
" - shuffle
|
||||
" - start playling
|
||||
"deleteall
|
||||
"addall
|
||||
"shuffle
|
||||
"play 1
|
||||
|
||||
" Color the statusline and tabs
|
||||
" highlight status blackbg
|
||||
" highlight tab blackbg
|
||||
|
||||
echo Config File Complete
|
72
modules/audio/default.nix
Normal file
72
modules/audio/default.nix
Normal file
|
@ -0,0 +1,72 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.audio;
|
||||
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
||||
in
|
||||
{
|
||||
options.pub-solar.audio = {
|
||||
enable = mkEnableOption "Life in highs and lows";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
mu
|
||||
pavucontrol
|
||||
pa_applet
|
||||
playerctl
|
||||
# Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?)
|
||||
pulseaudio
|
||||
# pulseeffects for microphone noise filtering
|
||||
pulseeffects-pw
|
||||
vimpc
|
||||
];
|
||||
xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc;
|
||||
systemd.user.services.pulseeffects = import ./pulseeffects.service.nix pkgs;
|
||||
};
|
||||
|
||||
# Enable sound using pipewire-pulse
|
||||
services.pipewire = {
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
|
||||
config.pipewire-pulse = builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json);
|
||||
|
||||
# Bluetooth configuration for pipewire
|
||||
media-session.config.bluez-monitor.rules = [
|
||||
{
|
||||
# Matches all cards
|
||||
matches = [{ "device.name" = "~bluez_card.*"; }];
|
||||
actions = {
|
||||
"update-props" = {
|
||||
"bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
|
||||
# mSBC is not expected to work on all headset + adapter combinations.
|
||||
"bluez5.msbc-support" = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
# Matches all sources
|
||||
{ "node.name" = "~bluez_input.*"; }
|
||||
# Matches all outputs
|
||||
{ "node.name" = "~bluez_output.*"; }
|
||||
];
|
||||
actions = {
|
||||
"node.pause-on-idle" = false;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Enable bluetooth
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
|
||||
# Enable audio server & client
|
||||
services.mopidy = import ./mopidy.nix pkgs;
|
||||
};
|
||||
}
|
19
modules/audio/mopidy.nix
Normal file
19
modules/audio/mopidy.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
pkgs: {
|
||||
enable = true;
|
||||
extensionPackages = with pkgs; [
|
||||
mopidy-spotify
|
||||
mopidy-mpd
|
||||
mopidy-soundcloud
|
||||
mopidy-youtube
|
||||
mopidy-local
|
||||
mopidy-jellyfin
|
||||
];
|
||||
|
||||
configuration = ''
|
||||
[mpd]
|
||||
hostname = ::
|
||||
|
||||
[audio]
|
||||
output = pulsesink server=127.0.0.1:4713
|
||||
'';
|
||||
}
|
42
modules/audio/pipewire-pulse.conf.json
Normal file
42
modules/audio/pipewire-pulse.conf.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"context.properties": {},
|
||||
"context.spa-libs": {
|
||||
"audio.convert.*": "audioconvert/libspa-audioconvert",
|
||||
"support.*": "support/libspa-support"
|
||||
},
|
||||
"context.modules": [
|
||||
{
|
||||
"name": "libpipewire-module-rtkit",
|
||||
"args": {},
|
||||
"flags": [
|
||||
"ifexists",
|
||||
"nofail"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "libpipewire-module-protocol-native"
|
||||
},
|
||||
{
|
||||
"name": "libpipewire-module-client-node"
|
||||
},
|
||||
{
|
||||
"name": "libpipewire-module-adapter"
|
||||
},
|
||||
{
|
||||
"name": "libpipewire-module-metadata"
|
||||
},
|
||||
{
|
||||
"name": "libpipewire-module-protocol-pulse",
|
||||
"args": {
|
||||
"server.address": [
|
||||
"unix:native",
|
||||
"tcp:4713"
|
||||
],
|
||||
"vm.overrides": {
|
||||
"pulse.min.quantum": "1024/48000"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"stream.properties": {}
|
||||
}
|
8
modules/audio/pulseeffects.service.nix
Normal file
8
modules/audio/pulseeffects.service.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
pkgs:
|
||||
{
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "com.github.wwmm.pulseeffects";
|
||||
ExecStart = "${pkgs.pulseeffects-pw}/bin/pulseeffects --gapplication-service";
|
||||
};
|
||||
}
|
6
modules/compat/default.nix
Normal file
6
modules/compat/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ config, pkgs, lib, ... }: with lib; {
|
||||
# Both things below are for
|
||||
# https://github.com/NixOS/nixpkgs/issues/124215
|
||||
documentation.info.enable = lib.mkForce false;
|
||||
nix.sandboxPaths = [ "/bin/sh=${pkgs.bash}/bin/sh" ];
|
||||
}
|
42
modules/crypto/default.nix
Normal file
42
modules/crypto/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.crypto;
|
||||
in
|
||||
{
|
||||
options.pub-solar.crypto = {
|
||||
enable = mkEnableOption "Life in private";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.udev.packages = [ pkgs.yubikey-personalization ];
|
||||
services.dbus.packages = [ pkgs.gcr ];
|
||||
services.pcscd.enable = true;
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
systemd.user.services.polkit-gnome-authentication-agent = import ./polkit-gnome-authentication-agent.service.nix pkgs;
|
||||
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
verbose = true;
|
||||
};
|
||||
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
gnome3.seahorse
|
||||
keepassxc
|
||||
libsecret
|
||||
qMasterPassword
|
||||
restic
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
16
modules/crypto/polkit-gnome-authentication-agent.service.nix
Normal file
16
modules/crypto/polkit-gnome-authentication-agent.service.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Legacy polkit authentication agent for GNOME";
|
||||
Documentation = [ "https://gitlab.freedesktop.org/polkit/polkit/" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
24
modules/devops/default.nix
Normal file
24
modules/devops/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.devops;
|
||||
in
|
||||
{
|
||||
options.pub-solar.devops = {
|
||||
enable = mkEnableOption "Life automated";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
drone-cli
|
||||
nmap
|
||||
python38Packages.ansible
|
||||
restic
|
||||
shellcheck
|
||||
terraform_0_15
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
22
modules/docker/default.nix
Normal file
22
modules/docker/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.docker;
|
||||
in
|
||||
{
|
||||
options.pub-solar.docker = {
|
||||
enable = mkEnableOption "Life in metal boxes";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.docker.enable = true;
|
||||
users.users = with pkgs; pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
||||
extraGroups = [ "docker" ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker-compose
|
||||
];
|
||||
};
|
||||
}
|
29
modules/email/default.nix
Normal file
29
modules/email/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.email;
|
||||
in
|
||||
{
|
||||
options.pub-solar.email = {
|
||||
enable = mkEnableOption "Life in headers";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
w3m
|
||||
urlscan
|
||||
neomutt
|
||||
offlineimap
|
||||
msmtp
|
||||
mailto-mutt
|
||||
];
|
||||
|
||||
programs.offlineimap = {
|
||||
enable = true;
|
||||
pythonFile = builtins.readFile ./offlineimap.py;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
1
modules/email/offlineimap.nix
Normal file
1
modules/email/offlineimap.nix
Normal file
|
@ -0,0 +1 @@
|
|||
|
9
modules/email/offlineimap.py
Normal file
9
modules/email/offlineimap.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
#! /usr/bin/env python2
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def get_env(key):
|
||||
return os.getenv(key)
|
||||
|
||||
def get_secret(*attributes):
|
||||
return subprocess.check_output(["secret-tool", "lookup"] + list(attributes))
|
25
modules/gaming/default.nix
Normal file
25
modules/gaming/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.gaming;
|
||||
in
|
||||
{
|
||||
options.pub-solar.gaming = {
|
||||
enable = mkEnableOption "Life in shooters";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.steam.enable = true;
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
steam = pkgs.steam.override { };
|
||||
};
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
playonlinux
|
||||
godot
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
1
modules/gaming/steam.nix
Normal file
1
modules/gaming/steam.nix
Normal file
|
@ -0,0 +1 @@
|
|||
|
62
modules/graphical/.Xdefaults
Normal file
62
modules/graphical/.Xdefaults
Normal file
|
@ -0,0 +1,62 @@
|
|||
Xft.dpi: 96
|
||||
Xft.antialias: true
|
||||
Xft.hinting: true
|
||||
Xft.rgba: rgb
|
||||
Xft.autohint: false
|
||||
Xft.hintstyle: hintslight
|
||||
Xft.lcdfilter: lcddefault
|
||||
|
||||
! Base16 Burn
|
||||
! Scheme: Benjamin Bädorf
|
||||
|
||||
#define base00 #1a181a
|
||||
#define base01 #2d2a2e
|
||||
#define base02 #303030
|
||||
#define base03 #949494
|
||||
#define base04 #d3d1d4
|
||||
#define base05 #e3e1e4
|
||||
#define base06 #303030
|
||||
#define base07 #ff5f5f
|
||||
#define base08 #f85e84
|
||||
#define base09 #df5923
|
||||
#define base0A #e5c463
|
||||
#define base0B #9ecd6f
|
||||
#define base0C #ef9062
|
||||
#define base0D #7accd7
|
||||
#define base0E #ab9df2
|
||||
#define base0F #d70000
|
||||
|
||||
*foreground: base05
|
||||
#ifdef background_opacity
|
||||
*background: [background_opacity]base00
|
||||
#else
|
||||
*background: base00
|
||||
#endif
|
||||
*cursorColor: base05
|
||||
|
||||
*color0: base00
|
||||
*color1: base08
|
||||
*color2: base0B
|
||||
*color3: base0A
|
||||
*color4: base0D
|
||||
*color5: base0E
|
||||
*color6: base0C
|
||||
*color7: base05
|
||||
|
||||
*color8: base03
|
||||
*color9: base08
|
||||
*color10: base0B
|
||||
*color11: base0A
|
||||
*color12: base0D
|
||||
*color13: base0E
|
||||
*color14: base0C
|
||||
*color15: base07
|
||||
|
||||
! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt),
|
||||
! use 'shell' template to set these if necessary
|
||||
*color16: base09
|
||||
*color17: base0F
|
||||
*color18: base01
|
||||
*color19: base02
|
||||
*color20: base04
|
||||
*color21: base06
|
142
modules/graphical/alacritty.nix
Normal file
142
modules/graphical/alacritty.nix
Normal file
|
@ -0,0 +1,142 @@
|
|||
{
|
||||
env = {
|
||||
TERM = "xterm-256color";
|
||||
};
|
||||
|
||||
window = {
|
||||
# Window dimensions in character columns and lines
|
||||
# Falls back to size specified by window manager if set to 0x0.
|
||||
# (changes require restart)
|
||||
dimensions = {
|
||||
columns = 80;
|
||||
lines = 24;
|
||||
};
|
||||
|
||||
padding = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
|
||||
decorations = "full";
|
||||
};
|
||||
|
||||
scrolling = {
|
||||
# How many lines of scrollback to keep,
|
||||
# "0" will disable scrolling.
|
||||
history = 100000;
|
||||
|
||||
# Number of lines the viewport will move for every line
|
||||
# scrolled when scrollback is enabled (history > 0).
|
||||
multiplier = 3;
|
||||
};
|
||||
|
||||
# When true, bold text is drawn using the bright variant of colors.
|
||||
draw_bold_text_with_bright_colors = true;
|
||||
|
||||
font = {
|
||||
# The normal (roman) font face to use.
|
||||
normal = {
|
||||
family = "Hack"; # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style = "Regular";
|
||||
};
|
||||
|
||||
# The bold font face
|
||||
bold = {
|
||||
family = "Hack"; # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style = "Bold";
|
||||
};
|
||||
|
||||
# The italic font face
|
||||
italic = {
|
||||
family = "Hack"; # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style = "Italic";
|
||||
};
|
||||
|
||||
size = 18.0;
|
||||
|
||||
offset = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
|
||||
glyph_offset = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
|
||||
use_thin_strokes = true;
|
||||
};
|
||||
|
||||
key_bindings = [
|
||||
{ key = "V"; mods = "Control|Alt"; action = "Paste"; }
|
||||
{ key = "C"; mods = "Control|Alt"; action = "Copy"; }
|
||||
{ key = "Paste"; action = "Paste"; }
|
||||
{ key = "Copy"; action = "Copy"; }
|
||||
{ key = "Q"; mods = "Command"; action = "Quit"; }
|
||||
{ key = "W"; mods = "Command"; action = "Quit"; }
|
||||
{ key = "Insert"; mods = "Shift"; action = "PasteSelection"; }
|
||||
{ key = "Key0"; mods = "Control"; action = "ResetFontSize"; }
|
||||
{ key = "Equals"; mods = "Control"; action = "IncreaseFontSize"; }
|
||||
{ key = "PageUp"; mods = "Shift"; action = "ScrollPageUp"; }
|
||||
{ key = "PageDown"; mods = "Shift"; action = "ScrollPageDown"; }
|
||||
{ key = "Minus"; mods = "Control"; action = "DecreaseFontSize"; }
|
||||
{ key = "H"; mode = "Vi|~Search"; action = "ScrollToBottom"; }
|
||||
{ key = "H"; mode = "Vi|~Search"; action = "ToggleViMode"; }
|
||||
{ key = "I"; mode = "Vi|~Search"; action = "Up"; }
|
||||
{ key = "K"; mode = "Vi|~Search"; action = "Down"; }
|
||||
{ key = "J"; mode = "Vi|~Search"; action = "Left"; }
|
||||
{ key = "L"; mode = "Vi|~Search"; action = "Right"; }
|
||||
];
|
||||
|
||||
# Base16 Burn 256 - alacritty color config
|
||||
# Benjamin Bädorf
|
||||
colors = {
|
||||
# Default colors
|
||||
primary = {
|
||||
background = "0x1a181a";
|
||||
foreground = "0xe3e1e4";
|
||||
};
|
||||
|
||||
# Colors the cursor will use if `custom_cursor_colors` is true
|
||||
cursor = {
|
||||
text = "0x1a181a";
|
||||
cursor = "0xe3e1e4";
|
||||
};
|
||||
|
||||
# Normal colors
|
||||
normal = {
|
||||
black = "0x1a181a";
|
||||
red = "0xf85e84";
|
||||
green = "0x9ecd6f";
|
||||
yellow = "0xe5c463";
|
||||
blue = "0x7accd7";
|
||||
magenta = "0xab9df2";
|
||||
cyan = "0xef9062";
|
||||
white = "0xe3e1e4";
|
||||
};
|
||||
|
||||
# Bright colors
|
||||
bright = {
|
||||
black = "0x949494";
|
||||
red = "0xf85e84";
|
||||
green = "0x9ecd6f";
|
||||
yellow = "0xe5c463";
|
||||
blue = "0x7accd7";
|
||||
magenta = "0xab9df2";
|
||||
cyan = "0xef9062";
|
||||
white = "0xff5f5f";
|
||||
};
|
||||
|
||||
indexed_colors = [
|
||||
{ index = 16; color = "0xdf5923"; }
|
||||
{ index = 17; color = "0xd70000"; }
|
||||
{ index = 18; color = "0x2d2a2e"; }
|
||||
{ index = 19; color = "0x303030"; }
|
||||
{ index = 20; color = "0xd3d1d4"; }
|
||||
{ index = 21; color = "0x303030"; }
|
||||
];
|
||||
};
|
||||
}
|
149
modules/graphical/default.nix
Normal file
149
modules/graphical/default.nix
Normal file
|
@ -0,0 +1,149 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.graphical;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
recursiveMerge = attrList:
|
||||
let f = attrPath:
|
||||
zipAttrsWith (n: values:
|
||||
if tail values == [ ]
|
||||
then head values
|
||||
else if all isList values
|
||||
then unique (concatLists values)
|
||||
else if all isAttrs values
|
||||
then f (attrPath ++ [ n ]) values
|
||||
else last values
|
||||
);
|
||||
in f [ ] attrList;
|
||||
in
|
||||
{
|
||||
options.pub-solar.graphical = {
|
||||
enable = mkEnableOption "Life in color";
|
||||
alacritty = {
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hardware.opengl.enable = true;
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
gtk-engine-murrine
|
||||
gtk_engines
|
||||
gsettings-desktop-schemas
|
||||
|
||||
matcha-gtk-theme
|
||||
papirus-maia-icon-theme
|
||||
|
||||
glib
|
||||
];
|
||||
etc = {
|
||||
"xdg/PubSolar.conf".text = ''
|
||||
[Qt]
|
||||
style=GTK+
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
restart = false;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${pkgs.sway-service}/bin/sway-service";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
qt5 = {
|
||||
enable = true;
|
||||
platformTheme = "gtk2";
|
||||
style = "gtk2";
|
||||
};
|
||||
|
||||
# Required for running Gnome apps outside the Gnome DE, see https://nixos.wiki/wiki/GNOME#Running_GNOME_programs_outside_of_GNOME
|
||||
programs.dconf.enable = true;
|
||||
services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ];
|
||||
# Enable Sushi, a quick previewer for nautilus
|
||||
services.gnome.sushi.enable = true;
|
||||
# Enable GVfs, a userspace virtual filesystem
|
||||
services.gvfs.enable = true;
|
||||
|
||||
fonts.enableDefaultFonts = true;
|
||||
fonts.fonts = with pkgs; [
|
||||
corefonts
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
google-fonts
|
||||
lato
|
||||
montserrat
|
||||
nerdfonts
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
open-sans
|
||||
powerline-fonts
|
||||
source-sans-pro
|
||||
];
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
alacritty
|
||||
chromium
|
||||
firefox
|
||||
|
||||
flameshot
|
||||
libnotify
|
||||
gnome3.adwaita-icon-theme
|
||||
gnome3.nautilus
|
||||
|
||||
wine
|
||||
|
||||
toggle-kbd-layout
|
||||
|
||||
wcwd
|
||||
|
||||
vlc
|
||||
|
||||
gimp
|
||||
];
|
||||
|
||||
xdg.configFile."alacritty/alacritty.yml" = {
|
||||
source = yamlFormat.generate "alacritty.yml" (recursiveMerge [ (import ./alacritty.nix) cfg.alacritty.settings ]);
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
font.name = "Lato";
|
||||
iconTheme = {
|
||||
package = pkgs.papirus-maia-icon-theme;
|
||||
name = "Papirus-Adapta-Nokto-Maia";
|
||||
};
|
||||
theme = {
|
||||
package = pkgs.matcha-gtk-theme;
|
||||
name = "Matcha-dark-aliz";
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
gtk-xft-antialias = "1";
|
||||
gtk-xft-hinting = "1";
|
||||
gtk-xft-hintstyle = "hintfull";
|
||||
gtk-xft-rgba = "rgb";
|
||||
gtk-application-prefer-dark-theme = "true";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# Fix KeepassXC rendering issue
|
||||
# https://github.com/void-linux/void-packages/issues/23517
|
||||
systemd.user.sessionVariables.QT_AUTO_SCREEN_SCALE_FACTOR = "0";
|
||||
|
||||
xresources.extraConfig = builtins.readFile ./.Xdefaults;
|
||||
|
||||
systemd.user.services.network-manager-applet = import ./network-manager-applet.service.nix pkgs;
|
||||
};
|
||||
};
|
||||
}
|
16
modules/graphical/network-manager-applet.service.nix
Normal file
16
modules/graphical/network-manager-applet.service.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Lightweight Wayland notification daemon";
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
|
@ -1 +1,21 @@
|
|||
[ ]
|
||||
[
|
||||
./compat
|
||||
./user
|
||||
./x-os
|
||||
./sway
|
||||
./graphical
|
||||
./docker
|
||||
./audio
|
||||
./email
|
||||
./crypto
|
||||
./nextcloud
|
||||
./gaming
|
||||
./virtualisation
|
||||
./social
|
||||
./devops
|
||||
./terminal-life
|
||||
./server
|
||||
./printing
|
||||
./office
|
||||
./uhk
|
||||
]
|
||||
|
|
17
modules/nextcloud/default.nix
Normal file
17
modules/nextcloud/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.nextcloud;
|
||||
in
|
||||
{
|
||||
options.pub-solar.nextcloud = {
|
||||
enable = mkEnableOption "Life in sync";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
systemd.user.services.nextcloud-client = import ./nextcloud.service.nix pkgs;
|
||||
};
|
||||
};
|
||||
}
|
21
modules/nextcloud/nextcloud.service.nix
Normal file
21
modules/nextcloud/nextcloud.service.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Nextcloud Client";
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloud --background";
|
||||
ExecReload = "/run/current-system/sw/bin/kill -HUP $MAINPID";
|
||||
KillMode = "process";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
26
modules/office/default.nix
Normal file
26
modules/office/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.office;
|
||||
in
|
||||
{
|
||||
options.pub-solar.office = {
|
||||
enable = mkEnableOption "Install office programs, also enables printing server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
pub-solar.printing.enable = true;
|
||||
|
||||
# Gnome PDF viewer
|
||||
programs.evince.enable = true;
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
libreoffice-fresh
|
||||
gnome3.simple-scan
|
||||
# Tools like pdfunite
|
||||
poppler_utils
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
34
modules/printing/default.nix
Normal file
34
modules/printing/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.printing;
|
||||
in
|
||||
{
|
||||
options.pub-solar.printing = {
|
||||
enable = mkEnableOption "CUPSSSss";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.avahi.enable = true;
|
||||
services.avahi.nssmdns = true;
|
||||
services.avahi.publish.enable = true;
|
||||
services.avahi.publish.userServices = true;
|
||||
services.printing.enable = true;
|
||||
services.printing.browsing = true;
|
||||
services.printing.listenAddresses = [ "localhost:631" ];
|
||||
services.printing.allowFrom = [ "all" ];
|
||||
services.printing.defaultShared = false;
|
||||
services.printing.drivers = [
|
||||
pkgs.gutenprint
|
||||
pkgs.brgenml1lpr
|
||||
pkgs.brgenml1cupswrapper
|
||||
pkgs.brlaser
|
||||
pkgs.cups-brother-hl3140cw
|
||||
];
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
brscan4.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
19
modules/server/default.nix
Normal file
19
modules/server/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.server;
|
||||
in
|
||||
{
|
||||
options.pub-solar.server = {
|
||||
enable = mkEnableOption "Enable server options like sshd";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
permitRootLogin = "no";
|
||||
passwordAuthentication = false;
|
||||
};
|
||||
};
|
||||
}
|
23
modules/social/default.nix
Normal file
23
modules/social/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.social;
|
||||
in
|
||||
{
|
||||
options.pub-solar.social = {
|
||||
enable = mkEnableOption "Life with others";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
#mySignalDesktop
|
||||
signal-desktop
|
||||
tdesktop
|
||||
element-desktop
|
||||
irssi
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
212
modules/sway/config/config
Normal file
212
modules/sway/config/config
Normal file
|
@ -0,0 +1,212 @@
|
|||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left j
|
||||
set $down k
|
||||
set $up i
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term alacritty
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
#set $menu dmenu_path | dmenu | xargs swaymsg exec bemenu-run --no-overlap
|
||||
|
||||
default_border pixel 1
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
output * bg ~/.config/wallpaper.jpg fill
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Shift+Return exec sh -c '$term --working-directory $(wcwd)'
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Ctrl+r reload
|
||||
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
|
||||
|
||||
# Workspace names
|
||||
# to display names or symbols instead of plain workspace numbers you can use
|
||||
# something like: set $ws1 1:mail
|
||||
# set $ws2 2:
|
||||
set $ws1 1
|
||||
set $ws2 2
|
||||
set $ws3 3
|
||||
set $ws4 4
|
||||
set $ws5 5
|
||||
set $ws6 6
|
||||
set $ws7 7
|
||||
set $ws8 8
|
||||
set $ws9 9
|
||||
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Ctrl+1 move container to workspace $ws1
|
||||
bindsym $mod+Ctrl+2 move container to workspace $ws2
|
||||
bindsym $mod+Ctrl+3 move container to workspace $ws3
|
||||
bindsym $mod+Ctrl+4 move container to workspace $ws4
|
||||
bindsym $mod+Ctrl+5 move container to workspace $ws5
|
||||
bindsym $mod+Ctrl+6 move container to workspace $ws6
|
||||
bindsym $mod+Ctrl+7 move container to workspace $ws7
|
||||
bindsym $mod+Ctrl+8 move container to workspace $ws8
|
||||
bindsym $mod+Ctrl+9 move container to workspace $ws9
|
||||
# Move focused container to workspace and move focus with it
|
||||
bindsym $mod+Shift+1 move container to workspace 1; workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace 2; workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace 3; workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace 4; workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace 5; workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace 6; workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace 7; workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace 8; workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
|
||||
#navigate workspaces next / previous
|
||||
bindsym $mod+Ctrl+Right workspace next
|
||||
bindsym $mod+Ctrl+Left workspace prev
|
||||
|
||||
# workspace back and forth (with/without active container)
|
||||
workspace_auto_back_and_forth yes
|
||||
bindsym $mod+b workspace back_and_forth
|
||||
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
|
||||
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# Configure border style <normal|1pixel|pixel xx|none|pixel>
|
||||
default_border pixel 1
|
||||
default_floating_border normal
|
||||
|
||||
# Hide borders
|
||||
hide_edge_borders none
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font xft:Hack 16
|
||||
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+h splith; exec notify-send 'tile horizontally'
|
||||
bindsym $mod+v splitv; exec notify-send 'tile vertically'
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+t focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
bindsym $mod+d focus child
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 10px
|
||||
bindsym Down resize grow height 10px
|
||||
bindsym Up resize shrink height 10px
|
||||
bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
include ~/.config/sway/config.d/*
|
72
modules/sway/config/config.d/applications.conf
Normal file
72
modules/sway/config/config.d/applications.conf
Normal file
|
@ -0,0 +1,72 @@
|
|||
# switch to workspace with urgent window automatically
|
||||
for_window [urgent=latest] focus
|
||||
|
||||
for_window [app_id="keepassxc"] floating disable
|
||||
assign [app_id="keepassxc"] $ws8
|
||||
|
||||
for_window [app_id="virt-manager"] floating disable
|
||||
assign [app_id="virt-manager"] $ws9
|
||||
|
||||
assign [instance="element"] $ws4
|
||||
assign [app_id="Signal"] $ws4
|
||||
assign [app_id="telegramdesktop"] $ws4
|
||||
|
||||
# Launcher
|
||||
for_window [app_id="launcher" title="Alacritty"] floating enable, border pixel 10, sticky enable
|
||||
|
||||
# Floating menus
|
||||
for_window [app_id="pavucontrol"] floating enable
|
||||
for_window [app_id="blueman-manager"] floating enable
|
||||
|
||||
# Open specific applications in floating mode
|
||||
for_window [title="alsamixer"] floating enable border pixel 1
|
||||
for_window [class="Calamares"] floating enable border normal
|
||||
for_window [class="Clipgrab"] floating enable
|
||||
for_window [title="File Transfer*"] floating enable
|
||||
for_window [class="Galculator"] floating enable border pixel 1
|
||||
for_window [class="GParted"] floating enable border normal
|
||||
for_window [title="i3_help"] floating enable sticky enable border normal
|
||||
for_window [class="Lightdm-gtk-greeter-settings"] floating enable
|
||||
for_window [class="Lxappearance"] floating enable sticky enable border normal
|
||||
for_window [class="Manjaro-hello"] floating enable
|
||||
for_window [class="Manjaro Settings Manager"] floating enable border normal
|
||||
for_window [title="MuseScore: Play Panel"] floating enable
|
||||
for_window [class="Nitrogen"] floating enable sticky enable border normal
|
||||
for_window [class="Oblogout"] fullscreen enable
|
||||
for_window [class="octopi"] floating enable
|
||||
for_window [title="About Pale Moon"] floating enable
|
||||
for_window [class="Pamac-manager"] floating enable
|
||||
for_window [class="Pavucontrol"] floating enable
|
||||
for_window [class="qt5ct"] floating enable sticky enable border normal
|
||||
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
|
||||
for_window [class="Simple-scan"] floating enable border normal
|
||||
for_window [class="(?i)System-config-printer.py"] floating enable border normal
|
||||
for_window [class="Skype"] floating enable border normal
|
||||
for_window [class="Thus"] floating enable border normal
|
||||
for_window [class="Timeset-gui"] floating enable border normal
|
||||
for_window [class="(?i)virtualbox"] floating enable border normal
|
||||
for_window [class="Xfburn"] floating enable
|
||||
for_window [class="^VirtualBox Machine$" title="Running"] floating disable
|
||||
for_window [class="^rdesktop" title="rdesktop"] floating disable
|
||||
|
||||
# firefox floating menus
|
||||
for_window [window_role="pop-up"] floating enable
|
||||
for_window [window_role="task_dialog"] floating enable
|
||||
for_window [window_role="pop-up"] floating enable
|
||||
for_window [window_role="bubble"] floating enable
|
||||
for_window [window_role="task_dialog"] floating enable
|
||||
for_window [window_role="Preferences"] floating enable
|
||||
for_window [window_type="dialog"] floating enable
|
||||
for_window [window_type="menu"] floating enable
|
||||
for_window [title="About Mozilla Firefox"] floating enabled
|
||||
for_window [title="Password Required - Mozilla Firefox"] floating enabled
|
||||
for_window [title="Firefox — Sharing Indicator"] floating enabled
|
||||
for_window [title="Extension: (Open in Browser)*"] floating enabled
|
||||
|
||||
# qMasterPassword floating menu
|
||||
for_window [title="qMasterPassword"] focus
|
||||
for_window [title="qMasterPassword"] floating enable
|
||||
|
||||
# vimpc floating instance
|
||||
for_window [app_id="mu_vimpc"] focus
|
||||
for_window [app_id="mu_vimpc"] floating enable, border pixel 10, sticky enable
|
19
modules/sway/config/config.d/colorscheme.conf
Normal file
19
modules/sway/config/config.d/colorscheme.conf
Normal file
|
@ -0,0 +1,19 @@
|
|||
## Base16 Burn
|
||||
# Author: Benjamin Bädorf
|
||||
|
||||
set $base00 #1a181a
|
||||
set $base01 #2d2a2e
|
||||
set $base02 #303030
|
||||
set $base03 #949494
|
||||
set $base04 #d3d1d4
|
||||
set $base05 #e3e1e4
|
||||
set $base06 #303030
|
||||
set $base07 #ff5f5f
|
||||
set $base08 #f85e84
|
||||
set $base09 #df5923
|
||||
set $base0A #e5c463
|
||||
set $base0B #9ecd6f
|
||||
set $base0C #ef9062
|
||||
set $base0D #7accd7
|
||||
set $base0E #ab9df2
|
||||
set $base0F #d70000
|
49
modules/sway/config/config.d/custom-keybindings.conf
Normal file
49
modules/sway/config/config.d/custom-keybindings.conf
Normal file
|
@ -0,0 +1,49 @@
|
|||
# launch categorized menu
|
||||
bindsym $mod+z exec --no-startup-id morc_menu
|
||||
|
||||
# switch keyboard input language
|
||||
bindsym $mod+tab exec toggle-kbd-layout
|
||||
|
||||
################################################################################################
|
||||
## sound-section - ##
|
||||
################################################################################################
|
||||
|
||||
bindsym $mod+Ctrl+m exec pavucontrol
|
||||
|
||||
################################################################################################
|
||||
|
||||
# Quickstart application shortcuts
|
||||
bindsym $mod+F1 exec qMasterPassword
|
||||
bindsym $mod+F2 exec firefox
|
||||
bindsym $mod+F3 exec $term -e vifm
|
||||
bindsym $mod+Shift+F3 exec gksu $term -e vifm
|
||||
bindsym $mod+F4 exec nautilus -w
|
||||
bindsym $mod+Shift+F4 exec signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland
|
||||
bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config'
|
||||
bindsym $mod+Shift+m exec mu
|
||||
bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf
|
||||
|
||||
# Screenshofts
|
||||
bindsym $mod+Ctrl+p exec grim -g "$(slurp -d -b \#ffffff11)" ~/Pictures/Screenshots/$(date +%Y%m%d_%Hh%Mm%Ss)_grim.png
|
||||
bindsym $mod+Shift+p exec grim ~/Pictures/Screenshots/$(date +%Y%m%d_%Hh%Mm%Ss)_grim.png
|
||||
bindsym $mod+Ctrl+f exec "( pkill flameshot || true && flameshot & ) && ( sleep 0.5s && flameshot gui )"
|
||||
|
||||
# Launcher
|
||||
set $menu exec alacritty --class launcher -e env TERMINAL_COMMAND="alacritty -e" sway-launcher
|
||||
bindsym $mod+Space exec $menu
|
||||
|
||||
# Set shut down, restart and locking features
|
||||
set $mode_system (l)ock, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
|
||||
bindsym $mod+0 mode "$mode_system"
|
||||
mode "$mode_system" {
|
||||
bindsym l exec swaylock-bg, mode "default"
|
||||
bindsym e exec systemctl --user stop graphical-session.target, mode "default"
|
||||
bindsym s exec systemctl suspend, mode "default"
|
||||
bindsym h exec systemctl hibernate, mode "default"
|
||||
bindsym r exec systemctl reboot, mode "default"
|
||||
bindsym Shift+s exec systemctl poweroff, mode "default"
|
||||
|
||||
# exit system mode: "Enter" or "Escape"
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
53
modules/sway/config/config.d/gaps.conf
Normal file
53
modules/sway/config/config.d/gaps.conf
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Set inner/outer gaps
|
||||
gaps inner 10
|
||||
gaps outer -5
|
||||
|
||||
# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size.
|
||||
# gaps inner|outer current|all set|plus|minus <px>
|
||||
# gaps inner all set 10
|
||||
# gaps outer all plus 5
|
||||
|
||||
# Smart gaps (gaps used if only more than one container on the workspace)
|
||||
smart_gaps on
|
||||
|
||||
# Smart borders (draw borders around container only if it is not the only container on this workspace)
|
||||
# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
|
||||
smart_borders on
|
||||
|
||||
# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
|
||||
set $mode_gaps Gaps: (o) outer, (i) inner
|
||||
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
bindsym $mod+Shift+g mode "$mode_gaps"
|
||||
|
||||
mode "$mode_gaps" {
|
||||
bindsym o mode "$mode_gaps_outer"
|
||||
bindsym i mode "$mode_gaps_inner"
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
mode "$mode_gaps_inner" {
|
||||
bindsym plus gaps inner current plus 5
|
||||
bindsym minus gaps inner current minus 5
|
||||
bindsym 0 gaps inner current set 0
|
||||
|
||||
bindsym Shift+plus gaps inner all plus 5
|
||||
bindsym Shift+minus gaps inner all minus 5
|
||||
bindsym Shift+0 gaps inner all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
mode "$mode_gaps_outer" {
|
||||
bindsym plus gaps outer current plus 5
|
||||
bindsym minus gaps outer current minus 5
|
||||
bindsym 0 gaps outer current set 0
|
||||
|
||||
bindsym Shift+plus gaps outer all plus 5
|
||||
bindsym Shift+minus gaps outer all minus 5
|
||||
bindsym Shift+0 gaps outer all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
6
modules/sway/config/config.d/systemd.conf
Normal file
6
modules/sway/config/config.d/systemd.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Note that the systemctl commands must be run synchronously and can't be split into
|
||||
# three exec statements, since otherwise the session target may be started before
|
||||
# systemctl import-environment is complete, and services that require certain variables
|
||||
# will fail to run.
|
||||
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
||||
exec "systemctl --user import-environment; systemctl --user start sway-session.target; dbus-update-activation-environment WAYLAND_DISPLAY"
|
13
modules/sway/config/config.d/theme.conf
Normal file
13
modules/sway/config/config.d/theme.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Border BG Text Ind Child Border
|
||||
client.focused $base00 $base01 $base07 $base0D $base07
|
||||
client.focused_inactive $base00 $base01 $base07 $base03 $base00
|
||||
client.unfocused $base00 $base00 $base04 $base06 $base00
|
||||
client.urgent $base00 $base0F $base00 $base08 $base00
|
||||
|
||||
client.background $base00
|
||||
|
||||
# Read the gtk settings from gtk setting.ini and pass them to gsettings
|
||||
exec_always import-gtk-settings \
|
||||
gtk-theme:gtk-theme-name \
|
||||
icon-theme:gtk-icon-theme-name \
|
||||
cursor-theme:gtk-cursor-theme-name
|
91
modules/sway/default.nix
Normal file
91
modules/sway/default.nix
Normal file
|
@ -0,0 +1,91 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.sway;
|
||||
in
|
||||
{
|
||||
options.pub-solar.sway = {
|
||||
enable = mkEnableOption "Life in boxes";
|
||||
};
|
||||
options.pub-solar.sway.v4l2loopback.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "WebCam streaming tool";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf (cfg.v4l2loopback.enable) {
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||
boot.kernelModules = [ "v4l2loopback" ];
|
||||
boot.extraModprobeConfig = ''
|
||||
options v4l2loopback exclusive_caps=1 devices=3
|
||||
'';
|
||||
})
|
||||
|
||||
({
|
||||
environment.systemPackages = with pkgs; [
|
||||
linuxPackages.v4l2loopback
|
||||
];
|
||||
|
||||
programs.sway.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
|
||||
gtkUsePortal = true;
|
||||
};
|
||||
|
||||
services.pipewire.enable = true;
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = with pkgs; [
|
||||
sway
|
||||
grim
|
||||
kanshi
|
||||
mako
|
||||
slurp
|
||||
swayidle
|
||||
swaylock
|
||||
swaybg
|
||||
xwayland
|
||||
|
||||
libappindicator-gtk3
|
||||
|
||||
wl-clipboard
|
||||
wf-recorder
|
||||
brightnessctl
|
||||
gammastep
|
||||
geoclue2
|
||||
xsettingsd
|
||||
ydotool
|
||||
|
||||
swaylock-bg
|
||||
sway-launcher
|
||||
sway-service
|
||||
import-gtk-settings
|
||||
s
|
||||
wcwd
|
||||
];
|
||||
|
||||
programs.waybar.enable = true;
|
||||
#programs.waybar.systemd.enable = true;
|
||||
|
||||
systemd.user.services.mako = import ./mako.service.nix pkgs;
|
||||
systemd.user.services.sway = import ./sway.service.nix pkgs;
|
||||
systemd.user.services.swayidle = import ./swayidle.service.nix pkgs;
|
||||
systemd.user.services.xsettingsd = import ./xsettingsd.service.nix pkgs;
|
||||
systemd.user.services.waybar = import ./waybar.service.nix pkgs;
|
||||
systemd.user.targets.sway-session = import ./sway-session.target.nix pkgs;
|
||||
|
||||
xdg.configFile."sway/config".source = ./config/config;
|
||||
xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf;
|
||||
xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf;
|
||||
xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf;
|
||||
xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf;
|
||||
xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf;
|
||||
xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
18
modules/sway/gammastep.service.nix
Normal file
18
modules/sway/gammastep.service.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "set color temperature of display according to time of day";
|
||||
Documentation = [ "man:gammastep(1)" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.gammastep}/bin/gammastep -l geoclue2 -m wayland -v";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
19
modules/sway/libinput-gestures.service.nix
Normal file
19
modules/sway/libinput-gestures.service.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Actions gestures on your touchpad using libinput";
|
||||
Documentation = [ "https://github.com/bulletmark/libinput-gestures" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.libinput-gestures}/bin/libinput-gestures";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1";
|
||||
TimeoutStopSec = "10";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
20
modules/sway/mako.service.nix
Normal file
20
modules/sway/mako.service.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Lightweight Wayland notification daemon";
|
||||
Documentation = [ "man:mako(1)" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = "${pkgs.mako}/bin/mako";
|
||||
ExecReload = "${pkgs.mako}/bin/makoctl reload";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
10
modules/sway/sway-session.target.nix
Normal file
10
modules/sway/sway-session.target.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "sway compositor session";
|
||||
Documentation = [ "man:systemd.special(7)" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
}
|
18
modules/sway/sway.service.nix
Normal file
18
modules/sway/sway.service.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "sway - SirCmpwn's Wayland window manager";
|
||||
Documentation = [ "man:sway(5)" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.sway}/bin/sway";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1";
|
||||
TimeoutStopSec = "10";
|
||||
ExecStopPost = "${pkgs.systemd}/bin/systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
|
||||
};
|
||||
}
|
22
modules/sway/swayidle.service.nix
Normal file
22
modules/sway/swayidle.service.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Idle manager for Wayland";
|
||||
Documentation = [ "man:swayidle(1)" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 600 'swaylock-bg' \
|
||||
timeout 900 'swaymsg "output * dpms off"' \
|
||||
resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep 'swaylock-bg'
|
||||
'';
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
20
modules/sway/waybar.service.nix
Normal file
20
modules/sway/waybar.service.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
||||
Documentation = "https://github.com/Alexays/Waybar/wiki/";
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "graphical-session-pre.target" "network-online.target" ];
|
||||
Wants = [ "graphical-session-pre.target" "network-online.target" "blueman-applet.service" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "fr.arouillard.waybar";
|
||||
ExecStart = "${pkgs.waybar}/bin/waybar";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
19
modules/sway/xsettingsd.service.nix
Normal file
19
modules/sway/xsettingsd.service.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "X Settings Daemon";
|
||||
Documentation = [ "https://github.com/derat/xsettingsd/wiki/Installation" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment = [ "WAYLAND_DISPLAY" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd";
|
||||
ExecStop = "/run/current-system/sw/bin/env pkill xsettingsd";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
19
modules/sway/ydotool.service.nix
Normal file
19
modules/sway/ydotool.service.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
pkgs:
|
||||
{
|
||||
Unit = {
|
||||
Description = "ydotool - Generic command-line automation tool (no X!)";
|
||||
Documentation = [ "https://github.com/ReimuNotMoe/ydotool" ];
|
||||
BindsTo = [ "sway-session.target" ];
|
||||
After = [ "sway-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.ydotool}/bin/ydotoold";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1";
|
||||
TimeoutStopSec = "10";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
}
|
44
modules/terminal-life/default.nix
Normal file
44
modules/terminal-life/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.terminal-life;
|
||||
in
|
||||
{
|
||||
options.pub-solar.terminal-life = {
|
||||
enable = mkEnableOption "Life in black and white";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.command-not-found.enable = false;
|
||||
|
||||
# Needed to get zsh completion for system packages (e.g. systemd).
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
|
||||
services.lorri.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
screen
|
||||
];
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
ag
|
||||
ack
|
||||
bat
|
||||
exa
|
||||
gh
|
||||
powerline
|
||||
vifm
|
||||
watson
|
||||
nnn
|
||||
fd
|
||||
direnv
|
||||
];
|
||||
|
||||
programs.neovim = import ./nvim { inherit config; inherit pkgs; };
|
||||
programs.fzf = import ./fzf { inherit config; inherit pkgs; };
|
||||
programs.zsh = import ./zsh { inherit config; inherit pkgs; };
|
||||
};
|
||||
};
|
||||
}
|
11
modules/terminal-life/fzf/default.nix
Normal file
11
modules/terminal-life/fzf/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
enable = true;
|
||||
defaultCommand = "fd --hidden --type f --exclude .git";
|
||||
defaultOptions = [
|
||||
"--color=bg+:#2d2a2e,bg:#1a181a,spinner:#ef9062,hl:#7accd7"
|
||||
"--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062"
|
||||
"--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7"
|
||||
];
|
||||
enableZshIntegration = true;
|
||||
}
|
20
modules/terminal-life/nvim/clipboard.vim
Normal file
20
modules/terminal-life/nvim/clipboard.vim
Normal file
|
@ -0,0 +1,20 @@
|
|||
" Wayland clipboard provider that strips carriage returns (GTK3 issue).
|
||||
" This is needed because currently there's an issue where GTK3 applications on
|
||||
" Wayland contain carriage returns at the end of the lines (this is a root
|
||||
" issue that needs to be fixed).
|
||||
let g:clipboard = {
|
||||
\ 'name': 'wayland-strip-carriage',
|
||||
\ 'copy': {
|
||||
\ '+': 'wl-copy --foreground --type text/plain',
|
||||
\ '*': 'wl-copy --foreground --type text/plain --primary',
|
||||
\ },
|
||||
\ 'paste': {
|
||||
\ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')},
|
||||
\ '*': {-> systemlist('wl-paste --no-newline --primary | tr -d "\r"')},
|
||||
\ },
|
||||
\ 'cache_enabled': 1,
|
||||
\ }
|
||||
|
||||
" Copy filenames
|
||||
nnor <leader>yfp :let @+=expand("%:p")<CR> " Mnemonic: Yank File path
|
||||
nnor <leader>yfn :let @+=expand("%")<CR> " Mnemonic: Yank File name
|
142
modules/terminal-life/nvim/default.nix
Normal file
142
modules/terminal-life/nvim/default.nix
Normal file
|
@ -0,0 +1,142 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
||||
|
||||
sonokai = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "sonokai";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "sainnhe";
|
||||
repo = "sonokai";
|
||||
rev = "51e7ee8b13f9c2e4eae33f8d745eaa1f320b0ae6";
|
||||
sha256 = "0svqr6dnpk2p5qhb6j0rllns8f0f4886wxpx69wgazjx84bx728i";
|
||||
};
|
||||
};
|
||||
suda = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "suda";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lambdalisue";
|
||||
repo = "suda.vim";
|
||||
rev = "fbb138f5090c3db4dabeba15326397a09df6b73b";
|
||||
sha256 = "ztZ5UPd2y4Mkore/QLfMCwjM0Qy4eWCOw535NzDSfgY=";
|
||||
};
|
||||
};
|
||||
workspace = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "vim-workspace";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "thaerkh";
|
||||
repo = "vim-workspace";
|
||||
rev = "faa835406990171bbbeff9254303dad49bad17cb";
|
||||
sha256 = "w6CcFcIplwUVcvx54rbTwThBxus1k7yHot2TpdNQ61M=";
|
||||
};
|
||||
};
|
||||
beautify = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "vim-beautify";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zeekay";
|
||||
repo = "vim-beautify";
|
||||
rev = "e0691483927dc5a0c051433602397419f9628623";
|
||||
sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ=";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
package = pkgs.neovim-nightly;
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
withPython3 = true;
|
||||
|
||||
extraConfig = builtins.concatStringsSep "\n" [
|
||||
''
|
||||
" Persistent undo
|
||||
set undofile
|
||||
set undodir=${xdg.cacheHome}/nvim/undo
|
||||
|
||||
set backupdir=${xdg.dataHome}/nvim/backup
|
||||
set directory=${xdg.dataHome}/nvim/swap/
|
||||
''
|
||||
(builtins.readFile ./init.vim)
|
||||
(builtins.readFile ./plugins.vim)
|
||||
(builtins.readFile ./clipboard.vim)
|
||||
(builtins.readFile ./ui.vim)
|
||||
(builtins.readFile ./quickfixopenall.vim)
|
||||
(builtins.readFile ./lsp.vim)
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
nodejs
|
||||
code-minimap
|
||||
nodePackages.bash-language-server
|
||||
nodePackages.dockerfile-language-server-nodejs
|
||||
nodePackages.svelte-language-server
|
||||
nodePackages.typescript-language-server
|
||||
nodePackages.typescript
|
||||
nodePackages.vim-language-server
|
||||
nodePackages.vue-language-server
|
||||
nodePackages.yaml-language-server
|
||||
nodePackages.vscode-json-languageserver-bin
|
||||
nodePackages.vscode-html-languageserver-bin
|
||||
nodePackages.vscode-css-languageserver-bin
|
||||
python3Full
|
||||
python-language-server
|
||||
solargraph
|
||||
rust-analyzer
|
||||
ctags
|
||||
ccls
|
||||
rnix-lsp
|
||||
terraform-ls
|
||||
];
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
nvim-lspconfig
|
||||
lsp_extensions-nvim
|
||||
completion-nvim
|
||||
|
||||
suda
|
||||
ack-vim
|
||||
syntastic
|
||||
airline
|
||||
workspace
|
||||
editorconfig-vim
|
||||
vim-vinegar
|
||||
vim-gutentags
|
||||
minimap-vim
|
||||
nnn-vim
|
||||
|
||||
sonokai
|
||||
|
||||
fugitive
|
||||
vim-gitgutter
|
||||
vimagit
|
||||
|
||||
vim-highlightedyank
|
||||
fzf-vim
|
||||
fzfWrapper
|
||||
|
||||
beautify
|
||||
vim-surround
|
||||
|
||||
vim-sensible
|
||||
vim-bufkill
|
||||
|
||||
ansible-vim
|
||||
emmet-vim
|
||||
rust-vim
|
||||
vim-go
|
||||
vim-vue
|
||||
vim-javascript
|
||||
vim-json
|
||||
vim-markdown
|
||||
yats-vim
|
||||
vim-ruby
|
||||
vim-toml
|
||||
vim-nix
|
||||
];
|
||||
}
|
143
modules/terminal-life/nvim/init.vim
Normal file
143
modules/terminal-life/nvim/init.vim
Normal file
|
@ -0,0 +1,143 @@
|
|||
set nocompatible " be iMproved, required
|
||||
filetype indent plugin on " required
|
||||
|
||||
set modeline
|
||||
set modelines=1
|
||||
set nowrap
|
||||
|
||||
set viminfo='100,<100,s20 " vim file history
|
||||
|
||||
set hidden
|
||||
|
||||
set expandtab
|
||||
set shiftwidth=2
|
||||
set number
|
||||
set relativenumber
|
||||
|
||||
set undolevels=1000
|
||||
set undoreload=10000
|
||||
|
||||
set updatetime=300
|
||||
|
||||
let mapleader = " "
|
||||
|
||||
nmap <c-s> :w<CR>
|
||||
imap <c-s> <Esc>:w<CR>
|
||||
vmap <c-s> <Esc><c-s>gv
|
||||
|
||||
noremap <leader>y "+y
|
||||
noremap <leader>p "+p
|
||||
|
||||
noremap i <Up>
|
||||
noremap j <Left>
|
||||
noremap k <Down>
|
||||
noremap h i
|
||||
|
||||
vnoremap K L
|
||||
vnoremap I H
|
||||
vnoremap H I
|
||||
|
||||
nnoremap K L
|
||||
nnoremap I H
|
||||
nnoremap H I
|
||||
|
||||
map <c-w>i :wincmd k<CR>
|
||||
map <c-w>j :wincmd h<CR>
|
||||
map <c-w>k :wincmd j<CR>
|
||||
map <c-w>l :wincmd l<CR>
|
||||
|
||||
map <c-w>I :wincmd K<CR>
|
||||
map <c-w>J :wincmd H<CR>
|
||||
map <c-w>K :wincmd J<CR>
|
||||
map <c-w>L :wincmd L<CR>
|
||||
|
||||
" replay macro for each line of a visual selection
|
||||
xnoremap @q :normal @q<CR>
|
||||
xnoremap @@ :normal @@<CR>
|
||||
|
||||
" reselect and re-yank any text that is pasted in visual mode
|
||||
xnoremap p pgvy
|
||||
|
||||
" Escape overwrite
|
||||
inoremap jj <Esc>
|
||||
|
||||
" Open new buffer
|
||||
nmap <leader>T :enew<cr>
|
||||
|
||||
" Move to the next buffer
|
||||
nmap <leader>l :bnext<CR>
|
||||
|
||||
" Move to the previous buffer
|
||||
nmap <leader>j :bprevious<CR>
|
||||
|
||||
" Close the current buffer and move to the previous one
|
||||
" This replicates the idea of closing a tab
|
||||
nmap <leader>q :bp <BAR> bd #<CR>
|
||||
|
||||
" Show all open buffers and their status
|
||||
nmap <leader>bl :ls<CR>
|
||||
|
||||
" Mapping selecting mappings
|
||||
nmap <leader><tab> <plug>(fzf-maps-n)
|
||||
xmap <leader><tab> <plug>(fzf-maps-x)
|
||||
omap <leader><tab> <plug>(fzf-maps-o)
|
||||
|
||||
nmap <c-p> :Files<CR>
|
||||
imap <c-p> <ESC>:Files<CR>
|
||||
|
||||
" Insert mode completion
|
||||
imap <c-x><c-k> <plug>(fzf-complete-word)
|
||||
imap <c-x><c-f> <plug>(fzf-complete-path)
|
||||
imap <c-x><c-j> <plug>(fzf-complete-file)
|
||||
imap <c-x><c-l> <plug>(fzf-complete-line)
|
||||
|
||||
" Clear quickfix shortcut
|
||||
nmap <Leader>c :ccl<CR>
|
||||
|
||||
" netrw
|
||||
let g:netrw_fastbrowse=0
|
||||
|
||||
" fzf with file preview
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
||||
"command! -bang -nargs=? -complete=dir Files
|
||||
" \ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': '--preview "' . "grep -Pzo '.*See docs/COPYRIGHT.rdoc for more details(.*\n)*' {}" . '"'}), <bang>0)
|
||||
|
||||
" Auto-FMT rust code on save
|
||||
let g:rustfmt_autosave = 1
|
||||
|
||||
" Indenting in html template tags
|
||||
let g:html_indent_style1 = "inc"
|
||||
|
||||
" yank highlight duration
|
||||
let g:highlightedyank_highlight_duration = 200
|
||||
|
||||
" Markdown options
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
|
||||
" Haskell options
|
||||
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
||||
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
||||
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
||||
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
||||
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
||||
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
||||
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
||||
|
||||
" Emmet
|
||||
let g:user_emmet_leader_key='<c-n>'
|
||||
|
||||
" Minimap settings
|
||||
let g:minimap_auto_start = 1
|
||||
|
||||
" Ack
|
||||
if executable('ag')
|
||||
let g:ackprg = 'ag --vimgrep'
|
||||
endif
|
||||
|
||||
" Remember cursor position
|
||||
" Vim jumps to the last position when reopening a file
|
||||
if has("autocmd")
|
||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
endif
|
||||
|
116
modules/terminal-life/nvim/lsp.vim
Normal file
116
modules/terminal-life/nvim/lsp.vim
Normal file
|
@ -0,0 +1,116 @@
|
|||
" Set completeopt to have a better completion experience
|
||||
" :help completeopt
|
||||
" menuone: popup even when there's only one match
|
||||
" noinsert: Do not insert text until a selection is made
|
||||
" noselect: Do not select, force user to select one from the menu
|
||||
set completeopt=menuone,noinsert,noselect
|
||||
|
||||
" Avoid showing extra messages when using completion
|
||||
set shortmess+=c
|
||||
|
||||
" Configure neovim 5 experimental LSPs
|
||||
" https://github.com/neovim/nvim-lspconfig
|
||||
" https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
|
||||
" https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/_config/plugin/nvim_lsp.lua
|
||||
lua <<EOF
|
||||
local nvim_lsp = require('lspconfig')
|
||||
-- Attach `completion-nvim` to the buffer.
|
||||
local function lsp_setup()
|
||||
require('completion').on_attach()
|
||||
end
|
||||
|
||||
for lsp_key, lsp_settings in pairs({
|
||||
'bashls', ------------------------------- Bash
|
||||
'ccls', --------------------------------- C / C++ / Objective-C
|
||||
'cssls', -------------------------------- CSS / SCSS / LESS
|
||||
'dockerls', ----------------------------- Docker
|
||||
['gopls'] = { --------------------------- Go
|
||||
['settings'] = {
|
||||
['gopls'] = {
|
||||
['analyses'] = {
|
||||
['unusedparams'] = true,
|
||||
},
|
||||
['staticcheck'] = true
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
'html', --------------------------------- HTML
|
||||
['jdtls'] = { --------------------------- Java
|
||||
['root_dir'] = nvim_lsp.util.root_pattern('.git', 'pom.xml', 'build.xml'),
|
||||
['init_options'] = {
|
||||
['jvm_args'] = {['java.format.settings.url'] = vim.fn.stdpath('config')..'/eclipse-formatter.xml'},
|
||||
['workspace'] = vim.fn.stdpath('cache')..'/java-workspaces'
|
||||
}
|
||||
},
|
||||
'jsonls', ------------------------------- JSON
|
||||
'pyls', --------------------------------- Python
|
||||
'rnix', --------------------------------- Nix
|
||||
'solargraph', --------------------------- Ruby
|
||||
'rust_analyzer', ------------------------ Rust
|
||||
['sqlls'] = {
|
||||
['cmd'] = {"$XDG_DATA_HOME/nvm/versions/node/v12.19.0/bin/sql-language-server", "up", "--method", "stdio"}
|
||||
},
|
||||
['terraformls'] = { --------------------- Terraform
|
||||
['filetypes'] = { "terraform", "hcl", "tf" }
|
||||
},
|
||||
'tsserver', ----------------------------- Typescript / JavaScript
|
||||
'angularls', ---------------------------- Angular
|
||||
'vuels', -------------------------------- Vue
|
||||
'svelte', ------------------------------- Svelte
|
||||
['yamlls'] = { -------------------------- YAML
|
||||
['settings'] = {
|
||||
['yaml'] = {
|
||||
['schemas'] = {
|
||||
['https://json.schemastore.org/github-workflow'] = '.github/workflows/*.{yml,yaml}',
|
||||
['https://json.schemastore.org/github-action'] = '.github/action.{yml,yaml}',
|
||||
['https://json.schemastore.org/ansible-stable-2.9'] = 'roles/tasks/*.{yml,yaml}',
|
||||
['https://json.schemastore.org/drone'] = '*.drone.{yml,yaml}',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}) do -- Setup all of the language servers. †
|
||||
if type(lsp_key) == 'number' then -- Enable the LSP with defaults.
|
||||
-- The `lsp` is an index in this case.
|
||||
nvim_lsp[lsp_settings].setup{['on_attach'] = lsp_setup}
|
||||
else -- Use the LSP's configuration.
|
||||
local on_attach_setting = lsp_settings.on_attach
|
||||
|
||||
lsp_settings.on_attach = function()
|
||||
lsp_setup()
|
||||
if on_attach_setting then on_attach_setting() end
|
||||
end
|
||||
|
||||
nvim_lsp[lsp_key].setup(lsp_settings)
|
||||
end
|
||||
end -- ‡
|
||||
EOF
|
||||
|
||||
" Visualize diagnostics
|
||||
let g:diagnostic_enable_virtual_text = 1
|
||||
let g:diagnostic_trimmed_virtual_text = '40'
|
||||
" Don't show diagnostics while in insert mode
|
||||
let g:diagnostic_insert_delay = 1
|
||||
|
||||
" Show diagnostic popup on cursor hold
|
||||
autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics()
|
||||
|
||||
" Goto previous/next diagnostic warning/error
|
||||
" nnoremap <silent> g[ <cmd>PrevDiagnosticCycle<cr>
|
||||
" nnoremap <silent> g] <cmd>NextDiagnosticCycle<cr>
|
||||
|
||||
" have a fixed column for the diagnostics to appear in
|
||||
" this removes the jitter when warnings/errors flow in
|
||||
set signcolumn=yes
|
||||
|
||||
" NeoVim 0.5 Code navigation shortcuts
|
||||
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||
nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
||||
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
|
||||
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.declaration()<CR>
|
41
modules/terminal-life/nvim/plugins.vim
Normal file
41
modules/terminal-life/nvim/plugins.vim
Normal file
|
@ -0,0 +1,41 @@
|
|||
" Happy yaml configuration
|
||||
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
|
||||
" Golang
|
||||
" Go test shortcut
|
||||
nmap <Leader>got :GoTest<CR>
|
||||
|
||||
" Go formatting
|
||||
autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist
|
||||
|
||||
" vim-go disable text-objects
|
||||
let g:go_textobj_enabled = 0
|
||||
|
||||
" disable vim-go :GoDef short cut (gd)
|
||||
" this is handled by LanguageClient [LC]
|
||||
let g:go_def_mapping_enabled = 0
|
||||
|
||||
" GitGutter and vim Magit
|
||||
" inspired by: https://jakobgm.com/posts/vim/git-integration/
|
||||
" Don't map gitgutter keys automatically, set them ourselves
|
||||
let g:gitgutter_map_keys = 0
|
||||
|
||||
" Jump between hunks
|
||||
nmap <Leader>gn <Plug>(GitGutterNextHunk) " git next
|
||||
nmap <Leader>gp <Plug>(GitGutterPrevHunk) " git previous
|
||||
|
||||
" Hunk-add and hunk-revert for chunk staging
|
||||
nmap <Leader>ga <Plug>(GitGutterStageHunk) " git add (chunk)
|
||||
nmap <Leader>gu <Plug>(GitGutterUndoHunk) " git undo (chunk)
|
||||
|
||||
" Open vimagit pane
|
||||
nnoremap <leader>gs :Magit<CR> " git status
|
||||
|
||||
" Push to remote
|
||||
nnoremap <leader>gP :! git push<CR> " git Push
|
||||
|
||||
" Quick conflict resolution in git mergetool nvim
|
||||
" http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/
|
||||
nmap <Leader>[ :diffget //2<CR>
|
||||
nmap <Leader>] :diffget //3<CR>
|
20
modules/terminal-life/nvim/quickfixopenall.vim
Normal file
20
modules/terminal-life/nvim/quickfixopenall.vim
Normal file
|
@ -0,0 +1,20 @@
|
|||
"Usage:
|
||||
" 1. Perform a vimgrep search
|
||||
" :vimgrep /def/ *.rb
|
||||
" 2. Issue QuickFixOpenAll command
|
||||
" :QuickFixOpenAll
|
||||
function! QuickFixOpenAll()
|
||||
if empty(getqflist())
|
||||
return
|
||||
endif
|
||||
let s:prev_val = ""
|
||||
for d in getqflist()
|
||||
let s:curr_val = bufname(d.bufnr)
|
||||
if (s:curr_val != s:prev_val)
|
||||
exec "edit " . s:curr_val
|
||||
endif
|
||||
let s:prev_val = s:curr_val
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
command! QuickFixOpenAll call QuickFixOpenAll()
|
16
modules/terminal-life/nvim/ui.vim
Normal file
16
modules/terminal-life/nvim/ui.vim
Normal file
|
@ -0,0 +1,16 @@
|
|||
let g:base16_shell_path = $XDG_CONFIG_HOME . "/zsh/base16.sh"
|
||||
let base16colorspace = 256
|
||||
set termguicolors
|
||||
let g:sonokai_style = 'shusia'
|
||||
let g:sonokai_enable_italic = 1
|
||||
let g:sonokai_disable_italic_comment = 1
|
||||
let g:sonokai_transparent_background = 1
|
||||
colorscheme sonokai
|
||||
set background=dark
|
||||
|
||||
let g:airline#extensions#tabline#enabled = 1 " Enable the list of buffers
|
||||
let g:airline#extensions#tabline#fnamemod = ':t' " Show just the filename
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
let g:airline_powerline_fonts = 1 " Use powerline fonts
|
||||
let g:airline_theme = 'sonokai'
|
||||
|
126
modules/terminal-life/zsh/base16.zsh
Normal file
126
modules/terminal-life/zsh/base16.zsh
Normal file
|
@ -0,0 +1,126 @@
|
|||
#!/bin/sh
|
||||
# base16-shell (https://github.com/chriskempson/base16-shell)
|
||||
# Base16 Shell template by Chris Kempson (http://chriskempson.com)
|
||||
# Burn scheme by Benjamin Bädorf
|
||||
|
||||
color00="1a/18/1a" # Base 00 - Black
|
||||
color01="f8/5e/84" # Base 08 - Red
|
||||
color02="9e/cd/6f" # Base 0B - Green
|
||||
color03="e5/c4/63" # Base 0A - Yellow
|
||||
color04="7a/cc/d7" # Base 0D - Blue
|
||||
color05="ab/9d/f2" # Base 0E - Magenta
|
||||
color06="ef/90/62" # Base 0C - Cyan
|
||||
color07="e3/e1/e4" # Base 05 - White
|
||||
color08="94/94/94" # Base 03 - Bright Black
|
||||
color09=$color01 # Base 08 - Bright Red
|
||||
color10=$color02 # Base 0B - Bright Green
|
||||
color11=$color03 # Base 0A - Bright Yellow
|
||||
color12=$color04 # Base 0D - Bright Blue
|
||||
color13=$color05 # Base 0E - Bright Magenta
|
||||
color14=$color06 # Base 0C - Bright Cyan
|
||||
color15="ff/5f/5f" # Base 07 - Bright White
|
||||
color16="df/59/23" # Base 09
|
||||
color17="d7/00/00" # Base 0F
|
||||
color18="2d/2a/2e" # Base 01
|
||||
color19="30/30/30" # Base 02
|
||||
color20="d3/d1/d4" # Base 04
|
||||
color21="30/30/30" # Base 06
|
||||
color_foreground="e3/e1/e4" # Base 05
|
||||
color_background="1a/18/1a" # Base 00
|
||||
|
||||
if [ -n "$TMUX" ]; then
|
||||
# Tell tmux to pass the escape sequences through
|
||||
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
|
||||
put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; }
|
||||
put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; }
|
||||
put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; }
|
||||
elif [ "${TERM%%[-.]*}" = "screen" ]; then
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; }
|
||||
put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; }
|
||||
put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; }
|
||||
elif [ "${TERM%%-*}" = "linux" ]; then
|
||||
put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); }
|
||||
put_template_var() { true; }
|
||||
put_template_custom() { true; }
|
||||
else
|
||||
put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; }
|
||||
put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; }
|
||||
put_template_custom() { printf '\033]%s%s\033\\' $@; }
|
||||
fi
|
||||
|
||||
# 16 color space
|
||||
put_template 0 $color00
|
||||
put_template 1 $color01
|
||||
put_template 2 $color02
|
||||
put_template 3 $color03
|
||||
put_template 4 $color04
|
||||
put_template 5 $color05
|
||||
put_template 6 $color06
|
||||
put_template 7 $color07
|
||||
put_template 8 $color08
|
||||
put_template 9 $color09
|
||||
put_template 10 $color10
|
||||
put_template 11 $color11
|
||||
put_template 12 $color12
|
||||
put_template 13 $color13
|
||||
put_template 14 $color14
|
||||
put_template 15 $color15
|
||||
|
||||
# 256 color space
|
||||
put_template 16 $color16
|
||||
put_template 17 $color17
|
||||
put_template 18 $color18
|
||||
put_template 19 $color19
|
||||
put_template 20 $color20
|
||||
put_template 21 $color21
|
||||
|
||||
# foreground / background / cursor color
|
||||
if [ -n "$ITERM_SESSION_ID" ]; then
|
||||
# iTerm2 proprietary escape codes
|
||||
put_template_custom Pg e3e1e4 # foreground
|
||||
put_template_custom Ph 1a181a # background
|
||||
put_template_custom Pi e3e1e4 # bold color
|
||||
put_template_custom Pj 303030 # selection color
|
||||
put_template_custom Pk e3e1e4 # selected text color
|
||||
put_template_custom Pl e3e1e4 # cursor
|
||||
put_template_custom Pm 1a181a # cursor text
|
||||
else
|
||||
put_template_var 10 $color_foreground
|
||||
if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
|
||||
put_template_var 11 $color_background
|
||||
if [ "${TERM%%-*}" = "rxvt" ]; then
|
||||
put_template_var 708 $color_background # internal border (rxvt)
|
||||
fi
|
||||
fi
|
||||
put_template_custom 12 ";7" # cursor (reverse video)
|
||||
fi
|
||||
|
||||
# clean up
|
||||
unset -f put_template
|
||||
unset -f put_template_var
|
||||
unset -f put_template_custom
|
||||
unset color00
|
||||
unset color01
|
||||
unset color02
|
||||
unset color03
|
||||
unset color04
|
||||
unset color05
|
||||
unset color06
|
||||
unset color07
|
||||
unset color08
|
||||
unset color09
|
||||
unset color10
|
||||
unset color11
|
||||
unset color12
|
||||
unset color13
|
||||
unset color14
|
||||
unset color15
|
||||
unset color16
|
||||
unset color17
|
||||
unset color18
|
||||
unset color19
|
||||
unset color20
|
||||
unset color21
|
||||
unset color_foreground
|
||||
unset color_background
|
94
modules/terminal-life/zsh/default.nix
Normal file
94
modules/terminal-life/zsh/default.nix
Normal file
|
@ -0,0 +1,94 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
enableAutosuggestions = true;
|
||||
enableCompletion = true;
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
history = {
|
||||
ignoreDups = true;
|
||||
expireDuplicatesFirst = true;
|
||||
ignoreSpace = true;
|
||||
path = "$HOME/.local/share/zsh/zsh_history";
|
||||
save = 10000;
|
||||
size = 10000;
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
nano = "nvim";
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
mutt = "neomutt";
|
||||
ls = "exa";
|
||||
la = "exa --group-directories-first -lag";
|
||||
fm = "vifm .";
|
||||
vifm = "vifm .";
|
||||
wget = "wget --hsts-file=$XDG_CACHE_HOME/wget-hsts";
|
||||
irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi";
|
||||
drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone";
|
||||
no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix";
|
||||
# fix nixos-option
|
||||
nixos-option = "nixos-option -I nixpkgs=/etc/nixos/lib/compat";
|
||||
};
|
||||
zplug = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
{
|
||||
name = "plugins/z";
|
||||
tags = [ "from:oh-my-zsh" ];
|
||||
}
|
||||
{
|
||||
name = "romkatv/powerlevel10k";
|
||||
tags = [ "as:theme" "depth:1" ];
|
||||
}
|
||||
{ name = "zdharma/fast-syntax-highlighting"; }
|
||||
{ name = "chisui/zsh-nix-shell"; }
|
||||
];
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
bindkey -v
|
||||
bindkey -v 'jj' vi-cmd-mode
|
||||
bindkey -a 'i' up-line
|
||||
bindkey -a 'k' down-line
|
||||
bindkey -a 'j' backward-char
|
||||
bindkey -a 'h' vi-insert
|
||||
bindkey '^[[H' beginning-of-line
|
||||
bindkey '^[[F' end-of-line
|
||||
bindkey '^R' history-incremental-pattern-search-backward
|
||||
bindkey '^ ' autosuggest-accept
|
||||
bindkey '^q' push-line-or-edit
|
||||
|
||||
bindkey '^R' fzf-history-widget
|
||||
|
||||
# ArrowUp/Down start searching history with current input
|
||||
autoload -U history-search-end
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
bindkey "^[[A" history-beginning-search-backward-end
|
||||
bindkey "^[[B" history-beginning-search-forward-end
|
||||
bindkey "^P" history-beginning-search-backward-end
|
||||
bindkey "^N" history-beginning-search-forward-end
|
||||
|
||||
# MAKE CTRL+S WORK IN VIM
|
||||
stty -ixon
|
||||
stty erase '^?'
|
||||
|
||||
# If a command is not found, show me where it is
|
||||
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
|
||||
''
|
||||
+ builtins.readFile ./base16.zsh
|
||||
+ builtins.readFile ./p10k.zsh
|
||||
+
|
||||
''
|
||||
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
|
||||
source ${pkgs.fzf}/share/fzf/completion.zsh
|
||||
source ${pkgs.git-bug}/share/zsh/site-functions/git-bug
|
||||
eval "$(direnv hook zsh)"
|
||||
''
|
||||
+ builtins.readFile ./fzf.zsh;
|
||||
}
|
58
modules/terminal-life/zsh/fzf.zsh
Normal file
58
modules/terminal-life/zsh/fzf.zsh
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Use ~~ as the trigger sequence instead of the default **
|
||||
export FZF_COMPLETION_TRIGGER='~~'
|
||||
|
||||
# Options to fzf command
|
||||
export FZF_COMPLETION_OPTS='--border --info=inline'
|
||||
|
||||
__fzfcmd() {
|
||||
echo "fzf"
|
||||
}
|
||||
|
||||
# ctrl+r - Paste the selected command from history into the command line
|
||||
fzf-history-widget() {
|
||||
local selected num
|
||||
setopt localoptions noglobsubst noposixbuiltins pipefail HIST_FIND_NO_DUPS 2> /dev/null
|
||||
|
||||
selected=( $(fc -rl 1 |
|
||||
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
|
||||
local ret=$?
|
||||
if [ -n "$selected" ]; then
|
||||
num=$selected[1]
|
||||
if [ -n "$num" ]; then
|
||||
zle vi-fetch-history -n $num
|
||||
fi
|
||||
fi
|
||||
zle redisplay
|
||||
typeset -f zle-line-init >/dev/null && zle zle-line-init
|
||||
return $ret
|
||||
}
|
||||
zle -N fzf-history-widget
|
||||
bindkey '^R' fzf-history-widget
|
||||
|
||||
# Use fd (https://github.com/sharkdp/fd) instead of the default find
|
||||
# command for listing path candidates.
|
||||
# - The first argument to the function ($1) is the base path to start traversal
|
||||
# - See the source code (completion.{bash,zsh}) for the details.
|
||||
_fzf_compgen_path() {
|
||||
fd --hidden --follow --exclude ".git" . "$1"
|
||||
}
|
||||
|
||||
# Use fd to generate the list for directory completion
|
||||
_fzf_compgen_dir() {
|
||||
fd --type d --hidden --follow --exclude ".git" . "$1"
|
||||
}
|
||||
|
||||
# (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function
|
||||
# - The first argument to the function is the name of the command.
|
||||
# - You should make sure to pass the rest of the arguments to fzf.
|
||||
_fzf_comprun() {
|
||||
local command=$1
|
||||
shift
|
||||
|
||||
case "$command" in
|
||||
cd) fzf "$@" --preview 'tree -C {} | head -200' ;;
|
||||
export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;;
|
||||
ssh) fzf "$@" --preview 'dig {}' ;;
|
||||
*) fzf "$@" ;;
|
||||
esac
|
||||
}
|
934
modules/terminal-life/zsh/p10k.zsh
Normal file
934
modules/terminal-life/zsh/p10k.zsh
Normal file
|
@ -0,0 +1,934 @@
|
|||
# Generated by Powerlevel10k configuration wizard on 2020-04-18 at 01:15 CEST.
|
||||
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 30399.
|
||||
# Wizard options: powerline, classic, unicode, darkest, 24h time, angled separators,
|
||||
# sharp heads, sharp tails, 1 line, compact, concise, transient_prompt,
|
||||
# instant_prompt=verbose.
|
||||
# Type `p10k configure` to generate another config.
|
||||
#
|
||||
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
|
||||
# your own config based on it.
|
||||
#
|
||||
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
|
||||
#
|
||||
# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
|
||||
|
||||
# Temporarily change options.
|
||||
'builtin' 'local' '-a' 'p10k_config_opts'
|
||||
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
|
||||
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
|
||||
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
|
||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||
|
||||
() {
|
||||
emulate -L zsh -o extended_glob
|
||||
|
||||
# Unset all configuration options. This allows you to apply configuration changes without
|
||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||
unset -m 'POWERLEVEL9K_*'
|
||||
|
||||
# Zsh >= 5.1 is required.
|
||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||
|
||||
# The list of segments shown on the left. Fill it with the most important segments.
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||
ssh
|
||||
context
|
||||
dir # current directory
|
||||
vcs # git status
|
||||
# prompt_char # prompt symbol
|
||||
)
|
||||
|
||||
# The list of segments shown on the right. Fill it with less important segments.
|
||||
# Right prompt on the last prompt line (where you are typing your commands) gets
|
||||
# automatically hidden when the input line reaches it. Right prompt above the
|
||||
# last prompt line gets hidden if it would overlap with left prompt.
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
|
||||
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
|
||||
status # exit code of the last command
|
||||
command_execution_time # duration of the last command
|
||||
background_jobs # presence of background jobs
|
||||
direnv # direnv status (https://direnv.net/)
|
||||
vim_shell # vim shell indicator (:sh)
|
||||
triton # show the current triton profile
|
||||
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
|
||||
watson
|
||||
# kubecontext # current kubernetes context (https://kubernetes.io/)
|
||||
# terraform # terraform workspace (https://www.terraform.io)
|
||||
# aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
|
||||
# aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
|
||||
# azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
|
||||
# gcloud # google cloud cli account and project (https://cloud.google.com/)
|
||||
# google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
|
||||
# context # user@hostname
|
||||
# ranger # ranger shell (https://github.com/ranger/ranger)
|
||||
# nnn # nnn shell (https://github.com/jarun/nnn)
|
||||
# midnight_commander # midnight commander shell (https://midnight-commander.org/)
|
||||
# vpn_ip # virtual private network indicator
|
||||
# load # CPU load
|
||||
# disk_usage # disk usage
|
||||
# ram # free RAM
|
||||
# swap # used swap
|
||||
# todo # todo items (https://github.com/todotxt/todo.txt-cli)
|
||||
# timewarrior # timewarrior tracking status (https://timewarrior.net/)
|
||||
# taskwarrior # taskwarrior task count (https://taskwarrior.org/)
|
||||
# time # current time
|
||||
# ip # ip address and bandwidth usage for a specified network interface
|
||||
# public_ip # public IP address
|
||||
# proxy # system-wide http/https/ftp proxy
|
||||
# battery # internal battery
|
||||
# wifi # wifi speed
|
||||
# example # example user-defined segment (see prompt_example function below)
|
||||
)
|
||||
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND="black"
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND="yellow"
|
||||
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=""
|
||||
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING="CMD"
|
||||
|
||||
# Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
|
||||
typeset -g POWERLEVEL9K_MODE=powerline
|
||||
# When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
|
||||
# icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
|
||||
typeset -g POWERLEVEL9K_ICON_PADDING=none
|
||||
|
||||
# When set to true, icons appear before content on both sides of the prompt. When set
|
||||
# to false, icons go after content. If empty or not set, icons go before content in the left
|
||||
# prompt and after content in the right prompt.
|
||||
#
|
||||
# You can also override it for a specific segment:
|
||||
#
|
||||
# POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false
|
||||
#
|
||||
# Or for a specific segment in specific state:
|
||||
#
|
||||
# POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false
|
||||
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=
|
||||
|
||||
# Add an empty line before each prompt.
|
||||
typeset -g POWERLEVEL9K_PROMPT_ON_NEWLINE=true
|
||||
typeset -g POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
|
||||
|
||||
# Connect left prompt lines with these symbols. You'll probably want to use the same color
|
||||
# as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
|
||||
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%238F'
|
||||
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%238F❯ '
|
||||
# Connect right prompt lines with these symbols.
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%238F'
|
||||
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%238F'
|
||||
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%238F'
|
||||
|
||||
# Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
|
||||
# '─'. The last two make it easier to see the alignment between left and right prompt and to
|
||||
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
||||
# for more compact prompt if using using this option.
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
|
||||
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
|
||||
# The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
|
||||
# ornaments defined above.
|
||||
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238
|
||||
# Start filler from the edge of the screen if there are no left segments on the first line.
|
||||
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
|
||||
# End filler on the edge of the screen if there are no right segments on the first line.
|
||||
typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
|
||||
fi
|
||||
|
||||
# Default background color.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND=none
|
||||
|
||||
# Separator between same-color segments on the left.
|
||||
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%242F\uE0B1'
|
||||
# Separator between same-color segments on the right.
|
||||
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%242F\uE0B3'
|
||||
# Separator between different-color segments on the left.
|
||||
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
|
||||
# Separator between different-color segments on the right.
|
||||
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
|
||||
# The right end of left prompt.
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
|
||||
# The left end of right prompt.
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
|
||||
# The left end of left prompt.
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
|
||||
# The right end of right prompt.
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
|
||||
# Left prompt terminator for lines without any segments.
|
||||
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
|
||||
|
||||
#################################[ os_icon: os identifier ]##################################
|
||||
# OS identifier color.
|
||||
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=255
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐'
|
||||
|
||||
################################[ prompt_char: prompt symbol ]################################
|
||||
# Transparent background.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=
|
||||
# Green prompt symbol if the last command succeeded.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1
|
||||
# Red prompt symbol if the last command failed.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=17
|
||||
# Default prompt symbol.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
|
||||
# Prompt symbol in command vi mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||
# Prompt symbol in visual vi mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
|
||||
# Prompt symbol in overwrite vi mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
|
||||
# No line terminator if prompt_char is the last segment.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
|
||||
# No line introducer if prompt_char is the first segment.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
|
||||
# No surrounding whitespace.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE=
|
||||
|
||||
##################################[ dir: current directory ]##################################
|
||||
typeset -g POWERLEVEL9K_{ETC,FOLDER,HOME,HOME_SUB}_ICON=
|
||||
typeset -g POWERLEVEL9K_DIR_{ETC,HOME,HOME_SUBFOLDER,DEFAULT,NOT_WRITABLE}_BACKGROUND=1
|
||||
typeset -g POWERLEVEL9K_DIR_{ETC,HOME,HOME_SUBFOLDER,DEFAULT,NOT_WRITABLE}_FOREGROUND=0
|
||||
typeset -g POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_VISUAL_IDENTIFIER_COLOR=17
|
||||
|
||||
typeset -g POWERLEVEL9K_DIR_{ETC,DEFAULT}_BACKGROUND=15
|
||||
typeset -g POWERLEVEL9K_DIR_{HOME,HOME_SUBFOLDER}_BACKGROUND=1
|
||||
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_BACKGROUND=1
|
||||
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
|
||||
# Don't shorten directories that contain any of these files. They are anchors.
|
||||
local anchor_files=(
|
||||
.bzr
|
||||
.citc
|
||||
.git
|
||||
.hg
|
||||
.node-version
|
||||
.python-version
|
||||
.go-version
|
||||
.ruby-version
|
||||
.lua-version
|
||||
.java-version
|
||||
.perl-version
|
||||
.php-version
|
||||
.tool-version
|
||||
.shorten_folder_marker
|
||||
.svn
|
||||
.terraform
|
||||
CVS
|
||||
Cargo.toml
|
||||
composer.json
|
||||
go.mod
|
||||
package.json
|
||||
stack.yaml
|
||||
)
|
||||
typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
|
||||
# If set to true, remove everything before the last (deepest) subdirectory that contains files
|
||||
# matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is
|
||||
# /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo
|
||||
# contains a marker (.git) and other directories don't.
|
||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||
# Don't shorten this many last directory segments. They are anchors.
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=100
|
||||
# Shorten directory if it's longer than this even if there is space for it. The value can
|
||||
# be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
|
||||
# directory will be shortened only when prompt doesn't fit or when other parameters demand it
|
||||
# (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
|
||||
# If set to `0`, directory will always be shortened to its minimum length.
|
||||
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=
|
||||
# When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
|
||||
# many columns for typing commands.
|
||||
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
|
||||
# When `dir` segment is on the last prompt line, try to shorten it enough to leave at least
|
||||
# COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands.
|
||||
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
|
||||
# If set to true, embed a hyperlink into the directory. Useful for quickly
|
||||
# opening a directory in the file manager simply by clicking the link.
|
||||
# Can also be handy when the directory is shortened, as it allows you to see
|
||||
# the full directory that was used in previous commands.
|
||||
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
|
||||
|
||||
# Enable special styling for non-writable directories.
|
||||
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
|
||||
# Show this icon when the current directory is not writable. POWERLEVEL9K_DIR_SHOW_WRITABLE
|
||||
# above must be set to true for this parameter to have effect.
|
||||
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='∅'
|
||||
|
||||
#####################################[ vcs: git status ]######################################
|
||||
# Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
|
||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||
|
||||
# Untracked files icon. It's really a question mark, your font isn't broken.
|
||||
# Change the value of this parameter to show a different icon.
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
|
||||
|
||||
# Formatter for Git status.
|
||||
#
|
||||
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
|
||||
#
|
||||
# You can edit the function to customize how Git status looks.
|
||||
#
|
||||
# VCS_STATUS_* parameters are set by gitstatus plugin. See reference:
|
||||
# https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh.
|
||||
function my_git_formatter() {
|
||||
emulate -L zsh
|
||||
|
||||
if [[ -n $P9K_CONTENT ]]; then
|
||||
# If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from
|
||||
# gitstatus plugin). VCS_STATUS_* parameters are not available in this case.
|
||||
typeset -g my_git_format=$P9K_CONTENT
|
||||
return
|
||||
fi
|
||||
|
||||
if (( $1 )); then
|
||||
# Styling for up-to-date Git status.
|
||||
local meta='%0F' # grey foreground
|
||||
local clean='%0F' # green foreground
|
||||
local modified='%0F' # yellow foreground
|
||||
local untracked='%0F' # blue foreground
|
||||
local conflicted='%0F' # red foreground
|
||||
else
|
||||
# Styling for incomplete and stale Git status.
|
||||
local meta='%0F' # grey foreground
|
||||
local clean='%0F' # grey foreground
|
||||
local modified='%0F' # grey foreground
|
||||
local untracked='%0F' # grey foreground
|
||||
local conflicted='%0F' # grey foreground
|
||||
fi
|
||||
|
||||
local res
|
||||
local where # branch or tag
|
||||
if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
|
||||
res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
|
||||
where=${(V)VCS_STATUS_LOCAL_BRANCH}
|
||||
elif [[ -n $VCS_STATUS_TAG ]]; then
|
||||
res+="${meta}#"
|
||||
where=${(V)VCS_STATUS_TAG}
|
||||
fi
|
||||
|
||||
# If local branch name or tag is at most 32 characters long, show it in full.
|
||||
# Otherwise show the first 12 … the last 12.
|
||||
# Tip: To always show local branch name in full without truncation, delete the next line.
|
||||
(( $#where > 32 )) && where[13,-13]="…"
|
||||
res+="${clean}${where//\%/%%}" # escape %
|
||||
|
||||
# Display the current Git commit if there is no branch or tag.
|
||||
# Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
|
||||
[[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
|
||||
|
||||
# Show tracking branch name if it differs from local branch.
|
||||
if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
|
||||
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
|
||||
fi
|
||||
|
||||
# ⇣42 if behind the remote.
|
||||
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
|
||||
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
|
||||
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
|
||||
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
|
||||
# ⇠42 if behind the push remote.
|
||||
(( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
|
||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
|
||||
# ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
|
||||
(( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}"
|
||||
# *42 if have stashes.
|
||||
(( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
|
||||
# 'merge' if the repo is in an unusual state.
|
||||
[[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
|
||||
# ~42 if have merge conflicts.
|
||||
(( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
|
||||
# +42 if have staged changes.
|
||||
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
|
||||
# !42 if have unstaged changes.
|
||||
(( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
|
||||
# ?42 if have untracked files. It's really a question mark, your font isn't broken.
|
||||
# See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
|
||||
# Remove the next line if you don't want to see untracked files at all.
|
||||
(( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}"
|
||||
# "─" if the number of unstaged files is unknown. This can happen due to
|
||||
# POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower
|
||||
# than the number of files in the Git index, or due to bash.showDirtyState being set to false
|
||||
# in the repository config. The number of staged and untracked files may also be unknown
|
||||
# in this case.
|
||||
(( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─"
|
||||
|
||||
typeset -g my_git_format=$res
|
||||
}
|
||||
functions -M my_git_formatter 2>/dev/null
|
||||
|
||||
# Don't count the number of unstaged, untracked and conflicted files in Git repositories with
|
||||
# more than this many files in the index. Negative value means infinity.
|
||||
#
|
||||
# If you are working in Git repositories with tens of millions of files and seeing performance
|
||||
# sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output
|
||||
# of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's
|
||||
# config: `git config bash.showDirtyState false`.
|
||||
typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1
|
||||
|
||||
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
|
||||
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
|
||||
# Multiple patterns can be combined with '|': '~|~/some/dir'.
|
||||
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
|
||||
|
||||
# Disable the default Git status formatting.
|
||||
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
|
||||
# Install our own Git status formatter.
|
||||
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}'
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}'
|
||||
# Enable counters for staged, unstaged, etc.
|
||||
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
|
||||
|
||||
# Icon color.
|
||||
typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=4
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=4
|
||||
# Custom icon.
|
||||
typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION=
|
||||
# Custom prefix.
|
||||
# typeset -g POWERLEVEL9K_VCS_PREFIX='%244Fon '
|
||||
|
||||
# Show status of repositories of these types. You can add svn and/or hg if you are
|
||||
# using them. If you do, your prompt may become slow even when your current directory
|
||||
# isn't in an svn or hg reposotiry.
|
||||
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
|
||||
|
||||
# These settings are used for respositories other than Git or when gitstatusd fails and
|
||||
# Powerlevel10k has to fall back to using vcs_info.
|
||||
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=0
|
||||
typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=0
|
||||
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=3
|
||||
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=0
|
||||
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3
|
||||
|
||||
##########################[ status: exit code of the last command ]###########################
|
||||
# Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and
|
||||
# style them independently from the regular OK and ERROR state.
|
||||
typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
|
||||
|
||||
# Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
|
||||
# it will signify success by turning green.
|
||||
typeset -g POWERLEVEL9K_STATUS_OK=true
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
|
||||
|
||||
# Status when some part of a pipe command fails but the overall exit status is zero. It may look
|
||||
# like this: 1|0.
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
|
||||
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
|
||||
|
||||
# Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
|
||||
# it will signify error by turning red.
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
|
||||
# Status when the last command was terminated by a signal.
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
|
||||
# Use terse signal names: "INT" instead of "SIGINT(2)".
|
||||
typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
|
||||
# Status when some part of a pipe command fails and the overall exit status is also non-zero.
|
||||
# It may look like this: 1|0.
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
|
||||
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
|
||||
|
||||
###################[ command_execution_time: duration of the last command ]###################
|
||||
# Show duration of the last command if takes longer than this many seconds.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
|
||||
# Show this many fractional digits. Zero means round to seconds.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||
# Execution time color.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0
|
||||
# Duration format: 1d 2h 3m 4s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
|
||||
# Custom icon.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION=
|
||||
# Custom prefix.
|
||||
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%244Ftook '
|
||||
|
||||
#######################[ background_jobs: presence of background jobs ]#######################
|
||||
# Don't show the number of background jobs.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
|
||||
# Background jobs color.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=37
|
||||
# Custom icon.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='≡'
|
||||
|
||||
#######################[ direnv: direnv status (https://direnv.net/) ]########################
|
||||
# Direnv color.
|
||||
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
|
||||
# Default asdf color. Only used to display tools for which there is no color override (see below).
|
||||
typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
|
||||
|
||||
# There are four parameters that can be used to hide asdf tools. Each parameter describes
|
||||
# conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at
|
||||
# least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to
|
||||
# hide a tool, it gets shown.
|
||||
#
|
||||
# Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and
|
||||
# POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands:
|
||||
#
|
||||
# asdf local python 3.8.1
|
||||
# asdf global python 3.8.1
|
||||
#
|
||||
# After running both commands the current python version is 3.8.1 and its source is "local" as
|
||||
# it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false,
|
||||
# it'll hide python version in this case because 3.8.1 is the same as the global version.
|
||||
# POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't
|
||||
# contain "local".
|
||||
|
||||
# Hide tool versions that don't come from one of these sources.
|
||||
#
|
||||
# Available sources:
|
||||
#
|
||||
# - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable"
|
||||
# - local `asdf current` says "set by /some/not/home/directory/file"
|
||||
# - global `asdf current` says "set by /home/username/file"
|
||||
#
|
||||
# Note: If this parameter is set to (shell local global), it won't hide tools.
|
||||
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES.
|
||||
typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global)
|
||||
|
||||
# If set to false, hide tool versions that are the same as global.
|
||||
#
|
||||
# Note: The name of this parameter doesn't reflect its meaning at all.
|
||||
# Note: If this parameter is set to true, it won't hide tools.
|
||||
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW.
|
||||
typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false
|
||||
|
||||
# If set to false, hide tool versions that are equal to "system".
|
||||
#
|
||||
# Note: If this parameter is set to true, it won't hide tools.
|
||||
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM.
|
||||
typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
|
||||
|
||||
# If set to non-empty value, hide tools unless there is a file matching the specified file pattern
|
||||
# in the current directory, or its parent diretory, or its grandparent directory, and so on.
|
||||
#
|
||||
# Note: If this parameter is set to empty value, it won't hide tools.
|
||||
# Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
|
||||
# Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB.
|
||||
#
|
||||
# Example: Hide nodejs version when there is no package.json and no *.js files in the current
|
||||
# directory, in `..`, in `../..` and so on.
|
||||
#
|
||||
# typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json'
|
||||
typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB=
|
||||
|
||||
# Ruby version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168
|
||||
# typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Python version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37
|
||||
# typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Go version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37
|
||||
# typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Node.js version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70
|
||||
# typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Rust version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37
|
||||
# typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# .NET Core version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134
|
||||
# typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Flutter version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38
|
||||
# typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Lua version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32
|
||||
# typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Java version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32
|
||||
# typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Perl version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67
|
||||
# typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Erlang version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125
|
||||
# typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Elixir version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129
|
||||
# typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Postgres version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31
|
||||
# typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# PHP version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99
|
||||
# typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
# Haskell version from asdf.
|
||||
typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172
|
||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
|
||||
|
||||
###########[ nix_shell ]###########
|
||||
# # Nix shell color.
|
||||
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
|
||||
|
||||
# Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
|
||||
typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=''
|
||||
|
||||
# Custom icon.
|
||||
typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='nix'
|
||||
|
||||
###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
|
||||
# Text and color for normal (a.k.a. command) vi mode.
|
||||
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=CMD
|
||||
typeset -g POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND=4
|
||||
# Text and color for visual vi mode.
|
||||
typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VIS
|
||||
typeset -g POWERLEVEL9K_VI_MODE_VISUAL_FOREGROUND=3
|
||||
# Text and color for overtype (a.k.a. overwrite and replace) vi mode.
|
||||
typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVR
|
||||
typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_FOREGROUND=2
|
||||
# Text and color for insert vi mode.
|
||||
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
|
||||
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=7
|
||||
|
||||
##################################[ context: user@hostname ]##################################
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=17
|
||||
# Context color in SSH without privileges.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=7
|
||||
# Default context color (no privileges, no SSH).
|
||||
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=7
|
||||
|
||||
# Context format when running with privileges: bold user@hostname.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
|
||||
# Context format when in SSH without privileges: user@hostname.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
|
||||
# Default context format (no privileges, no SSH): user@hostname.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
|
||||
|
||||
###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
|
||||
# Python virtual environment color.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
|
||||
# Don't show Python version next to the virtual environment name.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||
# Separate environment name from Python version only with a space.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#####################[ anaconda: conda environment (https://conda.io/) ]######################
|
||||
# Anaconda environment color.
|
||||
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
|
||||
# Don't show Python version next to the anaconda environment name.
|
||||
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
|
||||
# Separate environment name from Python version only with a space.
|
||||
typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
|
||||
# Pyenv color.
|
||||
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
|
||||
# Hide python version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
|
||||
# If set to false, hide python version if it's the same as global:
|
||||
# $(pyenv version-name) == $(pyenv global).
|
||||
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide python version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
################[ goenv: go environment (https://github.com/syndbg/goenv) ]################
|
||||
# Goenv color.
|
||||
typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37
|
||||
# Hide go version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global)
|
||||
# If set to false, hide go version if it's the same as global:
|
||||
# $(goenv version-name) == $(goenv global).
|
||||
typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide go version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]##########
|
||||
# Nodenv color.
|
||||
typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70
|
||||
# Hide node version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global)
|
||||
# If set to false, hide node version if it's the same as global:
|
||||
# $(nodenv version-name) == $(nodenv global).
|
||||
typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide node version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
|
||||
# Nvm color.
|
||||
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############
|
||||
# Nodeenv color.
|
||||
typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70
|
||||
# Don't show Node version next to the environment name.
|
||||
typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
|
||||
# Separate environment name from Node version only with a space.
|
||||
typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER=
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##############################[ node_version: node.js version ]###############################
|
||||
# Node version color.
|
||||
typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
|
||||
# Show node version only when in a directory tree containing package.json.
|
||||
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#######################[ go_version: go version (https://golang.org) ]########################
|
||||
# Go version color.
|
||||
typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37
|
||||
# Show go version only when in a go project subdirectory.
|
||||
typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#################[ rust_version: rustc version (https://www.rust-lang.org) ]##################
|
||||
# Rust version color.
|
||||
typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
|
||||
# Show rust version only when in a rust project subdirectory.
|
||||
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################
|
||||
# .NET version color.
|
||||
typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134
|
||||
# Show .NET version only when in a .NET project subdirectory.
|
||||
typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#####################[ php_version: php version (https://www.php.net/) ]######################
|
||||
# PHP version color.
|
||||
typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99
|
||||
# Show PHP version only when in a PHP project subdirectory.
|
||||
typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##########[ laravel_version: laravel php framework version (https://laravel.com/) ]###########
|
||||
# Laravel version color.
|
||||
typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
####################[ java_version: java version (https://www.java.com/) ]####################
|
||||
# Java version color.
|
||||
typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32
|
||||
# Show java version only when in a java project subdirectory.
|
||||
typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true
|
||||
# Show brief version.
|
||||
typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]####
|
||||
# Package color.
|
||||
typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117
|
||||
# Package format. The following parameters are available within the expansion.
|
||||
#
|
||||
# - P9K_PACKAGE_NAME The value of `name` field in package.json.
|
||||
# - P9K_PACKAGE_VERSION The value of `version` field in package.json.
|
||||
#
|
||||
# typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}'
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]##############
|
||||
# Rbenv color.
|
||||
typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168
|
||||
# Hide ruby version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global)
|
||||
# If set to false, hide ruby version if it's the same as global:
|
||||
# $(rbenv version-name) == $(rbenv global).
|
||||
typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide ruby version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
#######################[ rvm: ruby version from rvm (https://rvm.io) ]########################
|
||||
# Rvm color.
|
||||
typeset -g POWERLEVEL9K_RVM_FOREGROUND=168
|
||||
# Don't show @gemset at the end.
|
||||
typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
|
||||
# Don't show ruby- at the front.
|
||||
typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############
|
||||
# Fvm color.
|
||||
typeset -g POWERLEVEL9K_FVM_FOREGROUND=38
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]###########
|
||||
# Lua color.
|
||||
typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32
|
||||
# Hide lua version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global)
|
||||
# If set to false, hide lua version if it's the same as global:
|
||||
# $(luaenv version-name) == $(luaenv global).
|
||||
typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide lua version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################
|
||||
# Java color.
|
||||
typeset -g POWERLEVEL9K_JENV_FOREGROUND=32
|
||||
# Hide java version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global)
|
||||
# If set to false, hide java version if it's the same as global:
|
||||
# $(jenv version-name) == $(jenv global).
|
||||
typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide java version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############
|
||||
# Perl color.
|
||||
typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67
|
||||
# Hide perl version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global)
|
||||
# If set to false, hide perl version if it's the same as global:
|
||||
# $(plenv version-name) == $(plenv global).
|
||||
typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide perl version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
|
||||
# PHP color.
|
||||
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
|
||||
# Hide php version if it doesn't come from one of these sources.
|
||||
typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global)
|
||||
# If set to false, hide php version if it's the same as global:
|
||||
# $(phpenv version-name) == $(phpenv global).
|
||||
typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false
|
||||
# If set to false, hide php version if it's equal to "system".
|
||||
typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
|
||||
# Haskell color.
|
||||
typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
|
||||
# Hide haskell version if it doesn't come from one of these sources.
|
||||
#
|
||||
# shell: version is set by STACK_YAML
|
||||
# local: version is set by stack.yaml up the directory tree
|
||||
# global: version is set by the implicit global project (~/.stack/global-project/stack.yaml)
|
||||
typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local)
|
||||
# If set to false, hide haskell version if it's the same as in the implicit global project.
|
||||
typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true
|
||||
# Custom icon.
|
||||
# typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
|
||||
|
||||
# Example of a user-defined prompt segment. Function prompt_example will be called on every
|
||||
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
|
||||
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user.
|
||||
#
|
||||
# Type `p10k help segment` for documentation and a more sophisticated example.
|
||||
function prompt_watson() {
|
||||
local watson_status=$(watson status)
|
||||
local noproject="No project started."
|
||||
if [ "$watson_status" != "$noproject" ]; then
|
||||
p10k segment -i "祥" -f yellow -t "$(echo $watson_status | awk '{print $2,$3}')"
|
||||
else
|
||||
p10k segment -i "⏾" -f red -t ""
|
||||
fi
|
||||
}
|
||||
|
||||
function prompt_triton() {
|
||||
local triton_profile=$(echo $TRITON_PROFILE)
|
||||
if [ "$triton_profile" != "" ]; then
|
||||
p10k segment -f yellow -t "$(echo "✚" "$triton_profile")"
|
||||
fi
|
||||
}
|
||||
|
||||
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
|
||||
# when accepting a command line. Supported values:
|
||||
#
|
||||
# - off: Don't change prompt when accepting a command line.
|
||||
# - always: Trim down prompt when accepting a command line.
|
||||
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
|
||||
# typed after changing current working directory.
|
||||
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
|
||||
|
||||
# Instant prompt mode.
|
||||
#
|
||||
# - off: Disable instant prompt. Choose this if you've tried instant prompt and found
|
||||
# it incompatible with your zsh configuration files.
|
||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||
# during zsh initialization. Choose this if you've read and understood
|
||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||
# seen the warning, or if you are unsure what this all means.
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
|
||||
|
||||
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
|
||||
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
|
||||
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
|
||||
# really need it.
|
||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=false
|
||||
|
||||
# If p10k is already loaded, reload configuration.
|
||||
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
|
||||
(( ! $+functions[p10k] )) || p10k reload
|
||||
}
|
||||
|
||||
# Tell `p10k configure` which file it should overwrite.
|
||||
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
|
||||
|
||||
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
|
||||
'builtin' 'unset' 'p10k_config_opts'
|
28
modules/uhk/default.nix
Normal file
28
modules/uhk/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.uhk;
|
||||
in
|
||||
{
|
||||
options.pub-solar.uhk = {
|
||||
enable = mkEnableOption "Ultimate Hacking Keyboard";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
uhk-agent
|
||||
];
|
||||
|
||||
# Ultimate Hacking Keyboard rules
|
||||
# These are the udev rules for accessing the USB interfaces of the UHK as non-root users.
|
||||
services.udev.packages = with pkgs; [
|
||||
uhk-agent
|
||||
];
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEM=="input", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", GROUP="input", MODE="0660"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"
|
||||
'';
|
||||
};
|
||||
}
|
36
modules/user/default.nix
Normal file
36
modules/user/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.pub-solar;
|
||||
in
|
||||
{
|
||||
options.pub-solar = {
|
||||
user = {
|
||||
name = mkOption {
|
||||
description = "User login name";
|
||||
type = types.nullOr types.str;
|
||||
default = "nixos";
|
||||
};
|
||||
password = mkOption {
|
||||
description = "User password";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
fullName = mkOption {
|
||||
description = "User full name";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
email = mkOption {
|
||||
description = "User email address";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
gpgKeyId = mkOption {
|
||||
description = "GPG Key ID";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
48
modules/virtualisation/default.nix
Normal file
48
modules/virtualisation/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.virtualisation;
|
||||
in
|
||||
{
|
||||
options.pub-solar.virtualisation = {
|
||||
enable = mkEnableOption "Life in libvirt";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelParams = [
|
||||
"amd_iommu=on"
|
||||
"iommu=pt"
|
||||
];
|
||||
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemuOvmf = true;
|
||||
};
|
||||
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
||||
extraGroups = [ "libvirtd" ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
coreutils-full
|
||||
usbutils
|
||||
libvirt
|
||||
libvirt-glib
|
||||
qemu
|
||||
virt-manager
|
||||
python38Packages.libvirt
|
||||
gvfs
|
||||
scream
|
||||
edk2
|
||||
OVMF
|
||||
win-virtio
|
||||
];
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
xdg.dataFile."libvirt/.keep".text = "# this file is here to generate the directory";
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [ "f /dev/shm/scream-ivshmem 0660 ${psCfg.user.name} kvm" ];
|
||||
systemd.user.services.scream-ivshmem-pulse = import ./scream-ivshmem-pulse.service.nix pkgs;
|
||||
};
|
||||
}
|
19
modules/virtualisation/scream-ivshmem-pulse.service.nix
Normal file
19
modules/virtualisation/scream-ivshmem-pulse.service.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
pkgs:
|
||||
{
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
unitConfig = {
|
||||
Description = "Scream IVSHMEM pulse reciever";
|
||||
BindsTo = [ "pipewire-pulse.service" ];
|
||||
After = [ "pipewire-pulse.service" ];
|
||||
Wants = [ "pipewire-pulse.service" ];
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStartPre = [
|
||||
"${pkgs.coreutils-full}/bin/truncate -s 0 /dev/shm/scream-ivshmem"
|
||||
"${pkgs.coreutils-full}/bin/dd if=/dev/zero of=/dev/shm/scream-ivshmem bs=1M count=2"
|
||||
];
|
||||
ExecStart = "${pkgs.scream}/bin/scream -m /dev/shm/scream-ivshmem";
|
||||
};
|
||||
}
|
42
modules/x-os/boot.nix
Normal file
42
modules/x-os/boot.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.pub-solar.x-os;
|
||||
in
|
||||
with lib; {
|
||||
options = {
|
||||
pub-solar.x-os.keyfile = mkOption {
|
||||
type = types.str;
|
||||
description = "Keyfile location";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Enable plymouth for better experience of booting
|
||||
boot.plymouth.enable = true;
|
||||
|
||||
# Use Keyfile to unlock the root partition to avoid keying in twice.
|
||||
# Allow fstrim to work on it.
|
||||
boot.initrd = {
|
||||
secrets = { "/keyfile.bin" = cfg.keyfile; };
|
||||
luks.devices."cryptroot" = {
|
||||
keyFile = "/keyfile.bin";
|
||||
allowDiscards = true;
|
||||
fallbackToPassword = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Use GRUB with encrypted /boot under EFI env.
|
||||
boot.loader = {
|
||||
efi.efiSysMountPoint = "/boot/efi";
|
||||
|
||||
grub = {
|
||||
enable = true;
|
||||
version = 2;
|
||||
device = "nodev";
|
||||
efiSupport = true;
|
||||
enableCryptodisk = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
modules/x-os/default.nix
Normal file
7
modules/x-os/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./boot.nix
|
||||
./i18n.nix
|
||||
./networking.nix
|
||||
];
|
||||
}
|
16
modules/x-os/i18n.nix
Normal file
16
modules/x-os/i18n.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
config = {
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
};
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
};
|
||||
}
|
54
modules/x-os/networking.nix
Normal file
54
modules/x-os/networking.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.pub-solar.x-os;
|
||||
in
|
||||
{
|
||||
options.pub-solar.x-os = {
|
||||
binaryCaches = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = "Binary caches to use.";
|
||||
};
|
||||
publicKeys = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = "Public keys of binary caches.";
|
||||
};
|
||||
iwdConfig = mkOption {
|
||||
type = with types; nullOr (attrsOf (attrsOf (oneOf [ bool int str ])));
|
||||
default = null;
|
||||
description = "Configuratoin of iNet Wireless Daemon.";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
networking.networkmanager = {
|
||||
# Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff.
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Customized binary caches list (with fallback to official binary cache)
|
||||
nix.binaryCaches = cfg.binaryCaches;
|
||||
nix.binaryCachePublicKeys = cfg.publicKeys;
|
||||
|
||||
# These entries get added to /etc/hosts
|
||||
networking.hosts = {
|
||||
"127.0.0.1" = [ "cups.local" ];
|
||||
};
|
||||
|
||||
# Caddy reverse proxy for local services like cups
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
config = ''
|
||||
{
|
||||
auto_https off
|
||||
}
|
||||
cups.local:80
|
||||
bind 127.0.0.1
|
||||
request_header Host localhost:631
|
||||
reverse_proxy unix//run/cups/cups.sock
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
1
overlays/fonts.nix
Normal file
1
overlays/fonts.nix
Normal file
|
@ -0,0 +1 @@
|
|||
import ./fonts
|
4
overlays/fonts/default.nix
Normal file
4
overlays/fonts/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
final: prev:
|
||||
with final; {
|
||||
futura-otf = import ./futura.nix;
|
||||
}
|
19
overlays/fonts/futura.nix
Normal file
19
overlays/fonts/futura.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "futura";
|
||||
version = "1.0.0";
|
||||
|
||||
src = ../secrets/fonts/Futura Std;
|
||||
|
||||
installPhase = ''
|
||||
install -D -m 444 /* -t $out/share/fonts/otf
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "";
|
||||
longDescription = ''
|
||||
'';
|
||||
homepage = "";
|
||||
};
|
||||
}
|
1
overlays/pub-solar.nix
Normal file
1
overlays/pub-solar.nix
Normal file
|
@ -0,0 +1 @@
|
|||
import ./pub-solar
|
15
overlays/pub-solar/default.nix
Normal file
15
overlays/pub-solar/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
final: prev:
|
||||
with final; {
|
||||
import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final);
|
||||
mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final);
|
||||
mu = writeShellScriptBin "mu" (import ./mu.nix final);
|
||||
mopidy-jellyfin = import ./mopidy-jellyfin.nix final;
|
||||
psos = writeShellScriptBin "psos" (import ./psos.nix final);
|
||||
s = writeShellScriptBin "s" (import ./s.nix final);
|
||||
swaylock-bg = writeScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
|
||||
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
|
||||
sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final);
|
||||
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
||||
uhk-agent = import ./uhk-agent.nix final;
|
||||
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
||||
}
|
7
overlays/pub-solar/image-gpu-rom.nix
Normal file
7
overlays/pub-solar/image-gpu-rom.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
GPU_VGA_PORT="0000:01:00.0"
|
||||
|
||||
echo 1 > "/sys/bus/pci/devices/$GPU_VGA_PORT/rom"
|
||||
cat "/sys/bus/pci/devices/$GPU_VGA_PORT/rom" > \
|
||||
"/usr/share/qemu/gpu-1060.rom"
|
||||
echo 0 > "/sys/bus/pci/devices/$GPU_VGA_PORT/rom"
|
||||
|
11
overlays/pub-solar/import-gtk-settings.nix
Normal file
11
overlays/pub-solar/import-gtk-settings.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
self: with self; ''
|
||||
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
|
||||
|
||||
expression=""
|
||||
for pair in "$@"; do
|
||||
IFS=:; set -- $pair
|
||||
expressions="$expressions -e 's/^$2=(.*)$/gsettings set org.gnome.desktop.interface $1 \1/e'"
|
||||
done
|
||||
IFS=
|
||||
eval exec sed -E $expressions "$XDG_CONFIG_HOME"/gtk-3.0/settings.ini >/dev/null
|
||||
''
|
9
overlays/pub-solar/iommu-test.nix
Normal file
9
overlays/pub-solar/iommu-test.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
shopt - s nullglob
|
||||
for
|
||||
g in /sys/kernel/iommu_groups/*; do
|
||||
echo "IOMMU Group ${g##*/}:"
|
||||
for d in $g/devices/*; do
|
||||
echo -e "\t$(lspci -nns ${d##*/})"
|
||||
done;
|
||||
done;
|
||||
|
5
overlays/pub-solar/mailto-mutt.nix
Normal file
5
overlays/pub-solar/mailto-mutt.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
self: with self; ''
|
||||
echo "$@" >> $XDG_CACHE_HOME/log/mailto.log
|
||||
|
||||
exec ${alacritty}/bin/alacritty -e neomutt -- "$@"
|
||||
''
|
29
overlays/pub-solar/mopidy-jellyfin.nix
Normal file
29
overlays/pub-solar/mopidy-jellyfin.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
self: with self;
|
||||
let
|
||||
websocket-client = python38.pkgs.buildPythonPackage rec {
|
||||
pname = "websocket-client";
|
||||
version = "1.0.0";
|
||||
doCheck = false;
|
||||
src = python38.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-UFGzii9MJ/vXygd+uyPsaWWmJt7VqVY382vhs1tsT4E=";
|
||||
};
|
||||
};
|
||||
in
|
||||
python38.pkgs.buildPythonPackage rec {
|
||||
pname = "Mopidy-Jellyfin";
|
||||
version = "1.0.2";
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with python38.pkgs; [
|
||||
unidecode
|
||||
websocket-client
|
||||
requests
|
||||
setuptools
|
||||
pykka
|
||||
mopidy
|
||||
];
|
||||
src = python38.pkgs.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-5XimIIQSpvNyQbSOFtSTkA0jhA0V68BbyQEQNnov+0g=";
|
||||
};
|
||||
}
|
3
overlays/pub-solar/mu.nix
Normal file
3
overlays/pub-solar/mu.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
self: with self; ''
|
||||
exec ${alacritty}/bin/alacritty --class mu_vimpc --option dimensions.columns=120 --option dimensions.lines=80 -e vimpc -- "$@"
|
||||
''
|
5
overlays/pub-solar/overlay.nix
Normal file
5
overlays/pub-solar/overlay.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
# You can use this file as a nixpkgs overlay. This is useful in the
|
||||
# case where you don't want to add the whole NUR namespace to your
|
||||
# configuration.
|
||||
|
||||
self: super: import ./default.nix { pkgs = super; }
|
29
overlays/pub-solar/psos.nix
Normal file
29
overlays/pub-solar/psos.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
self: with self; ''
|
||||
case $1 in
|
||||
rebuild)
|
||||
shift;
|
||||
exec sudo nixos-rebuild switch --flake "/etc/nixos#installed-host" $@
|
||||
;;
|
||||
update)
|
||||
shift;
|
||||
cd /etc/nixos
|
||||
git pull
|
||||
exec nix flake update
|
||||
;;
|
||||
option)
|
||||
shift;
|
||||
exec nixos-option -I nixpkgs=/etc/nixos/lib/compat $@
|
||||
;;
|
||||
*)
|
||||
if [[ "$@" != "" ]]; then
|
||||
echo "Unknown command: psos $@"
|
||||
echo ""
|
||||
fi
|
||||
echo "Usage: psos [COMMAND]"
|
||||
echo " rebuild Rebuild the configuration and switch to it"
|
||||
echo " update Pull git and update flake.lock"
|
||||
echo " option [path] See the current value for an option in the flake config. Example: psos option nix.nixPath"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
''
|
39
overlays/pub-solar/s.nix
Normal file
39
overlays/pub-solar/s.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
self: with self; ''
|
||||
case $1 in
|
||||
d)
|
||||
shift;
|
||||
URL="https://duckduckgo.com?q=$@"
|
||||
;;
|
||||
no)
|
||||
shift;
|
||||
URL="https://search.nixos.org/options?query=$@"
|
||||
;;
|
||||
np)
|
||||
shift;
|
||||
URL="https://search.nixos.org/packages?query=$@"
|
||||
;;
|
||||
rs)
|
||||
shift;
|
||||
URL="https://doc.rust-lang.org/std/index.html?search=$@"
|
||||
;;
|
||||
rsc)
|
||||
shift;
|
||||
URL="https://docs.rs/releases/search?query=$@"
|
||||
;;
|
||||
mdn)
|
||||
shift;
|
||||
URL="https://developer.mozilla.org/en-US/search?q=$@"
|
||||
;;
|
||||
w)
|
||||
shift;
|
||||
URL="https://en.wikipedia.org/w/index.php?search=$@"
|
||||
;;
|
||||
*)
|
||||
URL="https://search.b12f.io?q=$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
${firefox-wayland}/bin/firefox --new-tab "$URL"
|
||||
${sway}/bin/swaymsg '[app_id="firefox"]' focus
|
||||
''
|
64
overlays/pub-solar/sway-launcher.nix
Normal file
64
overlays/pub-solar/sway-launcher.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
self: with self; ''
|
||||
#!/usr/bin/env zsh
|
||||
# terminal application launcher for sway, using fzf
|
||||
# original command:
|
||||
# Based on: https://github.com/swaywm/sway/issues/1367
|
||||
# bindsym $altkey+space exec termite --name=launcher -e \
|
||||
# "bash -c 'compgen -c | sort -u | fzf --no-extended --print-query | \
|
||||
# tail -n1 | xargs -r swaymsg -t command exec'"
|
||||
|
||||
HIST_FILE="''${XDG_CACHE_HOME:-$HOME/.cache}/sway-launcher-history.txt"
|
||||
|
||||
# Get shell command list
|
||||
# This may include the occasional non-executable file
|
||||
command_list=$({ whence -wm '*' | sed 's/:[^:]*$//' })
|
||||
|
||||
# read existing command history
|
||||
if [ -f "$HIST_FILE" ]; then
|
||||
command_history=$(cat "$HIST_FILE")
|
||||
else
|
||||
command_history=""
|
||||
fi
|
||||
|
||||
# search command list
|
||||
command_str=$(printf "%s\n" "''${command_history}" "''${command_list}" | \
|
||||
sed -E 's/^[0-9]+ (.+)$/\1/' | \
|
||||
fzf --exact --no-extended --print-query --no-sort | \
|
||||
tail -n1) || exit 1
|
||||
|
||||
if [ "$command_str" = "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
# echo "Command: $command_str"
|
||||
|
||||
# using \E flag from perl regex
|
||||
test "''${command_str#*\\E}" != "$command_str" && echo "command can't contain '\E'"
|
||||
test "''${command_str#*\\E}" != "$command_str" && exit 1
|
||||
|
||||
# get full line from history (with count number)
|
||||
hist_line=$(echo "$command_history" | grep -Pe "^[0-9]+ \Q$command_str\E$")
|
||||
# echo "Hist Line: $hist_line"
|
||||
|
||||
if [ "$hist_line" = "" ]; then
|
||||
hist_count=1
|
||||
else
|
||||
# Increment usage count
|
||||
hist_count=$(echo "$hist_line" | sed -E 's/^([0-9]+) .+$/\1/')
|
||||
hist_count=$((hist_count + 1))
|
||||
# delete line, to add updated later
|
||||
# echo "Hist Before: $command_history"
|
||||
command_history=$(echo "$command_history" | \
|
||||
grep --invert-match -Pe "^[0-9]+ \Q$command_str\E$")
|
||||
# echo "Hist After: $command_history"
|
||||
fi
|
||||
|
||||
# update history
|
||||
update_line="''${hist_count} ''${command_str}"
|
||||
printf "%s\n" "''${update_line}" "''${command_history}" | \
|
||||
sort --numeric-sort --reverse > "$HIST_FILE"
|
||||
# echo "$update_line"
|
||||
|
||||
# execute command
|
||||
echo "$command_str"
|
||||
${sway}/bin/swaymsg -t command exec "$command_str"
|
||||
''
|
6
overlays/pub-solar/sway-service.nix
Normal file
6
overlays/pub-solar/sway-service.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
self: with self; ''
|
||||
# first import environment variables from the login manager
|
||||
systemctl --user import-environment
|
||||
# then start the service
|
||||
exec systemctl --wait --user start sway.service
|
||||
''
|
20
overlays/pub-solar/swaylock-bg.nix
Normal file
20
overlays/pub-solar/swaylock-bg.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
self: with self; ''
|
||||
# Dependencies:
|
||||
# swaylock
|
||||
|
||||
# Make sure we aren't running twice
|
||||
RUNNING=$(ps -A | grep swaylock | wc -l)
|
||||
if [ $RUNNING -ne 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg
|
||||
LOCKARGS=""
|
||||
|
||||
for OUTPUT in `${sway}/bin/swaymsg -t get_outputs | jq -r '.[].name'`
|
||||
do
|
||||
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
|
||||
IMAGES="''${IMAGES} ''${IMAGE}"
|
||||
done
|
||||
exec ${swaylock}/bin/swaylock $LOCKARGS
|
||||
''
|
14
overlays/pub-solar/toggle-kbd-layout.nix
Normal file
14
overlays/pub-solar/toggle-kbd-layout.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
self: with self; ''
|
||||
set -e
|
||||
|
||||
current_layout=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_active_layout_index' | head -1)
|
||||
total_layouts=$(${sway}/bin/swaymsg -t get_inputs | ${jq}/bin/jq -r '.[] | select(.type == "keyboard") | .xkb_layout_names | length' | head -1)
|
||||
|
||||
next_layout=$(expr $current_layout + 1);
|
||||
|
||||
if [ $next_layout -ge $total_layouts ]; then
|
||||
next_layout=0;
|
||||
fi
|
||||
|
||||
${sway}/bin/swaymsg input '*' xkb_switch_layout "$next_layout"
|
||||
''
|
44
overlays/pub-solar/uhk-agent.nix
Normal file
44
overlays/pub-solar/uhk-agent.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
self: with self;
|
||||
let
|
||||
uhk-agent-bin = stdenv.mkDerivation rec {
|
||||
pname = "uhk-agent-bin";
|
||||
version = "1.5.14";
|
||||
src = builtins.fetchurl {
|
||||
url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v1.5.14/UHK.Agent-1.5.14-linux-x86_64.AppImage";
|
||||
sha256 = "sha256:1yzh4ixy0cqg02xf84vcqj3h67mkxyzs6jf1h935ay582n70nyqg";
|
||||
};
|
||||
phases = [ "installPhase" "patchPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $src $out/bin/uhk-agent
|
||||
chmod +x $out/bin/uhk-agent
|
||||
'';
|
||||
};
|
||||
|
||||
script = ''
|
||||
#!${bash}/bin/bash
|
||||
|
||||
${appimage-run}/bin/appimage-run ${uhk-agent-bin}/bin/uhk-agent
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "uhk-agent";
|
||||
version = "1.5.14";
|
||||
buildInputs = [
|
||||
bash
|
||||
uhk-agent-bin
|
||||
appimage-run
|
||||
];
|
||||
|
||||
phases = [ "buildPhase" "installPhase" "patchPhase" ];
|
||||
|
||||
buildPhase = ''
|
||||
echo "${script}" >> uhk-agent
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp uhk-agent $out/bin/uhk-agent
|
||||
chmod +x $out/bin/uhk-agent
|
||||
'';
|
||||
}
|
5
overlays/pub-solar/wcwd.nix
Normal file
5
overlays/pub-solar/wcwd.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
self: with self; ''
|
||||
pid=$(${sway}/bin/swaymsg -t get_tree | jq '.. | select(.type?) | select(.type=="con") | select(.focused==true).pid')
|
||||
ppid=$(pgrep --newest --parent ''${pid})
|
||||
readlink /proc/''${ppid}/cwd || echo $HOME
|
||||
''
|
243
profiles/base-user/.config/dircolors
Normal file
243
profiles/base-user/.config/dircolors
Normal file
|
@ -0,0 +1,243 @@
|
|||
# Configuration file for dircolors, a utility to help you set the
|
||||
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted provided the copyright notice and this notice are preserved.
|
||||
|
||||
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||
# slackware version of dircolors) are recognized but ignored.
|
||||
|
||||
# You can copy this file to .dir_colors in your $HOME directory to override
|
||||
# the system defaults.
|
||||
|
||||
# Below, there should be one TERM entry for each termtype that is colorizable
|
||||
TERM Eterm
|
||||
TERM ansi
|
||||
TERM color-xterm
|
||||
TERM con132x25
|
||||
TERM con132x30
|
||||
TERM con132x43
|
||||
TERM con132x60
|
||||
TERM con80x25
|
||||
TERM con80x28
|
||||
TERM con80x30
|
||||
TERM con80x43
|
||||
TERM con80x50
|
||||
TERM con80x60
|
||||
TERM cons25
|
||||
TERM console
|
||||
TERM cygwin
|
||||
TERM dtterm
|
||||
TERM eterm-color
|
||||
TERM gnome
|
||||
TERM gnome-256color
|
||||
TERM hurd
|
||||
TERM jfbterm
|
||||
TERM konsole
|
||||
TERM kterm
|
||||
TERM linux
|
||||
TERM linux-c
|
||||
TERM mach-color
|
||||
TERM mach-gnu-color
|
||||
TERM mlterm
|
||||
TERM putty
|
||||
TERM putty-256color
|
||||
TERM rxvt
|
||||
TERM rxvt-256color
|
||||
TERM rxvt-cygwin
|
||||
TERM rxvt-cygwin-native
|
||||
TERM rxvt-unicode
|
||||
TERM rxvt-unicode-256color
|
||||
TERM rxvt-unicode256
|
||||
TERM screen
|
||||
TERM screen-256color
|
||||
TERM screen-256color-bce
|
||||
TERM screen-bce
|
||||
TERM screen-w
|
||||
TERM screen.Eterm
|
||||
TERM screen.rxvt
|
||||
TERM screen.linux
|
||||
TERM st
|
||||
TERM st-256color
|
||||
TERM terminator
|
||||
TERM vt100
|
||||
TERM xterm
|
||||
TERM xterm-16color
|
||||
TERM xterm-256color
|
||||
TERM xterm-88color
|
||||
TERM xterm-color
|
||||
TERM xterm-debian
|
||||
|
||||
# Below are the color init strings for the basic file types. A color init
|
||||
# string consists of one or more of the following numeric codes:
|
||||
# Attribute codes:
|
||||
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||
# Text color codes:
|
||||
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||
# Background color codes:
|
||||
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||
#NORMAL 00 # no color code at all
|
||||
#FILE 00 # regular file: use no color at all
|
||||
RESET 0 # reset to "normal" color
|
||||
DIR 01;34 # directory
|
||||
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||
# numerical value, the color is as for the file pointed to.)
|
||||
MULTIHARDLINK 00 # regular file with more than one link
|
||||
FIFO 40;33 # pipe
|
||||
SOCK 01;35 # socket
|
||||
DOOR 01;35 # door
|
||||
BLK 40;33;01 # block device driver
|
||||
CHR 40;33;01 # character device driver
|
||||
ORPHAN 01;05;37;41 # orphaned syminks
|
||||
MISSING 01;05;37;41 # ... and the files they point to
|
||||
SETUID 37;41 # file that is setuid (u+s)
|
||||
SETGID 30;43 # file that is setgid (g+s)
|
||||
CAPABILITY 30;41 # file with capability
|
||||
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
||||
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
||||
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
||||
|
||||
# This is for files with execute permission:
|
||||
EXEC 01;32
|
||||
|
||||
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||
# to colorize below. Put the extension, a space, and the color init string.
|
||||
# (and any comments you want to add after a '#')
|
||||
|
||||
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||
#.cmd 01;32 # executables (bright green)
|
||||
#.exe 01;32
|
||||
#.com 01;32
|
||||
#.btm 01;32
|
||||
#.bat 01;32
|
||||
# Or if you want to colorize scripts even if they do not have the
|
||||
# executable bit actually set.
|
||||
#.sh 01;32
|
||||
#.csh 01;32
|
||||
|
||||
# archives or compressed (bright red)
|
||||
.tar 01;31
|
||||
.tgz 01;31
|
||||
.arc 01;31
|
||||
.arj 01;31
|
||||
.taz 01;31
|
||||
.lha 01;31
|
||||
.lz4 01;31
|
||||
.lzh 01;31
|
||||
.lzma 01;31
|
||||
.tlz 01;31
|
||||
.txz 01;31
|
||||
.tzo 01;31
|
||||
.t7z 01;31
|
||||
.zip 01;31
|
||||
.z 01;31
|
||||
.Z 01;31
|
||||
.dz 01;31
|
||||
.gz 01;31
|
||||
.lrz 01;31
|
||||
.lz 01;31
|
||||
.lzo 01;31
|
||||
.xz 01;31
|
||||
.bz2 01;31
|
||||
.bz 01;31
|
||||
.tbz 01;31
|
||||
.tbz2 01;31
|
||||
.tz 01;31
|
||||
.deb 01;31
|
||||
.rpm 01;31
|
||||
.jar 01;31
|
||||
.war 01;31
|
||||
.ear 01;31
|
||||
.sar 01;31
|
||||
.rar 01;31
|
||||
.alz 01;31
|
||||
.ace 01;31
|
||||
.zoo 01;31
|
||||
.cpio 01;31
|
||||
.7z 01;31
|
||||
.rz 01;31
|
||||
.cab 01;31
|
||||
|
||||
# image formats
|
||||
.jpg 01;35
|
||||
.jpeg 01;35
|
||||
.gif 01;35
|
||||
.bmp 01;35
|
||||
.pbm 01;35
|
||||
.pgm 01;35
|
||||
.ppm 01;35
|
||||
.tga 01;35
|
||||
.xbm 01;35
|
||||
.xpm 01;35
|
||||
.tif 01;35
|
||||
.tiff 01;35
|
||||
.png 01;35
|
||||
.svg 01;35
|
||||
.svgz 01;35
|
||||
.mng 01;35
|
||||
.pcx 01;35
|
||||
.mov 01;35
|
||||
.mpg 01;35
|
||||
.mpeg 01;35
|
||||
.m2v 01;35
|
||||
.mkv 01;35
|
||||
.webm 01;35
|
||||
.ogm 01;35
|
||||
.mp4 01;35
|
||||
.m4v 01;35
|
||||
.mp4v 01;35
|
||||
.vob 01;35
|
||||
.qt 01;35
|
||||
.nuv 01;35
|
||||
.wmv 01;35
|
||||
.asf 01;35
|
||||
.rm 01;35
|
||||
.rmvb 01;35
|
||||
.flc 01;35
|
||||
.avi 01;35
|
||||
.fli 01;35
|
||||
.flv 01;35
|
||||
.gl 01;35
|
||||
.dl 01;35
|
||||
.xcf 01;35
|
||||
.xwd 01;35
|
||||
.yuv 01;35
|
||||
.cgm 01;35
|
||||
.emf 01;35
|
||||
|
||||
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
|
||||
.axv 01;35
|
||||
.anx 01;35
|
||||
.ogv 01;35
|
||||
.ogx 01;35
|
||||
|
||||
# Document files
|
||||
.pdf 00;32
|
||||
.ps 00;32
|
||||
.txt 00;32
|
||||
.patch 00;32
|
||||
.diff 00;32
|
||||
.log 00;32
|
||||
.tex 00;32
|
||||
.doc 00;32
|
||||
|
||||
# audio formats
|
||||
.aac 00;36
|
||||
.au 00;36
|
||||
.flac 00;36
|
||||
.m4a 00;36
|
||||
.mid 00;36
|
||||
.midi 00;36
|
||||
.mka 00;36
|
||||
.mp3 00;36
|
||||
.mpc 00;36
|
||||
.ogg 00;36
|
||||
.ra 00;36
|
||||
.wav 00;36
|
||||
|
||||
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
|
||||
.axa 00;36
|
||||
.oga 00;36
|
||||
.spx 00;36
|
||||
.xspf 00;36
|
31
profiles/base-user/.config/git/config.nix
Normal file
31
profiles/base-user/.config/git/config.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
user = config.pub-solar.user;
|
||||
xdg = config.home-manager.users."${user.name}".xdg;
|
||||
in
|
||||
''[user]
|
||||
${if user.email != null then "email = ${user.email}" else ""}
|
||||
${if user.fullName != null then "name = ${user.fullName}" else ""}
|
||||
${if user.gpgKeyId != null then "signingkey = ${user.gpgKeyId}" else ""}
|
||||
[core]
|
||||
editor = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim
|
||||
[alias]
|
||||
pol = pull
|
||||
ack = -c color.grep.linenumber=\"bold yellow\"\n -c color.grep.filename=\"bold green\"\n -c color.grep.match=\"reverse yellow\"\n grep --break --heading --line-number
|
||||
# define command which will be used when "nvim"is set as a merge tool
|
||||
[mergetool "nvim"]
|
||||
cmd = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim -f -c \"Gdiffsplit!\" \"$MERGED\"
|
||||
# set "nvim" as tool for merging
|
||||
[merge]
|
||||
tool = /etc/profiles/per-user/${config.pub-solar.user.name}/bin/nvim
|
||||
# automatically launch merge tool without displaying a prompt
|
||||
[mergetool]
|
||||
prompt = false
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[tag]
|
||||
gpgsign = true
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[pull]
|
||||
rebase = false''
|
198
profiles/base-user/.config/libinput-gestures.conf
Normal file
198
profiles/base-user/.config/libinput-gestures.conf
Normal file
|
@ -0,0 +1,198 @@
|
|||
# Configuration file for libinput-gestures.
|
||||
# Mark Blakeney, Sep 2015
|
||||
#
|
||||
# The default configuration file exists at /etc/libinput-gestures.conf
|
||||
# but a user can create a personal custom configuration file at
|
||||
# ~/.config/libinput-gestures.conf.
|
||||
#
|
||||
# Lines starting with '#' and blank lines are ignored. Currently
|
||||
# "gesture" and "device" configuration keywords are supported as
|
||||
# described below. The keyword can optionally be appended with a ":" (to
|
||||
# maintain compatibility with original format configuration files).
|
||||
#
|
||||
# Each gesture line has 3 [or 4] arguments separated by whitespace:
|
||||
#
|
||||
# action motion [finger_count] command
|
||||
#
|
||||
# where action and motion is either:
|
||||
# swipe up
|
||||
# swipe down
|
||||
# swipe left
|
||||
# swipe right
|
||||
# swipe left_up
|
||||
# swipe left_down
|
||||
# swipe right_up
|
||||
# swipe right_down
|
||||
# pinch in
|
||||
# pinch out
|
||||
# pinch clockwise
|
||||
# pinch anticlockwise
|
||||
#
|
||||
# command is the remainder of the line and is any valid shell command +
|
||||
# arguments.
|
||||
#
|
||||
# finger_count is a single numeric digit and is optional (and is
|
||||
# typically 3 or 4). If specified then the command is executed when
|
||||
# exactly that number of fingers is used in the gesture. If not
|
||||
# specified then the command is executed when that gesture is executed
|
||||
# with any number of fingers. Gesture lines specified with finger_count
|
||||
# have priority over the same gesture specified without any
|
||||
# finger_count.
|
||||
#
|
||||
# Typically command will be xdotool, or wmctrl. See "man xdotool" for
|
||||
# the many things you can action with that tool. Note that unfortunately
|
||||
# xdotool does not work with native Wayland clients.
|
||||
|
||||
###############################################################################
|
||||
# SWIPE GESTURES:
|
||||
###############################################################################
|
||||
|
||||
# Note the default is an "internal" command that uses wmctrl to switch
|
||||
# workspaces and, unlike xdotool, works on both Xorg and Wayland (via
|
||||
# XWayland). It also can be configured for vertical and horizontal
|
||||
# switching over tabular workspaces, as per the example below. You can
|
||||
# also add "-w" to the internal command to allow wrapping workspaces.
|
||||
|
||||
# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg)
|
||||
#gesture swipe up _internal ws_up
|
||||
|
||||
# NOTE ABOUT FINGER COUNT:
|
||||
# The above command will configure this command for all fingers (i.e. 3
|
||||
# for 4) but to configure it for 3 fingers only, change it to:
|
||||
# gesture swipe up 3 _internal ws_up
|
||||
# Then you can configure something else for 4 fingers or leave 4 fingers
|
||||
# unconfigured. You can configure an explicit finger count like this for
|
||||
# all example commands in this configuration file.
|
||||
#
|
||||
gesture swipe up 3 ydotool key Super_L+Down
|
||||
gesture swipe up 4 ydotool key Super_L+Ctrl+Right
|
||||
|
||||
# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg)
|
||||
#gesture swipe down _internal ws_down
|
||||
gesture swipe down 3 ydotool key Super_L+Up
|
||||
gesture swipe down 4 ydotool key Super_L+Ctrl+Left
|
||||
|
||||
# Browser go forward (works only for Xorg, and Xwayland clients)
|
||||
gesture swipe left 3 ydotool key ctrl+]
|
||||
|
||||
# Browser go back (works only for Xorg, and Xwayland clients)
|
||||
gesture swipe right 3 ydotool key ctrl+[
|
||||
|
||||
# NOTE: If you don't use "natural" scrolling direction for your touchpad
|
||||
# then you may want to swap the above default left/right and up/down
|
||||
# configurations.
|
||||
|
||||
# Optional extended swipe gestures, e.g. for browser tab navigation:
|
||||
#
|
||||
# Jump to next open browser tab
|
||||
#gesture swipe right_up xdotool key control+Tab
|
||||
#gesture swipe right_up xdotool key control+Next
|
||||
gesture swipe right_up ydotool key ctrl+PageDown
|
||||
#
|
||||
# Jump to previous open browser tab
|
||||
#gesture swipe left_up xdotool key control+shift+Tab
|
||||
gesture swipe left_up ydotool key ctrl+PageUp
|
||||
#
|
||||
# Close current browser tab
|
||||
# gesture swipe left_down xdotool key control+w
|
||||
#
|
||||
# Reopen and jump to last closed browser tab
|
||||
# gesture swipe right_down xdotool key control+shift+t
|
||||
|
||||
# Example of 8 static workspaces, e.g. using KDE virtual-desktops,
|
||||
# arranged in 2 rows of 4 columns across using swipe up/down/left/right
|
||||
# to navigate in fixed planes. You can also add the "-w/--wrap" option
|
||||
# to allow wrapping in any direction. You must configure your virtual
|
||||
# desktops with the same column dimension.
|
||||
# gesture swipe up _internal --cols 4 ws_up
|
||||
# gesture swipe down _internal --cols 4 ws_down
|
||||
# gesture swipe left _internal --cols 4 ws_left
|
||||
# gesture swipe right _internal --cols 4 ws_right
|
||||
#
|
||||
# Example of 16 static workspaces, e.g. using KDE virtual-desktops,
|
||||
# arranged in 4 rows of 4 columns across using swipe up/down/left/right
|
||||
# to navigate in fixed planes, and also using swipe
|
||||
# left_up/left_down/right_up/right_down to navigate diagonally. You can
|
||||
# also add the "-w/--wrap" option to allow wrapping in any direction
|
||||
# and/or diagonally. You must configure your virtual desktops with the
|
||||
# same column dimension.
|
||||
# gesture swipe up _internal --cols 4 ws_up
|
||||
# gesture swipe down _internal --cols 4 ws_down
|
||||
# gesture swipe left _internal --cols 4 ws_left
|
||||
# gesture swipe right _internal --cols 4 ws_right
|
||||
# gesture swipe left_up _internal --cols 4 ws_left_up
|
||||
# gesture swipe left_down _internal --cols 4 ws_left_down
|
||||
# gesture swipe right_up _internal --cols 4 ws_right_up
|
||||
# gesture swipe right_down _internal --cols 4 ws_right_down
|
||||
|
||||
# Example virtual desktop switching for Ubuntu Unity/Compiz. The
|
||||
# _internal command does not work for Compiz but you can explicitly
|
||||
# configure the swipe commands to work for a Compiz virtual 2
|
||||
# dimensional desktop as follows:
|
||||
# gesture swipe up xdotool key ctrl+alt+Up
|
||||
# gesture swipe down xdotool key ctrl+alt+Down
|
||||
# gesture swipe left xdotool key ctrl+alt+Left
|
||||
# gesture swipe right xdotool key ctrl+alt+Right
|
||||
|
||||
# Example to change audio volume:
|
||||
# Note this only works on an Xorg desktop (not Wayland).
|
||||
# gesture swipe up xdotool key XF86AudioRaiseVolume
|
||||
# gesture swipe down xdotool key XF86AudioLowerVolume
|
||||
|
||||
###############################################################################
|
||||
# PINCH GESTURES:
|
||||
###############################################################################
|
||||
|
||||
# GNOME SHELL open/close overview (works for GNOME on Xorg only)
|
||||
gesture pinch in ydotool key ctrl+-
|
||||
gesture pinch out ydotool key ctrl+shift+=
|
||||
|
||||
# KDE Plasma open/close overview
|
||||
# gesture pinch in xdotool key ctrl+F9
|
||||
# gesture pinch out xdotool key ctrl+F9
|
||||
|
||||
# GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg)
|
||||
# Note since GNOME 3.24 on Wayland this is implemented natively so no
|
||||
# real point configuring for Wayland.
|
||||
# gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
|
||||
# gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
|
||||
|
||||
# Optional extended pinch gestures:
|
||||
# gesture pinch clockwise <whatever command>
|
||||
# gesture pinch anticlockwise <whatever command>
|
||||
|
||||
###############################################################################
|
||||
# This application normally determines your touchpad device
|
||||
# automatically. Some users may have multiple touchpads but by default
|
||||
# we use only the first one found. However, you can choose to specify
|
||||
# the explicit device name to use. Run "libinput list-devices" to work
|
||||
# out the name of your device (from the "Device:" field). Then add a
|
||||
# device line specifying that name, e.g:
|
||||
#
|
||||
# device DLL0665:01 06CB:76AD Touchpad
|
||||
#
|
||||
# If the device name starts with a '/' then it is instead considered as
|
||||
# the explicit device path although since device paths can change
|
||||
# through reboots this is best to be a symlink. E.g. instead of specifying
|
||||
# /dev/input/event12, use the corresponding full path link under
|
||||
# /dev/input/by-path/ or /dev/input/by-id/.
|
||||
#
|
||||
# You can choose to use ALL touchpad devices by setting the device name
|
||||
# to "all". E.g. Do this if you have multiple touchpads which you want
|
||||
# to use in parallel. This reduces performance slightly so only set this
|
||||
# if you have to.
|
||||
#
|
||||
# device all
|
||||
|
||||
###############################################################################
|
||||
# You can set a minimum travel distance threshold before swipe gestures
|
||||
# are actioned using the swipe_threshold configuration command.
|
||||
# Specify this value in dots. The default is 0.
|
||||
# E.g. set it to 100 dots with "swipe_threshold 100".
|
||||
# swipe_threshold 0
|
||||
|
||||
###############################################################################
|
||||
# You can set a timeout on gestures from start to end. The default is
|
||||
# the value commented below. It can be any value in float secs >= 0.
|
||||
# 0 = no timeout. E.g. set it to 2 secs with "timeout 2".
|
||||
# timeout 1.5
|
22
profiles/base-user/.config/mako/config
Normal file
22
profiles/base-user/.config/mako/config
Normal file
|
@ -0,0 +1,22 @@
|
|||
padding=10
|
||||
margin=5,5,0
|
||||
default-timeout=5000
|
||||
|
||||
## Base16 Burn
|
||||
# Author: Benjamin Bädorf
|
||||
#
|
||||
# You can use these variables anywhere in the mako configuration file.
|
||||
|
||||
background-color=#1a181a
|
||||
text-color=#e3e1e4
|
||||
border-color=#ff5f5f
|
||||
|
||||
[urgency=low]
|
||||
background-color=#1a181a
|
||||
text-color=#e3e1e4
|
||||
border-color=#ff5f5f
|
||||
|
||||
[urgency=high]
|
||||
background-color=#ff5f5f
|
||||
text-color=#1a181a
|
||||
border-color=#1a181a
|
0
profiles/base-user/.config/mimeapps.list
Normal file
0
profiles/base-user/.config/mimeapps.list
Normal file
132
profiles/base-user/.config/mutt/base16.muttrc
Normal file
132
profiles/base-user/.config/mutt/base16.muttrc
Normal file
|
@ -0,0 +1,132 @@
|
|||
# base16-mutt: base16-shell support for mutt
|
||||
#
|
||||
# These depend on mutt compiled with s-lang, not ncurses. Check by running `mutt -v`
|
||||
# Details this configuration may be found in the mutt manual:
|
||||
# §3 Patterns <http://www.mutt.org/doc/manual/#patterns>
|
||||
# §9 Using color and mono video attributes <http://www.mutt.org/doc/manual/#color>
|
||||
|
||||
# https://www.neomutt.org/guide/configuration.html#color
|
||||
# base00 : color00 - Default Background
|
||||
# base01 : color18 - Lighter Background (Used for status bars)
|
||||
# base02 : color19 - Selection Background
|
||||
# base03 : color08 - Comments, Invisibles, Line Highlighting
|
||||
|
||||
# base04 : color20 - Dark Foreground (Used for status bars)
|
||||
# base05 : color07 - Default Foreground, Caret, Delimiters, Operators
|
||||
# base06 : color21 - Light Foreground (Not often used)
|
||||
# base07 : color15 - Light Background (Not often used)
|
||||
|
||||
# base08 : color01 - Index Item: Deleted.
|
||||
# base09 : color16 - Message: URL.
|
||||
# base0A : color03 - Search Text Background. Message: Bold.
|
||||
# base0B : color02 - Message: Code. Index Item: Tagged.
|
||||
# base0C : color06 - Message: Subject, Quotes. Index Item: Trusted.
|
||||
# base0D : color04 - Message: Headings.
|
||||
# base0E : color05 - Message: Italic, Underline. Index Item: Flagged.
|
||||
# base0F : color17 - Deprecated, Opening/Closing Embedded Language Tags e.g.
|
||||
|
||||
## Base
|
||||
color normal color07 color00 # softer, bold
|
||||
|
||||
## Weak
|
||||
color tilde color08 color00 # `~` padding at the end of pager
|
||||
color attachment color08 color00
|
||||
color tree color08 color00 # arrow in threads
|
||||
color signature color08 color00
|
||||
color markers color08 color00 # `+` wrap indicator in pager
|
||||
|
||||
## Strong
|
||||
color bold color21 color00
|
||||
color underline color21 color00
|
||||
|
||||
## Highlight
|
||||
color error color01 color00
|
||||
color message color02 color00 # informational messages
|
||||
color search color00 color01
|
||||
color status color01 color18
|
||||
color indicator color03 color19 # inverse, brighter
|
||||
|
||||
|
||||
# Message Index ----------------------------------------------------------------
|
||||
|
||||
## Weak
|
||||
color index color08 color00 "~R" # read messages
|
||||
color index color08 color00 "~d >45d" # older than 45 days
|
||||
color index color08 color00 "~v~(!~N)" # collapsed thread with no unread
|
||||
color index color08 color00 "~Q" # messages that have been replied to
|
||||
|
||||
## Strong
|
||||
color index color01 color00 "(~U|~N|~O)" # unread, new, old messages
|
||||
color index color01 color00 "~v~(~U|~N|~O)" # collapsed thread with unread
|
||||
|
||||
## Highlight
|
||||
### Trusted
|
||||
color index color06 color00 "~g" # PGP signed messages
|
||||
color index color06 color00 "~G" # PGP encrypted messages
|
||||
### Odd
|
||||
color index color01 color00 "~E" # past Expires: header date
|
||||
color index color01 color00 "~=" # duplicated
|
||||
color index color01 color00 "~S" # marked by Supersedes: header
|
||||
### Flagged
|
||||
color index color05 color00 "~F" # flagged messages
|
||||
color index color02 color00 "~v~(~F)" # collapsed thread with flagged inside
|
||||
|
||||
# Selection
|
||||
color index color02 color18 "~T" # tagged messages
|
||||
color index color01 color18 "~D" # deleted messages
|
||||
|
||||
### Message Headers ----------------------------------------------------
|
||||
|
||||
# Base
|
||||
color hdrdefault color07 color00
|
||||
color header color07 color00 "^"
|
||||
# Strong
|
||||
color header color21 color00 "^(From)"
|
||||
# Highlight
|
||||
color header color04 color00 "^(Subject)"
|
||||
|
||||
### Message Body -------------------------------------------------------
|
||||
# When possible, these regular expressions attempt to match http://spec.commonmark.org/
|
||||
## Weak
|
||||
# ~~~ Horizontal rules ~~~
|
||||
color body color08 color00 "([[:space:]]*[-+=#*~_]){3,}[[:space:]]*"
|
||||
## Strong
|
||||
# *Bold* span
|
||||
color body color03 color00 "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
|
||||
# _Underline_ span
|
||||
color body color05 color00 "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
|
||||
# /Italic/ span (Sometimes gets directory names)
|
||||
color body color05 color00 "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
|
||||
# ATX headers
|
||||
color body color04 color00 "^[[:space:]]{0,3}#+[[:space:]].*$"
|
||||
## Highlight
|
||||
# `Code` span
|
||||
color body color02 color00 "(^|[[:space:][:punct:]])\`[^\`]+\`([[:space:][:punct:]]|$)"
|
||||
# Indented code block
|
||||
color body color02 color00 "^[[:space:]]{4,}.*$"
|
||||
# URLs
|
||||
color body color16 color00 "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
|
||||
# Email addresses
|
||||
color body color16 color00 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"
|
||||
# Emoticons ;-P
|
||||
color body black yellow "[;:][-o]?[})>{(<|P]"
|
||||
|
||||
# PGP
|
||||
color body color21 color01 "(BAD signature)"
|
||||
color body color21 color01 "^gpg: BAD signature from.*"
|
||||
color body color21 color04 "(Good signature)"
|
||||
color body color21 color04 "^gpg: Good signature .*"
|
||||
color body color04 color00 "^gpg: "
|
||||
|
||||
|
||||
## Quotation blocks
|
||||
color quoted color06 color00
|
||||
color quoted1 color02 color00
|
||||
color quoted2 color03 color00
|
||||
color quoted3 color16 color00
|
||||
color quoted4 color01 color00
|
||||
color quoted5 color17 color00
|
||||
color quoted6 color05 color00
|
||||
color quoted7 color04 color00
|
||||
|
||||
# vi: ft=muttrc
|
1
profiles/base-user/.config/mutt/mailcap
Normal file
1
profiles/base-user/.config/mutt/mailcap
Normal file
|
@ -0,0 +1 @@
|
|||
text/html; w3m -I %{charset} -T text/html; copiousoutput;
|
104
profiles/base-user/.config/mutt/muttrc
Normal file
104
profiles/base-user/.config/mutt/muttrc
Normal file
|
@ -0,0 +1,104 @@
|
|||
# vim: filetype=muttrc
|
||||
|
||||
source $XDG_CONFIG_HOME/mutt/base16.muttrc
|
||||
source $XDG_CONFIG_HOME/mutt/accounts.muttrc
|
||||
|
||||
set editor = `echo \$EDITOR`
|
||||
|
||||
set sidebar_visible = yes
|
||||
set sidebar_width = 50
|
||||
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
|
||||
|
||||
set sendmail_wait = 0
|
||||
|
||||
set mail_check_stats
|
||||
|
||||
set crypt_use_gpgme=yes
|
||||
set crypt_autosign=yes
|
||||
set crypt_verify_sig=yes
|
||||
set crypt_replysign=yes
|
||||
set crypt_replyencrypt=yes
|
||||
set crypt_replysignencrypted=yes
|
||||
set crypt_autoencrypt=yes
|
||||
|
||||
set pgp_check_gpg_decrypt_status_fd
|
||||
set pgp_use_gpg_agent=yes
|
||||
set pgp_self_encrypt=yes
|
||||
|
||||
# Store message headers locally to speed things up.
|
||||
# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things up even more.
|
||||
set header_cache = $XDG_CACHE_HOME/mutt
|
||||
|
||||
# Store messages locally to speed things up, like searching message bodies.
|
||||
# Can be the same folder as header_cache.
|
||||
# This will cost important disk usage according to your e-mail amount.
|
||||
set message_cachedir = $XDG_CACHE_HOME/mutt
|
||||
set imap_check_subscribed
|
||||
|
||||
# Allow Mutt to open a new IMAP connection automatically.
|
||||
unset imap_passive
|
||||
|
||||
# Keep the IMAP connection alive by polling intermittently (time in seconds).
|
||||
set imap_keepalive = 300
|
||||
|
||||
# How often to check for new mail (time in seconds).
|
||||
set mail_check = 120
|
||||
|
||||
set askcc
|
||||
set askbcc
|
||||
|
||||
set date_format="!%d.%m.%Y %H:%M"
|
||||
set index_format="%4C %Z %D %4c %20.20L %s"
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Vi Key Bindings
|
||||
#------------------------------------------------------------
|
||||
|
||||
# Moving around
|
||||
bind generic g noop
|
||||
bind generic gg first-entry
|
||||
bind generic,index G last-entry
|
||||
bind generic,index i previous-entry
|
||||
bind generic,index k next-entry
|
||||
|
||||
bind pager,index d noop
|
||||
bind pager,index dd delete-message
|
||||
|
||||
bind pager i previous-line
|
||||
bind pager k next-line
|
||||
bind pager I previous-entry
|
||||
bind pager K next-entry
|
||||
|
||||
bind pager r noop
|
||||
bind pager rr reply
|
||||
bind pager ra group-reply
|
||||
bind pager rn group-chat-reply
|
||||
bind pager rl list-reply
|
||||
|
||||
# Threads
|
||||
bind browser,pager,index N search-opposite
|
||||
bind pager,index dT delete-thread
|
||||
bind pager,index dt delete-subthread
|
||||
bind pager,index g noop
|
||||
bind pager,index gt next-thread
|
||||
bind pager,index gT previous-thread
|
||||
bind index za collapse-thread
|
||||
bind index zA collapse-all # Missing :folddisable/foldenable
|
||||
|
||||
# Enable URL opening
|
||||
macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
|
||||
macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"
|
||||
|
||||
# Translate markdown to html
|
||||
macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=utf-8\n"
|
||||
set wait_key=no
|
||||
|
||||
# Save to ~/Downloads by default
|
||||
macro attach D "<save-entry><bol>~/Downloads/<eol>" "Save to Downloads"
|
||||
|
||||
set mailcap_path = $XDG_CONFIG_HOME/mutt/mailcap
|
||||
|
||||
# HTML emails
|
||||
auto_view text/html # view html automatically
|
||||
alternative_order text/plain text/enriched text/html # save html for last
|
||||
|
9
profiles/base-user/.config/offlineimap/functions.py
Normal file
9
profiles/base-user/.config/offlineimap/functions.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
#! /usr/bin/env python2
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def get_env(key):
|
||||
return os.getenv(key)
|
||||
|
||||
def get_secret(*attributes):
|
||||
return subprocess.check_output(["secret-tool", "lookup"] + list(attributes))
|
15
profiles/base-user/.config/user-dirs.dirs
Normal file
15
profiles/base-user/.config/user-dirs.dirs
Normal file
|
@ -0,0 +1,15 @@
|
|||
# This file is written by xdg-user-dirs-update
|
||||
# If you want to change or add directories, just edit the line you're
|
||||
# interested in. All local changes will be retained on the next run.
|
||||
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||
# absolute path. No other format is supported.
|
||||
#
|
||||
XDG_DESKTOP_DIR="$HOME/"
|
||||
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||
XDG_TEMPLATES_DIR="$HOME/Templates"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||
XDG_DOCUMENTS_DIR="$HOME/"
|
||||
XDG_MUSIC_DIR="$HOME/"
|
||||
XDG_PICTURES_DIR="$HOME/"
|
||||
XDG_VIDEOS_DIR="$HOME/"
|
1
profiles/base-user/.config/user-dirs.locale
Normal file
1
profiles/base-user/.config/user-dirs.locale
Normal file
|
@ -0,0 +1 @@
|
|||
en_US
|
26
profiles/base-user/.config/vifm/colors/base16.vifm
Normal file
26
profiles/base-user/.config/vifm/colors/base16.vifm
Normal file
|
@ -0,0 +1,26 @@
|
|||
" Reset all styles first
|
||||
highlight clear
|
||||
|
||||
highlight Border cterm=none ctermfg=235 ctermbg=0
|
||||
|
||||
highlight TopLine cterm=none ctermfg=20 ctermbg=18
|
||||
highlight TopLineSel cterm=none ctermfg=1 ctermbg=18
|
||||
|
||||
highlight Win cterm=none ctermfg=188 ctermbg=0
|
||||
highlight Directory cterm=bold ctermfg=4 ctermbg=0
|
||||
highlight CurrLine cterm=none ctermfg=3 ctermbg=19
|
||||
highlight OtherLine cterm=none ctermfg=3 ctermbg=19
|
||||
highlight Selected cterm=none ctermfg=5 ctermbg=19
|
||||
|
||||
highlight JobLine cterm=bold ctermfg=0 ctermbg=18
|
||||
highlight StatusLine cterm=bold ctermfg=0 ctermbg=18
|
||||
highlight ErrorMsg cterm=bold ctermfg=0 ctermbg=18
|
||||
highlight WildMenu cterm=bold ctermfg=0 ctermbg=18
|
||||
highlight CmdLine cterm=none ctermfg=20 ctermbg=0
|
||||
|
||||
highlight Executable cterm=bold ctermfg=2 ctermbg=0
|
||||
highlight Link cterm=none ctermfg=9 ctermbg=0
|
||||
highlight BrokenLink cterm=none ctermfg=1 ctermbg=0
|
||||
highlight Device cterm=none ctermfg=228 ctermbg=0
|
||||
highlight Fifo cterm=none ctermfg=109 ctermbg=0
|
||||
highlight Socket cterm=none ctermfg=110 ctermbg=0
|
495
profiles/base-user/.config/vifm/vifmrc
Normal file
495
profiles/base-user/.config/vifm/vifmrc
Normal file
|
@ -0,0 +1,495 @@
|
|||
" vim: filetype=vifm :
|
||||
" Sample configuration file for vifm (last updated: 2 June, 2019)
|
||||
" You can edit this file by hand.
|
||||
" The " character at the beginning of a line comments out the line.
|
||||
" Blank lines are ignored.
|
||||
" The basic format for each item is shown with an example.
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" Command used to edit files in various contexts. The default is vim.
|
||||
" If you would like to use another vi clone such as Elvis or Vile
|
||||
" you will need to change this setting.
|
||||
|
||||
set vicmd=nvim
|
||||
" set vicmd=elvis\ -G\ termcap
|
||||
" set vicmd=vile
|
||||
|
||||
" This makes vifm perform file operations on its own instead of relying on
|
||||
" standard utilities like `cp`. While using `cp` and alike is a more universal
|
||||
" solution, it's also much slower when processing large amounts of files and
|
||||
" doesn't support progress measuring.
|
||||
|
||||
set syscalls
|
||||
|
||||
" Trash Directory
|
||||
" The default is to move files that are deleted with dd or :d to
|
||||
" the trash directory. If you change this you will not be able to move
|
||||
" files by deleting them and then using p to put the file in the new location.
|
||||
" I recommend not changing this until you are familiar with vifm.
|
||||
" This probably shouldn't be an option.
|
||||
|
||||
set trash
|
||||
|
||||
" This is how many directories to store in the directory history.
|
||||
|
||||
set history=100
|
||||
|
||||
" Automatically resolve symbolic links on l or Enter.
|
||||
|
||||
set nofollowlinks
|
||||
|
||||
" With this option turned on you can run partially entered commands with
|
||||
" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
|
||||
|
||||
" set fastrun
|
||||
|
||||
" Natural sort of (version) numbers within text.
|
||||
|
||||
set sortnumbers
|
||||
|
||||
" Maximum number of changes that can be undone.
|
||||
|
||||
set undolevels=100
|
||||
|
||||
" Use Vim's format of help file (has highlighting and "hyperlinks").
|
||||
" If you would rather use a plain text help file set novimhelp.
|
||||
|
||||
set vimhelp
|
||||
|
||||
" If you would like to run an executable file when you
|
||||
" press return on the file name set this.
|
||||
|
||||
set norunexec
|
||||
|
||||
" Selected color scheme
|
||||
|
||||
colorscheme base16
|
||||
|
||||
" Format for displaying time in file list. For example:
|
||||
" TIME_STAMP_FORMAT=%m/%d-%H:%M
|
||||
" See man date or man strftime for details.
|
||||
|
||||
set timefmt=%m/%d\ %H:%M
|
||||
|
||||
" Show list of matches on tab completion in command-line mode
|
||||
|
||||
set wildmenu
|
||||
|
||||
" Display completions in a form of popup with descriptions of the matches
|
||||
|
||||
set wildstyle=popup
|
||||
|
||||
" Display suggestions in normal, visual and view modes for keys, marks and
|
||||
" registers (at most 5 files). In other view, when available.
|
||||
|
||||
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
|
||||
|
||||
" Ignore case in search patterns unless it contains at least one uppercase
|
||||
" letter
|
||||
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Don't highlight search results automatically
|
||||
|
||||
set nohlsearch
|
||||
|
||||
" Use increment searching (search while typing)
|
||||
set incsearch
|
||||
|
||||
" Try to leave some space from cursor to upper/lower border in lists
|
||||
|
||||
set scrolloff=4
|
||||
|
||||
" Don't do too many requests to slow file systems
|
||||
|
||||
if !has('win')
|
||||
set slowfs=curlftpfs
|
||||
endif
|
||||
|
||||
" Set custom status line look
|
||||
|
||||
set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" :mark mark /full/directory/path [filename]
|
||||
|
||||
mark b ~/bin/
|
||||
mark h ~/
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" :com[mand][!] command_name action
|
||||
" The following macros can be used in a command
|
||||
" %a is replaced with the user arguments.
|
||||
" %c the current file under the cursor.
|
||||
" %C the current file under the cursor in the other directory.
|
||||
" %f the current selected file, or files.
|
||||
" %F the current selected file, or files in the other directory.
|
||||
" %b same as %f %F.
|
||||
" %d the current directory name.
|
||||
" %D the other window directory name.
|
||||
" %m run the command in a menu window
|
||||
|
||||
command! df df -h %m 2> /dev/null
|
||||
command! diff vim -d %f %F
|
||||
command! zip zip -r %f.zip %f
|
||||
command! unzip unzip %c %c.extracted
|
||||
command! run !! ./%f
|
||||
command! make !!make %a
|
||||
command! mkcd :mkdir %a | cd %a
|
||||
command! vgrep vim "+grep %a"
|
||||
command! reload :write | restart
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" The file type is for the default programs to be used with
|
||||
" a file extension.
|
||||
" :filetype pattern1,pattern2 defaultprogram,program2
|
||||
" :fileviewer pattern1,pattern2 consoleviewer
|
||||
" The other programs for the file type can be accessed with the :file command
|
||||
" The command macros %f, %F, %d, %F may be used in the commands.
|
||||
" The %a macro is ignored. To use a % you must put %%.
|
||||
|
||||
" For automated FUSE mounts, you must register an extension with :file[x]type
|
||||
" in one of following formats:
|
||||
"
|
||||
" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables
|
||||
" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime.
|
||||
" A sample line might look like this:
|
||||
" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
|
||||
"
|
||||
" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables
|
||||
" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime.
|
||||
" A sample line might look like this:
|
||||
" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
|
||||
" %PARAM value is filled from the first line of file (whole line).
|
||||
" Example first line for SshMount filetype: root@127.0.0.1:/
|
||||
"
|
||||
" You can also add %CLEAR if you want to clear screen before running FUSE
|
||||
" program.
|
||||
|
||||
" Pdf
|
||||
filextype *.pdf epdfview %c %i &, apvlv %c, xpdf %c
|
||||
fileviewer *.pdf
|
||||
\ vifmimg pdfpreview %px %py %pw %ph %c
|
||||
\ %pc
|
||||
\ vifmimg clear
|
||||
" \ pdftotext -nopgbrk %c -
|
||||
|
||||
" PostScript
|
||||
filextype *.ps,*.eps,*.ps.gz
|
||||
\ {View in zathura}
|
||||
\ zathura %f,
|
||||
\ {View in gv}
|
||||
\ gv %c %i &,
|
||||
|
||||
" Djvu
|
||||
filextype *.djvu
|
||||
\ {View in zathura}
|
||||
\ zathura %f,
|
||||
\ {View in apvlv}
|
||||
\ apvlv %f,
|
||||
|
||||
" Audio
|
||||
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
|
||||
\ {Play using vlc}
|
||||
\ vlc %c,
|
||||
\ {Play using ffplay}
|
||||
\ ffplay -nodisp -autoexit %c,
|
||||
fileviewer *.mp3 mp3info
|
||||
fileviewer *.flac soxi
|
||||
|
||||
" Video
|
||||
filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
|
||||
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
|
||||
\*.as[fx]
|
||||
\ {View using vlc}
|
||||
\ vlc %f,
|
||||
\ {View using ffplay}
|
||||
\ ffplay -fs -autoexit %f,
|
||||
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
|
||||
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
|
||||
\*.as[fx]
|
||||
\ vifmimg videopreview %px %py %pw %ph %c
|
||||
\ %pc
|
||||
\ vifmimg clear
|
||||
" \ ffprobe -pretty %c 2>&1
|
||||
|
||||
" Web
|
||||
filextype *.html,*.htm
|
||||
\ {Open with vim}
|
||||
\ nvim %f,
|
||||
\ {Open with firefox}
|
||||
\ firefox-developer-edition %f &,
|
||||
filetype *.html,*.htm links, lynx
|
||||
|
||||
" Object
|
||||
filetype *.o nm %f | less
|
||||
|
||||
" Man page
|
||||
filetype *.[1-8] man ./%c
|
||||
fileviewer *.[1-8] man ./%c | col -b
|
||||
|
||||
" Images
|
||||
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
||||
\ {View in viewnior}
|
||||
\ viewnior %f,
|
||||
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm
|
||||
\ vifmimg draw %px %py %pw %ph %c
|
||||
\ %pc
|
||||
\ vifmimg clear
|
||||
" Get w3m image previews inside vifm
|
||||
" \ imgt %px %py %pw %ph %c
|
||||
" \ %pc
|
||||
" \ imgc %px %py %pw %ph NOT NEEDED IN XTERM
|
||||
fileviewer *.gif
|
||||
\ vifmimg gifpreview %px %py %pw %ph %c
|
||||
\ %pc
|
||||
\ vifmimg clear
|
||||
|
||||
" OpenRaster
|
||||
filextype *.ora
|
||||
\ {Edit in MyPaint}
|
||||
\ mypaint %f,
|
||||
|
||||
" Mindmap
|
||||
filextype *.vym
|
||||
\ {Open with VYM}
|
||||
\ vym %f &,
|
||||
|
||||
" MD5
|
||||
filetype *.md5
|
||||
\ {Check MD5 hash sum}
|
||||
\ md5sum -c %f %S,
|
||||
|
||||
" SHA1
|
||||
filetype *.sha1
|
||||
\ {Check SHA1 hash sum}
|
||||
\ sha1sum -c %f %S,
|
||||
|
||||
" SHA256
|
||||
filetype *.sha256
|
||||
\ {Check SHA256 hash sum}
|
||||
\ sha256sum -c %f %S,
|
||||
|
||||
" SHA512
|
||||
filetype *.sha512
|
||||
\ {Check SHA512 hash sum}
|
||||
\ sha512sum -c %f %S,
|
||||
|
||||
" GPG signature
|
||||
filetype *.asc
|
||||
\ {Check signature}
|
||||
\ !!gpg --verify %c,
|
||||
|
||||
" Torrent
|
||||
filetype *.torrent ktorrent %f &
|
||||
fileviewer *.torrent dumptorrent -v %c
|
||||
|
||||
" FuseZipMount
|
||||
filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
|
||||
\ {Mount with fuse-zip}
|
||||
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
|
||||
\ {View contents}
|
||||
\ zip -sf %c | less,
|
||||
\ {Extract here}
|
||||
\ tar -xf %c,
|
||||
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
|
||||
|
||||
" ArchiveMount
|
||||
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
|
||||
\ {Mount with archivemount}
|
||||
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
|
||||
fileviewer *.tgz,*.tar.gz tar -tzf %c
|
||||
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
|
||||
fileviewer *.tar.txz,*.txz xz --list %c
|
||||
fileviewer *.tar tar -tf %c
|
||||
|
||||
" Rar2FsMount and rar archives
|
||||
filetype *.rar
|
||||
\ {Mount with rar2fs}
|
||||
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
|
||||
fileviewer *.rar unrar v %c
|
||||
|
||||
" IsoMount
|
||||
filetype *.iso
|
||||
\ {Mount with fuseiso}
|
||||
\ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
|
||||
|
||||
" SshMount
|
||||
filetype *.ssh
|
||||
\ {Mount with sshfs}
|
||||
\ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
|
||||
|
||||
" FtpMount
|
||||
filetype *.ftp
|
||||
\ {Mount with curlftpfs}
|
||||
\ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
|
||||
|
||||
" Fuse7z and 7z archives
|
||||
filetype *.7z
|
||||
\ {Mount with fuse-7z}
|
||||
\ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
|
||||
fileviewer *.7z 7z l %c
|
||||
|
||||
" Office files
|
||||
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
|
||||
fileviewer *.doc catdoc %c
|
||||
fileviewer *.docx docx2txt.pl %f -
|
||||
|
||||
" TuDu files
|
||||
filetype *.tudu tudu -f %c
|
||||
|
||||
" Qt projects
|
||||
filextype *.pro qtcreator %f &
|
||||
|
||||
" All others
|
||||
filetype *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql
|
||||
\ {Open in editor}
|
||||
\ nvim %c,
|
||||
fileviewer *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql bat %c
|
||||
|
||||
" Directories
|
||||
filextype */
|
||||
\ {View in thunar}
|
||||
\ Thunar %f &,
|
||||
|
||||
" Syntax highlighting in preview
|
||||
"
|
||||
" Explicitly set highlight type for some extensions
|
||||
"
|
||||
" 256-color terminal
|
||||
" fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
|
||||
" fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
|
||||
"
|
||||
" 16-color terminal
|
||||
" fileviewer *.c,*.h highlight -O ansi -s dante %c
|
||||
"
|
||||
" Or leave it for automatic detection
|
||||
"
|
||||
" fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
|
||||
|
||||
" Displaying pictures in terminal
|
||||
"
|
||||
" fileviewer *.jpg,*.png shellpic %c
|
||||
|
||||
" Open all other files with default system programs (you can also remove all
|
||||
" :file[x]type commands above to ensure they don't interfere with system-wide
|
||||
" settings). By default all unknown files are opened with 'vi[x]cmd'
|
||||
" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
|
||||
" for unknown file types.
|
||||
" For *nix:
|
||||
" filetype * xdg-open
|
||||
" For OS X:
|
||||
" filetype * open
|
||||
" For Windows:
|
||||
" filetype * start, explorer
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" What should be saved automatically between vifm sessions. Drop "savedirs"
|
||||
" value if you don't want vifm to remember last visited directories for you.
|
||||
set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
|
||||
\phistory,fhistory,dirstack,registers,bookmarks,bmarks
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" Examples of configuring both panels
|
||||
|
||||
" Customize view columns a bit (enable ellipsis for truncated file names)
|
||||
"
|
||||
" set viewcolumns=-{name}..,6{}.
|
||||
|
||||
" Filter-out build and temporary files
|
||||
"
|
||||
" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" Sample mappings
|
||||
|
||||
" Start shell in current directory
|
||||
nnoremap s :shell<cr>
|
||||
|
||||
" Display sorting dialog
|
||||
nnoremap S :sort<cr>
|
||||
|
||||
" Toggle visibility of preview window
|
||||
nnoremap w :view<cr>
|
||||
vnoremap w :view<cr>gv
|
||||
|
||||
" Open file in existing instance of nvim
|
||||
nnoremap o :!vim %f<cr>
|
||||
" Open file in new instance of vim
|
||||
nnoremap O :!vim %f<cr>
|
||||
|
||||
" Open file in the background using its default program
|
||||
nnoremap gb :file &<cr>l
|
||||
|
||||
" Interaction with system clipboard
|
||||
if has('win')
|
||||
" Yank current directory path to Windows clipboard with forward slashes
|
||||
nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
|
||||
" Yank path to current file to Windows clipboard with forward slashes
|
||||
nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
|
||||
elseif executable('xclip')
|
||||
" Yank current directory path into the clipboard
|
||||
nnoremap yd :!echo %d | xclip %i<cr>
|
||||
" Yank current file path into the clipboard
|
||||
nnoremap yf :!echo %c:p | xclip %i<cr>
|
||||
elseif executable('xsel')
|
||||
" Yank current directory path into primary and selection clipboards
|
||||
nnoremap yd :!echo -n %d | xsel --input --primary %i &&
|
||||
\ echo -n %d | xsel --clipboard --input %i<cr>
|
||||
" Yank current file path into into primary and selection clipboards
|
||||
nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
|
||||
\ echo -n %c:p | xsel --clipboard --input %i<cr>
|
||||
endif
|
||||
|
||||
" Mappings for faster renaming
|
||||
nnoremap I cw<c-a>
|
||||
nnoremap cc cw<c-u>
|
||||
nnoremap A cw
|
||||
|
||||
" Open console in current directory
|
||||
nnoremap ,t :!xterm &<cr>
|
||||
|
||||
" Open editor to edit vifmrc and apply settings after returning to vifm
|
||||
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
|
||||
" Open gvim to edit vifmrc
|
||||
nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC &<cr>
|
||||
|
||||
" Toggle wrap setting on ,w key
|
||||
nnoremap ,w :set wrap!<cr>
|
||||
|
||||
" Example of standard two-panel file managers mappings
|
||||
nnoremap <f3> :!less %f<cr>
|
||||
nnoremap <f4> :edit<cr>
|
||||
nnoremap <f5> :copy<cr>
|
||||
nnoremap <f6> :move<cr>
|
||||
nnoremap <f7> :mkdir<space>
|
||||
nnoremap <f8> :delete<cr>
|
||||
|
||||
" Arrow remapping
|
||||
map i <Up>
|
||||
map j <Left>
|
||||
map k <Down>
|
||||
noremap h i
|
||||
|
||||
vnoremap K L
|
||||
vnoremap I H
|
||||
vnoremap H I
|
||||
|
||||
nnoremap K L
|
||||
nnoremap I H
|
||||
nnoremap H I
|
||||
|
||||
" Escape overwrite
|
||||
cmap jj <Esc>
|
||||
|
||||
" fzf
|
||||
command! FZFfind :set noquickview | :execute 'goto "'.system('fd --hidden --exclude .git --exclude node_modules | fzf --preview "ls -lhA --group-directories-first --color=always {}" --preview-window wrap 2>/dev/tty ').'"%IU' | redraw
|
||||
nnoremap <c-p> :FZFfind<cr>
|
23
profiles/base-user/.config/waybar/colorscheme.css
Normal file
23
profiles/base-user/.config/waybar/colorscheme.css
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
*
|
||||
* Base16 Burn
|
||||
* Author: Benjamin Bädorf
|
||||
*
|
||||
*/
|
||||
|
||||
@define-color base00 #1a181a;
|
||||
@define-color base01 #2d2a2e;
|
||||
@define-color base02 #303030;
|
||||
@define-color base03 #949494;
|
||||
@define-color base04 #d3d1d4;
|
||||
@define-color base05 #e3e1e4;
|
||||
@define-color base06 #303030;
|
||||
@define-color base07 #ff5f5f;
|
||||
@define-color base08 #f85e84;
|
||||
@define-color base09 #df5923;
|
||||
@define-color base0A #e5c463;
|
||||
@define-color base0B #9ecd6f;
|
||||
@define-color base0C #ef9062;
|
||||
@define-color base0D #7accd7;
|
||||
@define-color base0E #ab9df2;
|
||||
@define-color base0F #d70000;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue