Compare commits

..

2 commits

Author SHA1 Message Date
95dada6c38
Autostart zsh 2025-09-16 00:34:57 +02:00
9550260b13
Merge pull request 'Add flake.nix' (#1) from flake into master
Reviewed-on: #1
2025-09-16 00:34:10 +02:00
14 changed files with 31 additions and 411 deletions

View file

@ -10,6 +10,8 @@ alias v="nvim"
alias vi="nvim"
alias vim="nvim"
alias f="fuck"
alias irssi='irssi --config="$XDG_CONFIG_HOME"/irssi/config --home="$XDG_DATA_HOME"/irssi'
alias unison="unison -logfile ~/.unison/unison.log"
@ -22,6 +24,10 @@ mkcd() {
cd "$1"
}
if [ "$PREFERRED_SHELL" = zsh ] && command -v ls > /dev/null; then
exec zsh
fi
export PS1="
$(tput bold)$(tput setaf 1)[$(tput setaf 3)\u$(tput setaf 2)@$(tput setaf 4)\H $(tput setaf 5)\w$(tput setaf 1)]$(tput setaf 7)
$ $(tput sgr0)"

View file

@ -1,6 +1,7 @@
call plug#begin(stdpath('data') . '/plugged')
Plug 'preservim/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'vim-syntastic/syntastic'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-surround'
Plug 'mg979/vim-visual-multi'

View file

@ -1,6 +0,0 @@
#!/bin/sh
# select a command with dmenu_run but run it in the terminal emulator
command=$(dmenu_path | dmenu "$@")
[[ $command != "" ]] && exec urxvt -e $command

View file

@ -1,19 +0,0 @@
#!/usr/bin/python
import sys
import re
import string
alphabet = "0" + string.ascii_lowercase
goodRe = re.compile("^[0a-z]*$")
for s in [s.lower() for s in sys.argv[1:]]:
if not goodRe.match(s):
print(f"failed to decode {s}: wrong format", file=sys.stderr)
continue
result = 0
for c in s:
result *= 26
result += alphabet.index(c)
print(f"{s} = {result-1}")

View file

@ -1,3 +0,0 @@
#!/bin/sh
python ~/Documents/fi_fos $@

View file

@ -1,6 +0,0 @@
#!/bin/sh
bg_file=/tmp/$(dd if=/dev/urandom bs=8 count=1 2> /dev/null | base32).png
scrot $bg_file -q 30
convert $bg_file -blur 8x8 $bg_file
exec i3lock -i $bg_file

View file

@ -1,22 +0,0 @@
#!/bin/sh
case $1 in
same)
xrandr --output VGA-1 --same-as LVDS-1
;;
right)
xrandr --output VGA-1 --right-of LVDS-1
;;
left)
xrandr --output VGA-1 --left-of LVDS-1
;;
*)
echo $0 "same|right|left"
exit 1
;;
esac

View file

@ -1,24 +0,0 @@
#!/usr/bin/python
# runs dmenu with the first value of $@ as promt, each even value of $@ as option and the following odd value as command for that option
# for example $ ./multipromt "Power Button Pressed?" "Shutdown" "sudo shutdown now" "Reboot" "sudo reboot now" "Exit I3wm" "i3-msg exit"
import subprocess
from sys import argv
def pairs(iterable):
return zip(iterable[::2], iterable[1::2])
def demnu_select(options, promt=""):
return subprocess.run(["dmenu", "-p", promt], stdout=subprocess.PIPE, input="\n".join(options).encode("UTF-8")).stdout.decode().strip()
def main():
cmds = dict(pairs(["Abort", ""] + argv[2:]))
selected = demnu_select(cmds, argv[1])
cmd = cmds.get(selected, "").split()
if len(cmd) > 0:
subprocess.run(cmd)
if __name__ == "__main__":
main()

View file

@ -1,5 +0,0 @@
#!/bin/sh
cd ~/.programs/processing
./processing

View file

@ -1,11 +0,0 @@
#!/bin/sh
# Use dmenu to promt no or yes with $1 as promt. If the use clickes yes run $2"
# example: promt "Shutdown?" "sudo shutdown now"
posRep="Yes"
negRep="No"
choosen=$(echo -e "$negRep\n$posRep" | dmenu -p "$1")
[[ "$choosen" == "$posRep" ]] && $2

View file

@ -1,28 +0,0 @@
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
CMD=$TERMINAL
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3)
# Get last child process (shell, vim, etc)
if [ -n "$PID" ]; then
TREE=$(pstree -lpA $PID | tail -n 1)
PID=$(echo $TREE | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
# If we find the working directory, run the command in that directory
if [ -e "/proc/$PID/cwd" ]; then
CWD=$(readlink /proc/$PID/cwd)
fi
fi
if [ -n "$CWD" ]; then
cd $CWD && $CMD
else
$CMD
fi

10
_zshrc
View file

@ -30,11 +30,9 @@ function zle-keymap-select {
}
zle -N zle-keymap-select
if [ -f "$HOME/.config/bashrc" ]; then
emulate sh -c "source $HOME/.config/bashrc"
else if [ -f "$HOME/.bashrc" ];
emulate sh -c "source $HOME/.bashrc"
fi
unset PREFERRED_SHELL
[ -f "$HOME/./config/bashrc" ] && emulate sh -c "source $HOME/./config/bashrc"
[ -f "$HOME/.bashrc" ] && emulate sh -c "source $HOME/.bashrc"
[ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] && source "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[ -f "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ] && source "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
@ -44,6 +42,8 @@ fi
setopt interactivecomments
setopt HIST_IGNORE_SPACE
eval $(thefuck --alias)
export PS1="
%{$(tput bold)%}%{$(tput setaf 1)%}[%{$(tput setaf 3)%}%n%{$(tput setaf 2)%}@%{$(tput setaf 4)%}%M %{$(tput setaf 5)%}%~%{$(tput setaf 1)%}]%{$(tput setaf 7)%}
$ %{$(tput sgr0)%}"

266
flake.lock generated
View file

@ -1,266 +0,0 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1756770412,
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "4524271976b625a4a605beefd893f270620fd751",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1757239681,
"narHash": "sha256-E9spYi9lxm2f1zWQLQ7xQt8Xs2nWgr1T4QM7ZjLFphM=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "ab82ab08d6bf74085bd328de2a8722c12d97bd9d",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1755233722,
"narHash": "sha256-AavrbMltJKcC2Fx0lfJoZfmy7g87ebXU0ddVenhajLA=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "99e03e72e3f7e13506f80ef9ebaedccb929d84d0",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1757698511,
"narHash": "sha256-UqHHGydF/q3jfYXCpvYLA0TWtvByOp1NwOKCUjhYmPs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a3fcc92180c7462082cd849498369591dfb20855",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1757462715,
"narHash": "sha256-SsxK5ZIZaftnMQTuAmkb9NuBpXBqAVvmA1/We4qb+nQ=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "9242945341c151dfcd41b02b04ff59dd8fb761ce",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1757462013,
"narHash": "sha256-OZRjMnuDw0DCpKZHU62VI6+TJ5wUvD/+qIrbGmGBBzk=",
"owner": "neovim",
"repo": "neovim",
"rev": "f6ed46c2a747a697c6b301dd35fcc9c7b4d175ab",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1757034884,
"narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ca77296380960cd497a765102eeb1356eb80fed0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1757773722,
"narHash": "sha256-DwxmQZ9D+hEe7h968RvFIVm6gidiVpGKZl8HanbI7FY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b8df34ffe22cfc4f6c6229aa29d8ee67657cbec0",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1756662192,
"narHash": "sha256-F1oFfV51AE259I85av+MAia221XwMHCOtZCMcZLK2Jk=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "1aabc6c05ccbcbf4a635fb7a90400e44282f61c4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -2,9 +2,9 @@
description = "OSHs dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
home-manager.url = "github:nix-community/home-manager";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
@ -13,15 +13,16 @@
system = builtins.currentSystem;
username = builtins.getEnv "USER";
homeDir = builtins.getEnv "HOME";
overlays = [
neovim-nightly-overlay.overlays.default
];
pkgs = import nixpkgs { inherit system overlays; };
pkgs = import nixpkgs { inherit system; };
in {
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
nixpkgs.overlays = [
neovim-nightly-overlay.overlays.default
];
home.username = username;
home.homeDirectory = homeDir;
# Only manage what you explicitly turn on below
@ -48,7 +49,11 @@
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initContent = ''
initExtra = ''
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
source ${pkgs.fzf}/share/fzf/completion.zsh
source ${pkgs.fzf-zsh}/share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh
[ -f "$HOME/.config/zshrc" ] && source $HOME/.config/zshrc
'';
@ -78,21 +83,16 @@
enableZshIntegration = true;
};
home.keyboard = {
variant = null;
options = [
"caps:escape" # make Caps = Escape
];
};
# Put extra packages in the *user* profile (not system)
home.packages = with pkgs; [
ripgrep
fd
tmux
xsel
fzf
fzf-zsh
thefuck
rust-analyzer
jq
];
# Link dotfiles without forcing overwrite (fails safely if a file already exists)
@ -111,12 +111,15 @@
force = true;
};
# Environment variables only for this user/session
home.sessionVariables = {
EDITOR = "nvim";
PREFERRED_SHELL = "zsh";
};
# Good HM hygiene
xdg.enable = true;
home.stateVersion = "25.05";
home.stateVersion = "24.05";
}
];
};