72 lines
2.5 KiB
Nix
72 lines
2.5 KiB
Nix
{ inputs, self, ... }: {
|
|
flake.homeConfigurations.takamaki = inputs.home-manager.lib.homeManagerConfiguration {
|
|
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
|
modules = with self.homeModules; [
|
|
global
|
|
graphics
|
|
takamaki
|
|
];
|
|
};
|
|
|
|
flake.homeModules.takamaki = { pkgs, config, lib, ... }: {
|
|
info = {
|
|
rootPath = "/home/grey/flake";
|
|
hostName = "takamaki";
|
|
stateVersion = "26.11";
|
|
};
|
|
|
|
features = {
|
|
shells.zsh = {
|
|
enable = true;
|
|
antidote.enable = true;
|
|
};
|
|
|
|
applications = {
|
|
cli = {
|
|
fastfetch.enable = true;
|
|
};
|
|
|
|
extraPackages = with pkgs; [
|
|
(writeShellScriptBin "switch-os" ''
|
|
sudo efibootmgr --bootnext 0000
|
|
sudo reboot
|
|
'')
|
|
(writeShellScriptBin "universal-reboot" ''
|
|
sudo reboot
|
|
'')
|
|
(writeShellScriptBin "universal-shutdown" ''
|
|
sudo systemctl poweroff
|
|
'')
|
|
(writeShellScriptBin "increase-brightness" ''
|
|
LOOP_COUNTER=0
|
|
DEVICE=$1
|
|
PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//')
|
|
while
|
|
RESULT=$(sudo ddccontrol -r 0x10 -W +5 dev:$DEVICE 2> /dev/null)
|
|
WRITTEN=$(echo $RESULT | grep -oP "Writing.+\(\K\d{1,3}\)" | sed 's/)//')
|
|
CONTROL=$(echo $RESULT | grep -oP "Control.+\+/\K\d{1,3}/100" | sed 's/\/100//')
|
|
LOOP_COUNTER=$(($LOOP_COUNTER + 1))
|
|
[[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 10 ]
|
|
do true; done
|
|
|
|
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
|
'')
|
|
(writeShellScriptBin "decrease-brightness" ''
|
|
LOOP_COUNTER=0
|
|
DEVICE=$1
|
|
PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//')
|
|
while
|
|
RESULT=$(sudo ddccontrol -r 0x10 -W -5 dev:$DEVICE 2> /dev/null)
|
|
WRITTEN=$(echo $RESULT | grep -oP "Writing.+\(\K\d{1,3}\)" | sed 's/)//')
|
|
CONTROL=$(echo $RESULT | grep -oP "Control.+\+/\K\d{1,3}/100" | sed 's/\/100//')
|
|
LOOP_COUNTER=$(($LOOP_COUNTER + 1))
|
|
[[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 10 ]
|
|
do true; done
|
|
|
|
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
|
'')
|
|
];
|
|
};
|
|
};
|
|
};
|
|
} |