···11+{
22+ pkgs,
33+ self,
44+ ...
55+}:
66+77+{
88+ home.packages = with pkgs; [
99+ postman
1010+ gearlever # for beeper cause the one from the nixpkgs seems bugged
1111+ strawberry # for itunes lib and need to test if upload to ipod works
1212+ self.packages.${pkgs.system}.adjust-brightness # for adjusting brightness on ddc/ci screen
1313+ ];
1414+}
···11+{
22+ pkgs,
33+ self,
44+ ...
55+}:
66+77+{
88+ home.packages = with pkgs; [
99+ postman
1010+ mockoon
1111+ gearlever # for beeper cause the one from the nixpkgs seems bugged
1212+ strawberry # for itunes lib and need to test if upload to ipod works
1313+ brightnessctl
1414+ prismlauncher
1515+ jellyfin-media-player
1616+ self.packages.${pkgs.system}.adjust-brightness
1717+ ];
1818+}
···11+{
22+ pkgs ? import <nixpkgs> { },
33+}:
44+55+pkgs.writeShellScriptBin "adjust-brightness" ''
66+ #!/bin/sh
77+88+ # Check if the correct number of arguments is provided
99+ if [ "$#" -ne 2 ]; then
1010+ echo "Usage: $0 <display_number> <brightness_value_or_adjustment>"
1111+ exit 1
1212+ fi
1313+1414+ DISPLAY=$1
1515+ VALUE_OR_ADJUSTMENT=$2
1616+1717+ # Get the current brightness value
1818+ CURRENT=$(ddcutil getvcp 10 --display=$DISPLAY | grep -oP 'current value =\s*\K\d+')
1919+2020+ # Check if the adjustment is relative (+ or -)
2121+ if [[ "$VALUE_OR_ADJUSTMENT" =~ ^[+-] ]]; then
2222+ # Calculate the new brightness value
2323+ NEW_BRIGHTNESS=$((CURRENT + VALUE_OR_ADJUSTMENT))
2424+ else
2525+ # Set the brightness to the specified value
2626+ NEW_BRIGHTNESS=$VALUE_OR_ADJUSTMENT
2727+ fi
2828+2929+ # Ensure the new brightness is within the valid range (0-100)
3030+ if [ "$NEW_BRIGHTNESS" -lt 0 ]; then
3131+ NEW_BRIGHTNESS=0
3232+ elif [ "$NEW_BRIGHTNESS" -gt 100 ]; then
3333+ NEW_BRIGHTNESS=100
3434+ fi
3535+3636+ # Set the new brightness value
3737+ ddcutil setvcp 10 $NEW_BRIGHTNESS --display=$DISPLAY
3838+3939+ echo "Brightness for display $DISPLAY changed to $NEW_BRIGHTNESS"
4040+''