Changed a bunch of packages installed through home manager

Added brightness and volume scripts to bind to media keys. Still imperfect
Refactored to put neovim in its own file, will do the same for others
This commit is contained in:
vorboyvo 2024-01-15 14:11:14 -05:00
parent 0495eb84c2
commit 770b7d23e9
7 changed files with 60 additions and 22 deletions

View file

@ -113,9 +113,10 @@
'';
# Allow steam to run nonfree
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"steam" "steam-original" "steam-run"
];
# nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
# "steam" "steam-original" "steam-run" "zoom-5.16.10.668"
# ];
nixpkgs.config.allowUnfreePredicate = _: true;
# List packages installed in system profile. To search, run:
# $ nix search wget

View file

@ -7,22 +7,25 @@
home.stateVersion = "23.11";
# Configure cursor
# home.pointerCursor = {
# package = pkgs.vanilla-dmz;
# name = "Vanilla-DMZ";
# size = 64;
# };
home.pointerCursor = {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
size = 256;
};
# Install packages
home.packages = with pkgs;
[ texliveFull ] ++ # TeX distribution
[ ocaml ] ++ # OCaml
[ grim slurp wl-clipboard jq ] ++ # Basic utilities
[ bitwarden-cli ] ++ # Personalized selection of command-line (CLI/TUI) apps
[ kitty ] ++ # Terminal emulator
[ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller vlc pavucontrol ] ++ # Basic graphical apps
[ libreoffice signal-desktop prismlauncher apostrophe ] ++ # Personalized selection of graphical apps
[ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller imv vlc pavucontrol grim slurp wl-clipboard ] ++ # Basic graphical apps
[ libreoffice signal-desktop element-desktop prismlauncher mumble ] ++ # Personalized selection of graphical apps
[ bemenu j4-dmenu-desktop ] ++ # Sway-related packages
[ noto-fonts redhat-official-fonts overpass ]; # Fonts
# [ vanilla-dmz ]; # Cursor
[ noto-fonts redhat-official-fonts overpass ] ++ # Fonts
# [ vanilla-dmz ] ++ # Cursor
[ ];
programs.home-manager.enable = true;
@ -72,12 +75,7 @@
shellIntegration.enableZshIntegration = true;
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
programs.neovim = import ./programs/neovim.nix;
programs.zathura = {
enable = true;

6
programs/neovim.nix Normal file
View file

@ -0,0 +1,6 @@
{
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
}

5
todo
View file

@ -1,8 +1,7 @@
enable NUR and firefox extensions
# enable NUR and firefox extensions
split app configs off into separate files
switch to zsh
fix brightness switching as non root
set up a keyring and store networkmanager wifi passwords in there instead of plain text
fnott: notifications
neovim and vimtex config
set up screenshots
mute button

View file

@ -0,0 +1,16 @@
bright=`cat /sys/class/backlight/amdgpu_bl0/brightness`
state=-1
thresh=(1 2 3 4 5 6 8 10 13 16 21 27 34 44 57 73 94 120 155 199 255)
for i in ${!thresh[@]}; do
if [ $bright -ge ${thresh[$i]} ]
then
state=$i
fi
done
new=$(($1 + $state))
if [ $new -ge 0 ] && [ $new -le 20 ]
then
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl0/brightness
fi

1
wayland/dynscreenshot.sh Normal file
View file

@ -0,0 +1 @@
shotpath="Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; slurp | grim -g - $shotpath && wl-copy < $shotpath

View file

@ -1,6 +1,11 @@
{ config, lib, pkgs, ... }:
{
let
dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile ./dynscreenshot.sh);
changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile ./changebrightness.sh);
mod = config.wayland.windowManager.sway.config.modifier;
in {
enable = true;
config = rec {
terminal = "kitty";
@ -20,6 +25,18 @@
border = 2;
titlebar = true;
};
keybindings = let screenshotPath = "Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; in lib.mkOptionDefault ({ # Screenshot keybinds
"Print" = "exec grim ${screenshotPath} && wl-copy < ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard
"Shift+Print" = "exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | \"\\(.x),\\(.y) \\(.width)x\\(.height)\"' | grim -g - ${screenshotPath} && wl-copy < ${screenshotPath}"; # Take screenshot of current window, save it, and copy it to clipboard
"Ctrl+Print" = "exec bash ${dynscreenshot}"; # Take screenshot of selection, save it, and copy it to clipboard
} // { # Function Media Keys
XF86MonBrightnessUp = "exec bash ${changebrightness} 1";
XF86MonBrightnessDown = "exec bash ${changebrightness} -1";
XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+";
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-";
"${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";
"${mod}+XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-";
});
menu = "j4-dmenu-desktop --no-generic --term=kitty --dmenu='bemenu -i --fn Red Hat Display 12 -H 24 -p \"\" -B 2 --hp 5'"; # I don't like hardcoding kitty here, TODO think of better way to do it
focus.followMouse = false;
};