Compare commits

...

2 commits

Author SHA1 Message Date
Geoffrey Frogeye 5b70c2f448
Smol improvements 2024-01-04 23:18:06 +01:00
Geoffrey Frogeye 241ec71350
Remove already processed things 2024-01-04 22:14:31 +01:00
4 changed files with 27 additions and 138 deletions

View file

@ -58,8 +58,6 @@ in
commonShellAliases = {
# Completion for existing commands
ls = "lsd";
ll = "lsd -l";
la = "lsd -la";
mkdir = "mkdir -v";
# cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear.
mv = "mv -iv";
@ -68,7 +66,9 @@ in
ffmpeg = "ffmpeg -hide_banner";
ffprobe = "ffprobe -hide_banner";
ffplay = "ffplay -hide_banner";
# TODO Add ipython --no-confirm-exit --pdb
numbat = "numbat --intro-banner off";
insect = "numbat";
ipython = "ipython --no-confirm-exit --pdb";
# Frequent mistakes
sl = "ls";
@ -78,8 +78,8 @@ in
please = "sudo";
# Shortcuts for commonly used commands
# ll = "ls -l"; # Disabled because would overwrite the colored one
# la = "ls -la"; # Eh maybe it's not that bad, but for now let's keep compatibility
ll = "lsd -l";
la = "lsd -la";
s = "sudo -s -E";
@ -156,6 +156,13 @@ in
sessionVariables = commonSessionVariables;
shellAliases = commonShellAliases // config.frogeye.shellAliases;
};
bat = {
enable = true;
config = {
theme = "base16";
style = "full";
};
};
lsd.enable = true;
dircolors = {
enable = true;
@ -175,8 +182,8 @@ in
# UPST Implement this properly in home-manager, would allow for bash support
};
extraUpdatePS1 = ''
unset __TIMER
echo -en "\033]0; $USER@$HOST $PWD\007"
unset __TIMER
echo -en "\033]0; $USER@$HOST $PWD\007"
'';
};
gpg = {
@ -215,10 +222,11 @@ in
enableZshIntegration = true;
defaultOptions = [ "--height 40%" "--layout=default" ];
fileWidgetOptions = [ "--preview '[[ -d {} ]] && ${pkgs.coreutils}/bin/ls -l --color=always {} || [[ \$(${pkgs.file}/bin/file --mime {}) =~ binary ]] && ${pkgs.file}/bin/file --brief {} || (${pkgs.highlight}/bin/highlight -O ansi -l {} || coderay {} || rougify {} || ${pkgs.coreutils}/bin/cat {}) 2> /dev/null | head -500'" ];
# TODO Above not working... not really used either?
# file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh.
};
# TODO highlight or bat
nix-index = {
# For non-NixOS systems
enable = false; # TODO Index is impossible to generate, should use https://github.com/nix-community/nix-index-database
# but got no luck without flakes
enableZshIntegration = true;
@ -237,6 +245,13 @@ in
"tags"
".mypy_cache"
];
delta = {
enable = true;
options = {
line-numbers = true;
syntax-theme = "base16";
};
};
lfs.enable = true;
userEmail = lib.mkDefault "geoffrey@frogeye.fr";
userName = lib.mkDefault "Geoffrey Frogeye";
@ -256,7 +271,6 @@ in
"difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\"";
# This escapes quotes, which isn't the case in the original, hoping this isn't an issue.
};
# TODO Delta syntax highlighter... and other cool-looking options?
};
readline = {
enable = true;
@ -316,14 +330,12 @@ in
};
services = {
gpg-agent = {
enable = true; # TODO Consider not enabling it when not having any private key
enableBashIntegration = true;
enableZshIntegration = true;
pinentryFlavor = "gtk2"; # Falls back to curses when needed
};
# TODO Syncs a bit too often, also constantly asks for passphrase, which is annoying.
git-sync = {
enable = false;
enable = false; # The real thing syncs too quickly and asks for passphrase, which is annoying
# So for now it's just a way to park config which will be reused by git-sync-* commands
repositories = {
dotfiles = {
path = "${config.xdg.configHome}/dotfiles";
@ -432,9 +444,10 @@ in
progress
speedtest-cli
# multimedia toolbox
# toolbox
sox
imagemagick
numbat
# password
pwgen
@ -467,12 +480,6 @@ in
khard
khal
todoman
# TODO Lots of redundancy with other way things are defined here
] ++ lib.optionals pkgs.stdenv.isx86_64 [
nodePackages.insect
# TODO Use whatever replaces insect, hopefully that works on aarch64
];
sessionVariables = {
# Favourite commands

View file

@ -1,103 +0,0 @@
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx
#
# Execute system modules, just in case
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# Load Xresources
[ -f ~/.config/Xresources/main ] && xrdb -I"$HOME" ~/.config/Xresources/main
# Disable the bell
xset b off
# Folders to search for desktop environments (DE) in
sessions_dirs="/usr/share/xsessions"
# If we have locally installed DE try them before system ones
sessions_dir_local="$HOME/.local/share/xsessions"
if [ -d "$sessions_dir_local" ]
then
sessions_dirs="$sessions_dir_local $sessions_dirs"
fi
# If we have junest installed DE try them before all others
sessions_dir_junest="$HOME/.junest/usr/share/xsessions"
if [ -d "$sessions_dir_junest" ]
then
sessions_dirs="$sessions_dir_junest $sessions_dirs"
fi
startSession() {
session_dir="$1"
session_name="$2"
session_file="${session_dir}/${session_name}.desktop"
executable="$(grep ^Exec= "$session_file" | cut -d'=' -f2)"
# TODO Does this work with parameters?
# gnome-classic might need some
# If this is a Junest DE, we need to wrap it
if [ "$sessions_dir" = "$sessions_dir_junest" ]
then
# Some DMs enforce that to you,
# which shows warning on Junest
unset LD_PRELOAD
# The intended way:
# exec ~/.local/bin/junest "$executable" $parameters
# Too restricted to the outside (e.g. Yubikey isn't accessible)
# The custom way
exec ~/.local/bin/junest --backend-args "--dev-bind /run /run" "$executable" $parameters
# The fallback wrappers way
# export PATH="$PATH:~/.junest/usr/bin_wrappers"
# exec "$executable" $parameters
# Should work but doesn't, I forgot why
# The "I do what I want" way
#exec bwrap --bind $HOME/.junest / --bind $HOME $HOME --bind /tmp /tmp --proc /proc --dev-bind /dev /dev --dev-bind /run /run "$executable" $parameters
# Even Alacritty doesn't work here
fi
exec "$executable" $parameters
}
trySession() { # session_name
session_name="$1"
for sessions_dir in $sessions_dirs
do
session_file="$sessions_dir/${session_name}.desktop"
if [ -f "$session_file" ]
then
startSession "$sessions_dir" "$session_name"
fi
done
}
if [ -n "$1" ]
then
trySession "$1"
else
trySession i3
trySession xfce4
trySession mate
trySession plasma
trySession gnome
trySession kde
fi
# If we found nothing by then, RIP
echo "Couldn't find a suitable DM."
exit 1

Binary file not shown.

View file

@ -1,15 +0,0 @@
#!/bin/sh
#
# ~/.xsession
#
# Sourced by display managers
#
[ -f ~/.xprofile ] && . ~/.xprofile
if [ -f ~/.config/override_dm_choice ]
then
. ~/.config/xinitrc
else
. ~/.config/xinitrc $@
fi