forked from Shinonome/dots-hyprland
added
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
description = "Development shell for switchwall.sh";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
flake-utils.url = "github.com/numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
pythonWithPackages = pkgs.python3.withPackages (ps:
|
||||||
|
with ps; [
|
||||||
|
materialyoucolor
|
||||||
|
pillow
|
||||||
|
]);
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
pkgs.bash
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.imagemagick # Provides the 'identify' command
|
||||||
|
pkgs.ffmpeg
|
||||||
|
pkgs.mpvpaper
|
||||||
|
pkgs.kitty # The terminal used in the script
|
||||||
|
pkgs.kdialog
|
||||||
|
pkgs.libnotify # Provides notify-send
|
||||||
|
pkgs.hyprpicker
|
||||||
|
pkgs.matugen
|
||||||
|
pythonWithPackages
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
|
export XDG_CACHE_HOME=$HOME/.cache
|
||||||
|
export XDG_STATE_HOME=$HOME/.local/state
|
||||||
|
export ILLOGICAL_IMPULSE_VIRTUAL_ENV=$XDG_STATE_HOME/quickshell/.venv
|
||||||
|
export PATH=$PATH:${pkgs.matugen}/bin
|
||||||
|
export SCRIPT_DIR=$(pwd)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# Execute the switchwall.sh script within the Nix environment.
|
||||||
|
nix develop --command ./switchwall.sh "$@"
|
||||||
@@ -63,9 +63,9 @@ post_process() {
|
|||||||
# echo "Error: least_busy_region.py script not found in $MATUGEN_DIR/scripts/"
|
# echo "Error: least_busy_region.py script not found in $MATUGEN_DIR/scripts/"
|
||||||
# else
|
# else
|
||||||
# "$MATUGEN_DIR/scripts/least_busy_region.py" \
|
# "$MATUGEN_DIR/scripts/least_busy_region.py" \
|
||||||
# --screen-width "$screen_width" --screen-height "$screen_height" \
|
# --screen-width "$screen_width" --screen-height "$screen_height" \
|
||||||
# --width 300 --height 200 \
|
# --width 300 --height 200 \
|
||||||
# "$wallpaper_path" > "$STATE_DIR"/user/generated/wallpaper/least_busy_region.json
|
# "$wallpaper_path" > "$STATE_DIR"/user/generated/wallpaper/least_busy_region.json
|
||||||
# fi
|
# fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,18 +85,18 @@ check_and_prompt_upscale() {
|
|||||||
fi
|
fi
|
||||||
if [[ "$img_width" -lt "$min_width_desired" || "$img_height" -lt "$min_height_desired" ]]; then
|
if [[ "$img_width" -lt "$min_width_desired" || "$img_height" -lt "$min_height_desired" ]]; then
|
||||||
action=$(notify-send "Upscale?" \
|
action=$(notify-send "Upscale?" \
|
||||||
"Image resolution (${img_width}x${img_height}) is lower than screen resolution (${min_width_desired}x${min_height_desired})" \
|
"Image resolution (${img_width}x${img_height}) is lower than screen resolution (${min_width_desired}x${min_height_desired})" \
|
||||||
-A "open_upscayl=Open Upscayl"\
|
-A "open_upscayl=Open Upscayl"\
|
||||||
-a "Wallpaper switcher")
|
-a "Wallpaper switcher")
|
||||||
if [[ "$action" == "open_upscayl" ]]; then
|
if [[ "$action" == "open_upscayl" ]]; then
|
||||||
if command -v upscayl &>/dev/null; then
|
if command -v upscayl &>/dev/null; then
|
||||||
nohup upscayl > /dev/null 2>&1 &
|
nohup upscayl > /dev/null 2>&1 &
|
||||||
else
|
else
|
||||||
action2=$(notify-send \
|
action2=$(notify-send \
|
||||||
-a "Wallpaper switcher" \
|
-a "Wallpaper switcher" \
|
||||||
-c "im.error" \
|
-c "im.error" \
|
||||||
-A "install_upscayl=Install Upscayl (Arch)" \
|
-A "install_upscayl=Install Upscayl (Arch)" \
|
||||||
"Install Upscayl?" \
|
"Install Upscayl?" \
|
||||||
"yay -S upscayl-bin")
|
"yay -S upscayl-bin")
|
||||||
if [[ "$action2" == "install_upscayl" ]]; then
|
if [[ "$action2" == "install_upscayl" ]]; then
|
||||||
kitty -1 yay -S upscayl-bin
|
kitty -1 yay -S upscayl-bin
|
||||||
@@ -204,10 +204,10 @@ switch() {
|
|||||||
echo "Missing deps: ${missing_deps[*]}"
|
echo "Missing deps: ${missing_deps[*]}"
|
||||||
echo "Arch: sudo pacman -S ${missing_deps[*]}"
|
echo "Arch: sudo pacman -S ${missing_deps[*]}"
|
||||||
action=$(notify-send \
|
action=$(notify-send \
|
||||||
-a "Wallpaper switcher" \
|
-a "Wallpaper switcher" \
|
||||||
-c "im.error" \
|
-c "im.error" \
|
||||||
-A "install_arch=Install (Arch)" \
|
-A "install_arch=Install (Arch)" \
|
||||||
"Can't switch to video wallpaper" \
|
"Can't switch to video wallpaper" \
|
||||||
"Missing dependencies: ${missing_deps[*]}")
|
"Missing dependencies: ${missing_deps[*]}")
|
||||||
if [[ "$action" == "install_arch" ]]; then
|
if [[ "$action" == "install_arch" ]]; then
|
||||||
kitty -1 sudo pacman -S "${missing_deps[*]}"
|
kitty -1 sudo pacman -S "${missing_deps[*]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user