change noctalia theming, refactor brightness script
This commit is contained in:
9 files changed
+223
-89
No files matched your search
@@ -11,7 +11,19 @@ in {
|
||||
|
||||
flake.homeModules.global = { pkgs, lib, config, ... }: {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
|
||||
programs.zsh.initContent = lib.mkOrder 1500 ''
|
||||
SESSION_TYPE=local
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
SESSION_TYPE=remote/ssh
|
||||
else
|
||||
case $(ps -o comm= -p "$PPID") in
|
||||
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
|
||||
esac
|
||||
fi
|
||||
if [ "$SESSION_TYPE" != "remote/ssh" ]; then
|
||||
fastfetch
|
||||
fi
|
||||
'';
|
||||
programs.fastfetch.enable = true;
|
||||
}) ];
|
||||
};
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
packages = with pkgs; [
|
||||
speedtest-go
|
||||
bitwarden-cli
|
||||
nixd
|
||||
nixfmt
|
||||
] ++ config.features.applications.extraPackages
|
||||
++ (if config.info.isStandalone then [
|
||||
pkgs.home-manager
|
||||
|
||||
@@ -59,8 +59,6 @@
|
||||
busybox
|
||||
ethtool
|
||||
hyperfine
|
||||
nixd
|
||||
nixfmt
|
||||
] ++ config.features.applications.extraPackages;
|
||||
|
||||
programs = {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
extraConfig = ''
|
||||
include ${config.xdg.configHome}/kitty/themes/noctalia.conf
|
||||
include ${config.xdg.configHome}/kitty/current-theme.conf
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
enable = true;
|
||||
spicetify = {
|
||||
enable = true;
|
||||
theme = "comfy";
|
||||
};
|
||||
};
|
||||
thunderbird.enable = true;
|
||||
@@ -75,26 +74,11 @@
|
||||
nix-init
|
||||
];
|
||||
|
||||
shellScripts = let
|
||||
mkBrightnessScript = direction: scriptName: ''
|
||||
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//')
|
||||
WRITTEN="foo"
|
||||
CONTROL="bar"
|
||||
while [[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 3 ]; do
|
||||
RESULT=$(sudo ddccontrol -r 0x10 -W ${direction}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))
|
||||
done
|
||||
|
||||
notify-send -e -a "${scriptName}" "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
||||
'';
|
||||
in {
|
||||
shellScripts = {
|
||||
switch-os = ''
|
||||
sudo efibootmgr --bootnext 0000
|
||||
sudo reboot
|
||||
if sudo efibootmgr --bootnext 0000 >/dev/null; then
|
||||
sudo reboot
|
||||
fi
|
||||
'';
|
||||
|
||||
universal-reboot = ''
|
||||
@@ -117,9 +101,36 @@
|
||||
fi
|
||||
'';
|
||||
|
||||
increase-brightness = mkBrightnessScript "+" "increase-brightness script";
|
||||
brightnessctl = ''
|
||||
LOOP_COUNTER=0
|
||||
|
||||
if [ "$1" == "1" ]; then
|
||||
DEVICE="/dev/i2c-10"
|
||||
elif [ "$1" == "2" ]; then
|
||||
DEVICE="/dev/i2c-6"
|
||||
else
|
||||
DEVICE=$1
|
||||
fi
|
||||
|
||||
decrease-brightness = mkBrightnessScript "-" "decrease-brightness script";
|
||||
MODE_TEST=$(echo "$2" | grep -oP '^\D')
|
||||
if [ "$MODE_TEST" == "+" ] || [ "$MODE_TEST" == "-" ]; then
|
||||
MODE="-W"
|
||||
else
|
||||
MODE="-w"
|
||||
fi
|
||||
|
||||
PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//')
|
||||
WRITTEN="foo"
|
||||
CONTROL="bar"
|
||||
while [[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 3 ]; do
|
||||
RESULT=$(sudo ddccontrol -r 0x10 $MODE $2 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))
|
||||
done
|
||||
|
||||
notify-send -e -a "brightnessctl script" "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user