Skip to content

Commit

Permalink
watever happened here
Browse files Browse the repository at this point in the history
  • Loading branch information
orangci committed Nov 4, 2024
1 parent 2b016ae commit 09709dc
Show file tree
Hide file tree
Showing 8 changed files with 525 additions and 35 deletions.
482 changes: 461 additions & 21 deletions flake.lock

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
# nixvim = {
# url = "github:orangci/nixvim";
# inputs.nixpkgs.follows = "nixpkgs";
# };
hyprland.url = "github:hyprwm/Hyprland";
nixvim.url = "github:orangci/nixvim";
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -24,7 +21,6 @@
outputs = inputs @ {
nixpkgs,
home-manager,
hyprpanel,
...
}: let
system = "x86_64-linux";
Expand All @@ -35,7 +31,7 @@
inherit system;
config.allowUnfree = true;
overlays = [
hyprpanel.overlay
inputs.hyprpanel.overlay
];
};
in {
Expand Down
6 changes: 4 additions & 2 deletions hm-modules/core/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ in {
fi
'';
shellAliases = {
sv = "sudio nix run github:orangci/nixvim";
v = "nix run github:orangci/nixvim";
# sv = "sudio nix run github:orangci/nixvim";
# v = "nix run github:orangci/nixvim";
sv = "sudo nvim";
v = "nvim";
mc = "micro";
fr = "sudo echo Shikanoko Nokonoko Koshitantan;nh os switch --hostname ${host} /home/${username}/dots";
frfr = "sudo echo Shikanoko Nokonoko Koshitantan;nh os switch --hostname ${host} /home/${username}/dots;notify-send Rebuilt;nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot;notify-send Cleaned;exit";
Expand Down
4 changes: 2 additions & 2 deletions hm-modules/core/boilerplate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pkgs,
username,
host,
# inputs,
inputs,
...
}: let
gitUsername = "orangci";
Expand All @@ -11,7 +11,7 @@ in {
home = {
username = "${username}";
homeDirectory = "/home/${username}";
packages = [pkgs.hyprpanel]; # inputs.nixvim.packages.${pkgs.system}.default
packages = [pkgs.hyprpanel inputs.nixvim.packages.${pkgs.system}.default];
stateVersion = "24.11";
file = {
".local/share/fonts" = {
Expand Down
1 change: 1 addition & 0 deletions hm-modules/programs/hyprland/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ bind = SUPER,D,exec,discord
bind = SUPER,G,exec,chromium
bind = SUPER,E,exec,thunar
bind = SUPER,O,exec,screenrec
bind = SUPERALT,O,exec, screenrec mic
bind = SUPERSHIFT,O,exec,pkill wl-screenrec
bind = SUPER,K,exec,rofi -show drun # application launcher rofi
bind = SUPER,R,exec,rofi -show run -theme run.rasi # run individual commands with rofi
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
yad
grim
slurp
wayfreeze
# wayfreeze
nh
brightnessctl
btop
Expand Down
44 changes: 44 additions & 0 deletions scripts/rofi/wall-select.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pkgs.writeShellScriptBin "wall-select" ''
"$HOME/media/walls"
"$HOME/media/walls-catppuccin-mocha"
"anibg"
"anibg2"
)
# Default folder for the --fast option
Expand Down Expand Up @@ -49,6 +50,49 @@ pkgs.writeShellScriptBin "wall-select" ''
exit 0
fi
# Special case: when 'anibg2' is selected
if [ "$selected_folder" == "anibg2" ]; then
# API URLs for wallpaper sources
api_url1="https://api.github.com/repos/dharmx/walls/contents/animated"
api_url2="https://api.github.com/repos/dharmx/walls/contents/anime"
# Temporary download directory
download_dir="/tmp/anibg2_walls"
mkdir -p "$download_dir"
# Randomly select one of the API URLs
selected_api_url=$(shuf -e "$api_url1" "$api_url2" -n 1)
# Fetch the list of images from the selected folder
image_urls=$(curl -s "$selected_api_url" | jq -r '.[] | select(.type == "file") | select(.name | test("\\.(jpg|jpeg|png|bmp|gif)$")) | .download_url')
# Check if there are any images in the folder
if [ -z "$image_urls" ]; then
echo "No images found in the selected folder."
exit 1
fi
# Randomly select an image URL from the list
random_image_url=$(echo "$image_urls" | shuf -n 1)
# Define the temporary image path
temp_image="$download_dir/$(basename "$random_image_url")"
# Download the selected image
if ! curl -s -f "$random_image_url" -o "$temp_image"; then
echo "Failed to download wallpaper from $random_image_url"
exit 1
fi
# Set the wallpaper and record path
swww img "$temp_image" --transition-type random --transition-fps 60
echo "Anime wallpaper set from $random_image_url"
echo "\$WALLPAPER=$temp_image" > /tmp/.current_wallpaper_path_hyprlock
echo "$temp_image" > /tmp/.current_wallpaper_path
exit 0
fi
# Get image files in the selected folder
images=($(ls "$selected_folder" | grep -E '\.(jpg|jpeg|png|bmp|gif)$' | sort))
Expand Down
11 changes: 9 additions & 2 deletions scripts/screenrec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ pkgs.writeShellScriptBin "screenrec" ''
# Define the audio sink (adjust this to match your system's default audio sink)
audio_sink="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"
# Start fullscreen recording with system audio
wl-screenrec -f "$output_file" --audio --audio-device "$audio_sink" &
# Check if "mic" argument is passed
if [ "$1" = "mic" ]; then
audio_option=""
else
audio_option="--audio-device $audio_sink"
fi
# Start fullscreen recording with system audio if "mic" isn't specified
wl-screenrec -f "$output_file" --audio $audio_option &
recorder_pid=$!
# Send a notification that recording is starting
Expand Down

0 comments on commit 09709dc

Please sign in to comment.