trying out xonsh
This commit is contained in:
parent
0442a88d08
commit
cb51f8e6d6
10 changed files with 296 additions and 29 deletions
83
home/dots/xonshrc
Normal file
83
home/dots/xonshrc
Normal file
|
@ -0,0 +1,83 @@
|
|||
# nix fix
|
||||
import sys
|
||||
import os.path
|
||||
if os.path.exists(f"{$HOME}/.nix-profile") and not __xonsh__.env.get("NIX_PATH"):
|
||||
$NIX_REMOTE="daemon"
|
||||
$NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/" + $USER
|
||||
$NIX_PROFILES="/nix/var/nix/profiles/default " + $HOME + "/.nix-profile"
|
||||
$NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
|
||||
$NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs:/nix/var/nix/profiles/per-user/root/channels"
|
||||
$PATH += [f"{$HOME}/.nix-profile/bin", "/nix/var/nix/profiles/default/bin"]
|
||||
|
||||
|
||||
new_paths = [#NEWPATHS]
|
||||
# new_paths = new_paths + list(map(lambda s: str(s.resolve()), p"~/.local/lib/".glob("python*/site-packages")))
|
||||
for p in new_paths:
|
||||
if p not in sys.path:
|
||||
sys.path.append(p)
|
||||
$PYTHONPATH.append(p)
|
||||
|
||||
# prompt
|
||||
execx($(/run/current-system/sw/bin/starship init xonsh --print-full-init))
|
||||
|
||||
# zjump
|
||||
execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
|
||||
|
||||
# envs
|
||||
$AUTO_CONTINUE = True
|
||||
$AUTO_CD = True
|
||||
$DOTGLOB = True
|
||||
$GLOB_SORTED = True
|
||||
$INDENT = ' '
|
||||
$AUTO_SUGGEST = True
|
||||
$AUTO_SUGGEST_IN_COMPLETIONS = True
|
||||
$VI_MODE = True
|
||||
$XONSH_AUTOPAIR = True
|
||||
$XONSH_COPY_ON_DELETE = True
|
||||
$ALIAS_COMPLETIONS_OPTIONS_BY_DEFAULT = True
|
||||
$CASE_SENSITIVE_COMPLETIONS = False
|
||||
$COMPLETIONS_BRACKETS = True
|
||||
$COMPLETION_IN_THREAD = True
|
||||
|
||||
# aliases
|
||||
def la_alias(dir=""):
|
||||
exa -lha --icons --group-directories-first --color=always @(dir) | do_culr
|
||||
|
||||
def l_alias(dir=""):
|
||||
exa -lh --icons --group-directories-first --color=always @(dir) | do_culr
|
||||
|
||||
def p_alias(opts=""):
|
||||
ps ww @(opts) | do_culr
|
||||
|
||||
def mnt_alias():
|
||||
mount | column -t | do_culr
|
||||
def fresh_alias():
|
||||
clear
|
||||
echo
|
||||
~/.nix/header.sh
|
||||
|
||||
aliases["fresh"] = fresh_alias
|
||||
aliases["icat"] = [ "kitty", "+kitten", "icat" ]
|
||||
aliases["chmox"] = [ "chmod", "+x" ]
|
||||
aliases["gs"] = [ "git", "status" ]
|
||||
aliases["gcl"] = [ "git", "clone" ]
|
||||
aliases["ga"] = [ "git", "add" ]
|
||||
aliases["gcb"] = [ "git", "checkout", "-b" ]
|
||||
aliases["gco"] = [ "git", "checkout" ]
|
||||
aliases["gl"] = [ "git", "pull" ]
|
||||
aliases["gp"] = [ "git", "push" ]
|
||||
aliases["gd"] = [ "git", "diff" ]
|
||||
aliases["gcam"] = [ "git", "commit", "-am" ]
|
||||
aliases["gcm"] = [ "git", "commit", "-m" ]
|
||||
aliases["gr"] = [ "git", "restore" ]
|
||||
aliases["gm"] = [ "git", "merge" ]
|
||||
aliases["p"] = p_alias
|
||||
aliases["l"] = l_alias
|
||||
aliases["la"] = la_alias
|
||||
aliases["mnt"] = mnt_alias
|
||||
aliases["zz"] = [ "z", "$(xplr)" ]
|
||||
aliases["do_culr"] = [ "culr", "-t", "80", "-o", "roygbiv-split" ]
|
||||
# alias kaboom='printf "type any input if you wish to update\n\npress enter to continue\n"; read upgrade; if [ -n "$upgrade" ]; then echo upgrading..; sudo nix-channel --update; else echo no upgrade!; fi; sudo nixos-rebuild switch -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise'
|
||||
|
||||
# greet
|
||||
fresh
|
63
home/dots/xonshrc.py
Normal file
63
home/dots/xonshrc.py
Normal file
|
@ -0,0 +1,63 @@
|
|||
# nix fix
|
||||
import os.path
|
||||
if os.path.exists(f"{$HOME}/.nix-profile") and not __xonsh__.env.get("NIX_PATH"):
|
||||
$NIX_REMOTE="daemon"
|
||||
$NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/" + $USER
|
||||
$NIX_PROFILES="/nix/var/nix/profiles/default " + $HOME + "/.nix-profile"
|
||||
$NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
|
||||
$NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs:/nix/var/nix/profiles/per-user/root/channels"
|
||||
$PATH += [f"{$HOME}/.nix-profile/bin", "/nix/var/nix/profiles/default/bin"]
|
||||
|
||||
# prompt
|
||||
execx($(/run/current-system/sw/bin/starship init xonsh --print-full-init))
|
||||
|
||||
# envs
|
||||
$AUTO_CONTINUE = True
|
||||
$AUTO_CD = True
|
||||
$DOTGLOB = True
|
||||
$GLOB_SORTED = True
|
||||
$INDENT = ' '
|
||||
$AUTO_SUGGEST = True
|
||||
$AUTO_SUGGEST_IN_COMPLETIONS = True
|
||||
$VI_MODE = True
|
||||
$XONSH_AUTOPAIR = True
|
||||
$XONSH_COPY_ON_DELETE = True
|
||||
$ALIAS_COMPLETIONS_OPTIONS_BY_DEFAULT = True
|
||||
$CASE_SENSITIVE_COMPLETIONS = False
|
||||
$COMPLETIONS_BRACKETS = True
|
||||
$COMPLETION_IN_THREAD = True
|
||||
|
||||
# aliases
|
||||
def la_culr(dir=""):
|
||||
exa -lha --icons --group-directories-first --color=always @(dir) | culr -t 80 -o roygbiv-split
|
||||
|
||||
def ls_culr(dir=""):
|
||||
exa -lh --icons --group-directories-first --color=always @(dir) | culr -t 80 -o roygbiv-split
|
||||
|
||||
def ps_culr(opts=""):
|
||||
ps ww @(opts) | culr -t 80 -o roygbiv-split
|
||||
|
||||
aliases["fresh"] = [ "clear;", "echo;", "~/.nix/header.sh" ]
|
||||
aliases["icat"] = [ "kitty", "+kitten", "icat" ]
|
||||
aliases["chmox"] = [ "chmod", "+x" ]
|
||||
aliases["gs"] = [ "git", "status" ]
|
||||
aliases["gcl"] = [ "git", "clone" ]
|
||||
aliases["ga"] = [ "git", "add" ]
|
||||
aliases["gcb"] = [ "git", "checkout", "-b" ]
|
||||
aliases["gco"] = [ "git", "checkout" ]
|
||||
aliases["gl"] = [ "git", "pull" ]
|
||||
aliases["gp"] = [ "git", "push" ]
|
||||
aliases["gd"] = [ "git", "diff" ]
|
||||
aliases["gcam"] = [ "git", "commit", "-am" ]
|
||||
aliases["gcm"] = [ "git", "commit", "-m" ]
|
||||
aliases["gr"] = [ "git", "restore" ]
|
||||
aliases["gm"] = [ "git", "merge" ]
|
||||
aliases["l"] = [ "ls_culr" ]
|
||||
aliases["la"] = [ "la_culr" ]
|
||||
aliases["p"] = [ "ps_culr" ]
|
||||
aliases["mnt"] = [ "mount", "|", "column", "-t", "|", "culr", "-t", "80", "-o", "roygbiv-split" ]
|
||||
aliases["zz"] = [ "z", "$(xplr)" ]
|
||||
# alias kaboom='printf "type any input if you wish to update\n\npress enter to continue\n"; read upgrade; if [ -n "$upgrade" ]; then echo upgrading..; sudo nix-channel --update; else echo no upgrade!; fi; sudo nixos-rebuild switch -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise'
|
||||
|
||||
# greet
|
||||
fresh
|
|
@ -25,7 +25,6 @@ in {
|
|||
|
||||
btop
|
||||
bat
|
||||
xplr
|
||||
ripgrep
|
||||
fd
|
||||
lazygit
|
||||
|
@ -45,6 +44,7 @@ in {
|
|||
waylock
|
||||
playerctl
|
||||
|
||||
xplr
|
||||
culr
|
||||
swayosd
|
||||
fuzzel
|
||||
|
@ -102,6 +102,16 @@ in {
|
|||
(builtins.readFile dots/hyprland/hyprland.conf));
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "$directory$os$all";
|
||||
directory = {
|
||||
truncate_to_repo = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.eww-hyprland = {
|
||||
enable = true;
|
||||
colors = with palette-hex; (builtins.replaceStrings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue