add nixpkgs; bashrc; i3lock

This commit is contained in:
grimhilt 2023-12-26 23:38:41 +01:00
parent ebfa8a1088
commit 46a309f25e
12 changed files with 169 additions and 3 deletions

20
.bashrc
View File

@ -1,4 +1,5 @@
alias gi='git init'
alias gs='git status' alias gs='git status'
alias gl='git log' alias gl='git log'
alias ga='git add' alias ga='git add'
@ -8,6 +9,25 @@ alias gt='git tag -ma'
alias gp='git push' alias gp='git push'
alias gpt='git push --follow-tags' alias gpt='git push --follow-tags'
alias gd='git diff' alias gd='git diff'
alias gpl='git pull'
alias gcl='git clone'
alias gr='git reset'
alias gck='git checkout'
alias gst='git stash'
alias grt='git restore'
alias gf='git fetch'
alias n='nvim' alias n='nvim'
alias p='cd ~/Documents/prog' alias p='cd ~/Documents/prog'
alias cf='clang-format -i'
alias cfa='find -name "*.[ch]" -exec clang-format -i {} \; -print'
alias ge='gcc -std=c99 -pedantic -Werror -Wall -Wextra -Wvla -o main'
alias gef='gcc -g -fsanitize=address -std=c99 -Wall -Wextra -Wvla -D_DEFAULT_SOURCE -o main'
alias gec='gcc -g -fsanitize=address -std=c99 -Wall -Wextra -Wvla -o main -lcriterion'
alias vlg='valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes'
alias vlgv='valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose'
alias count_line='S=0; for file in $(find -name "*.c" -o -name "*.h" -o -name "*.sh"); do S1=$(wc -l < $file); echo -e $file $S1; S=$(($S1 + $S)); done; echo $S'
# -pedantic -Werror

View File

@ -1,6 +1,6 @@
[General] [General]
contrastOpacity=163 contrastOpacity=163
drawColor=#1e0000 drawColor=#2c2321
savePath=/home/grimhilt/Documents/spe/international savePath=/home/grimhilt/Documents/spe/international
showHelp=false showHelp=false
showStartupLaunchMessage=false showStartupLaunchMessage=false

51
.config/i3lock/lock.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/sh
# Background (--color=rrggbb or --image=path)
#BACKGROUND="--image=${HOME}/wallpaper-lock.jpg"
# Foreground color (rrggbbaa)
COLOR_FG="ffffffff"
COLOR_SCREEN="000000ff";
# Ring color during incorrect password flash (rrggbbaa)
COLOR_RINGWRONG="ff0000ff";
COLOR_TEXT="ffffffff";
# Date string format (see `man strftime.3`)
FORMAT_DATE="%A, %B %e"
FORMAT_TIME="%H:%M"
# Main font (for time and greeter)
FONT="sans-serif:light"
# Alternative font (for date)
FONT_ALT="sans-serif:thin"
# Time font size
SIZE_TIME=144
# Date font size
SIZE_DATE=48
# "${BACKGROUND}" \
i3lock-color \
--force-clock \
--ignore-empty-password \
--screen=0 \
--color="${COLOR_SCREEN}" \
--show-failed-attempts \
--inside-color="${COLOR_SCREEN}" \
--ring-color="${COLOR_SCREEN}" \
--insidever-color="${COLOR_SCREEN}" \
--ringver-color="${COLOR_SCREEN}" \
--insidewrong-color="${COLOR_SCREEN}" \
--ringwrong-color="${COLOR_RINGWRONG}" \
--layout-color="${COLOR_TEXT}" \
--time-color="${COLOR_TEXT}" \
--date-color="${COLOR_TEXT}" \
--greeter-color="${COLOR_TEXT}" \
--date-str="${FORMAT_DATE}" \
--time-str="${FORMAT_TIME}" \
--noinput-text="clear" \
--pass-screen-keys \
--pass-power-keys \
--pass-volume-keys \
--radius=105 \

View File

@ -0,0 +1,18 @@
{ pkgs ? import <nixpkgs> {} }:
let
dotnet_pkgs = pkgs.dotnet-sdk_7;
in pkgs.stdenv.mkDerivation {
src = ./src;
name = "rider";
buildInputs = [
dotnet_pkgs
pkgs.jetbrains.rider
pkgs.mono
pkgs.msbuild
];
shellHook = ''
export DOTNET_ROOT="${dotnet_pkgs}"
'';
}

View File

@ -0,0 +1,39 @@
{ lib, fetchFromGitHub, rustPlatform, pkgconfig, openssl, ... }:
let
pkgs = import <nixpkgs> {};
in
rustPlatform.buildRustPackage rec {
pname = "nextsync";
version = "master";
#version = "0.1.0";
nativeBuildInputs = with pkgs; [
pkg-config
openssl
];
buildPhase = ''
export PKG_CONFIG_PATH="${openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"
'';
src = fetchFromGitHub {
owner = "grimhilt";
repo = pname;
rev = version;
sha256 = lib.fakeSha256;
#"sha256-WIpbaaNZiYZd6ja6BB/fCem4yji0nY50XT4Aaox/vxw=";
};
cargoSha256 = lib.fakeSha256;
#"sha256-VDWR+f/nisv3uzyFsbzAc3K9dyBnahNwRuang4Z4buw=";
meta = with lib; {
description = "A fast line-oriented regex search tool, similar to ag and ack";
homepage = "https://github.com/grimhilt/nextsync";
license = licenses.unlicense;
maintainers = [];
};
}
#nix-build -E "with import <nixpkgs> {}; callPackage ./default.nix {}"

View File

@ -17,6 +17,10 @@ in
valgrind valgrind
xorg.xcbutil xorg.xcbutil
xorg.xcbutilkeysyms xorg.xcbutilkeysyms
criterion
clang-tools_16
python311Packages.pip
dash
]; ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config pkg-config

View File

@ -0,0 +1,8 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
ghc
];
}

View File

@ -0,0 +1,8 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
sbcl
];
}

View File

@ -6,6 +6,7 @@ vim.o.softtabstop = 4
vim.o.shiftwidth = 4 vim.o.shiftwidth = 4
vim.o.expandtab = true vim.o.expandtab = true
vim.o.smartindent = true vim.o.smartindent = true
vim.o.autoread = true
--vim.keymap.set({"n", "v", "i"}, "<leader><leader>", "<Esc>", {noremap = true}) --vim.keymap.set({"n", "v", "i"}, "<leader><leader>", "<Esc>", {noremap = true})

View File

@ -27,7 +27,7 @@ font-1 = FontAwesome6FreeSolid:size=12;3
modules-left = bspwm-desktops window-title modules-left = bspwm-desktops window-title
modules-center = cpu memory disk modules-center = cpu memory disk
modules-right = battery wired-network wireless-network pulseaudio-volume date-and-time modules-right = keyboard-layout battery wired-network wireless-network pulseaudio-volume date-and-time
locale = en_US.UTF-8 locale = en_US.UTF-8

11
.config/sxhkd/switch_layout.sh Executable file
View File

@ -0,0 +1,11 @@
# !/bin/bash
# Switching between keyboard layouts
CURRENT_LAYOUT=$(setxkbmap -query | awk 'NR==3{print $2}')
if [ "$CURRENT_LAYOUT" = "us" ]; then
setxkbmap "fr"
else
setxkbmap "us"
fi

View File

@ -2,6 +2,9 @@
# WM-independent hotkeys # WM-independent hotkeys
# #
ctrl + q
echo ""
# Terminal emulator # Terminal emulator
super + Return super + Return
alacritty alacritty
@ -24,6 +27,9 @@ Print
shift + Print shift + Print
flameshot gui flameshot gui
super + space
~/.config/sxhkd/switch_layout.sh
# Lock screen # Lock screen
ctrl + alt + l ctrl + alt + l
~/.config/i3lock/lock.sh ~/.config/i3lock/lock.sh
@ -110,7 +116,7 @@ super + shift + {h, j, k, l}
# Focus/Send to the given desktop # Focus/Send to the given desktop
#super + {_,shift + }{ampersand,eacute,quotedbl,apostrophe,parenleft,minus,egrave,underscore,ccedilla,agrave} #super + {_,shift + }{ampersand,eacute,quotedbl,apostrophe,parenleft,minus,egrave,underscore,ccedilla,agrave}
super + {_,shift + }{ampersand,eacute,quotedbl,apostrophe,parenleft,a,z,e,r,t,y} super + {_,shift + }{ampersand,eacute,quotedbl,apostrophe,parenleft,a,z,e,r}
bspc {desktop -f,node -d} '^{1-9,10,11}' bspc {desktop -f,node -d} '^{1-9,10,11}'
# Focus the node for the given path jump # Focus the node for the given path jump