diff --git a/.bashrc b/.bashrc index 17d1d88..c309469 100644 --- a/.bashrc +++ b/.bashrc @@ -1,4 +1,5 @@ +alias gi='git init' alias gs='git status' alias gl='git log' alias ga='git add' @@ -8,6 +9,25 @@ alias gt='git tag -ma' alias gp='git push' alias gpt='git push --follow-tags' 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 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 diff --git a/.config/flameshot/flameshot.ini b/.config/flameshot/flameshot.ini index 3b16146..b735b7d 100644 --- a/.config/flameshot/flameshot.ini +++ b/.config/flameshot/flameshot.ini @@ -1,6 +1,6 @@ [General] contrastOpacity=163 -drawColor=#1e0000 +drawColor=#2c2321 savePath=/home/grimhilt/Documents/spe/international showHelp=false showStartupLaunchMessage=false diff --git a/.config/i3lock/lock.sh b/.config/i3lock/lock.sh new file mode 100755 index 0000000..806c980 --- /dev/null +++ b/.config/i3lock/lock.sh @@ -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 \ diff --git a/.config/nixpkgs/csharp.nix b/.config/nixpkgs/csharp.nix new file mode 100644 index 0000000..3364047 --- /dev/null +++ b/.config/nixpkgs/csharp.nix @@ -0,0 +1,18 @@ +{ pkgs ? import {} }: + +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}" + ''; +} + diff --git a/.config/nixpkgs/nextsync.nix b/.config/nixpkgs/nextsync.nix new file mode 100644 index 0000000..afbcaa2 --- /dev/null +++ b/.config/nixpkgs/nextsync.nix @@ -0,0 +1,39 @@ +{ lib, fetchFromGitHub, rustPlatform, pkgconfig, openssl, ... }: + +let + pkgs = import {}; +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 {}; callPackage ./default.nix {}" diff --git a/.config/nixshell/c.nix b/.config/nixshell/c.nix index a9b3c86..77cfcb8 100644 --- a/.config/nixshell/c.nix +++ b/.config/nixshell/c.nix @@ -17,6 +17,10 @@ in valgrind xorg.xcbutil xorg.xcbutilkeysyms + criterion + clang-tools_16 + python311Packages.pip + dash ]; nativeBuildInputs = with pkgs; [ pkg-config diff --git a/.config/nixshell/haskell.nix b/.config/nixshell/haskell.nix new file mode 100644 index 0000000..c4fcc1f --- /dev/null +++ b/.config/nixshell/haskell.nix @@ -0,0 +1,8 @@ +let + pkgs = import {}; +in + pkgs.mkShell { + buildInputs = with pkgs; [ + ghc + ]; + } diff --git a/.config/nixshell/lisp.nix b/.config/nixshell/lisp.nix new file mode 100644 index 0000000..978e575 --- /dev/null +++ b/.config/nixshell/lisp.nix @@ -0,0 +1,8 @@ +let + pkgs = import {}; +in + pkgs.mkShell { + buildInputs = with pkgs; [ + sbcl + ]; + } diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4052acf..7f59eb0 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -6,6 +6,7 @@ vim.o.softtabstop = 4 vim.o.shiftwidth = 4 vim.o.expandtab = true vim.o.smartindent = true +vim.o.autoread = true --vim.keymap.set({"n", "v", "i"}, "", "", {noremap = true}) diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index eb66377..76d35b2 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini @@ -27,7 +27,7 @@ font-1 = FontAwesome6FreeSolid:size=12;3 modules-left = bspwm-desktops window-title 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 diff --git a/.config/sxhkd/switch_layout.sh b/.config/sxhkd/switch_layout.sh new file mode 100755 index 0000000..c740216 --- /dev/null +++ b/.config/sxhkd/switch_layout.sh @@ -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 + diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index fca7f5e..af10457 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -2,6 +2,9 @@ # WM-independent hotkeys # +ctrl + q + echo "" + # Terminal emulator super + Return alacritty @@ -24,6 +27,9 @@ Print shift + Print flameshot gui +super + space + ~/.config/sxhkd/switch_layout.sh + # Lock screen ctrl + alt + l ~/.config/i3lock/lock.sh @@ -110,7 +116,7 @@ super + shift + {h, j, k, l} # 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,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}' # Focus the node for the given path jump