Skip to content

Commit

Permalink
hyprland scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
suderman committed Jul 23, 2024
1 parent ec2e7e2 commit ac51d5d
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 16 deletions.
11 changes: 0 additions & 11 deletions modules/hyprland/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ in {
hyprland = "Hyprland";
};

# home.packages = let
# inherit (builtins) attrNames readDir;
# inherit (lib) filterAttrs hasSuffix mkShellScript removeSuffix;
# inputs = with pkgs; [ hyprland jq ];
# scripts = attrNames (filterAttrs (n: v: v == "regular" && hasSuffix ".sh" n) (readDir ./bin));
# in map ( name: ( mkShellScript {
# inherit inputs;
# name = removeSuffix ".sh" name;
# text = ./bin/${name};
# } ) ) scripts;

home.packages = with pkgs; [ nerdfonts ];

# Add target that is enabled by exec-once at the top of the configuration
Expand Down
2 changes: 1 addition & 1 deletion modules/hyprland/programs/waybar/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
color: #ffffff;
font-size: 16px;
transition: all 0.3s;
letter-spacing: 2px;
letter-spacing: 4px;
font-size: 17px;
font-family: monospace;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,24 @@ if [ -z "${1-}" ]; then
# extra sinks added to copy of file
cat $dir/detected > $dir/appended
while read sink; do

# ensure this extra sink wasn't already detected
if [[ -z "$(grep $sink $dir/detected)" ]]; then

# Add the sink to the list, formatted nice for rofi
# extra_sink "$sink" >> $dir/appended
icon="audio-off"
echo -n "$(named_sink $sink)\\0icon\\x1f${icon}\\x1finfo\\x1f${sink}" >> $dir/appended

fi
done < $dir/extra

# output sinks, filtering any sinks to be hidden
filter=$(sed -z s/.$// $dir/hidden | tr '\n' '|' )
filter="$(sed -z s/.$// $dir/hidden | tr '\n' '|' )"

# if there are no hidden sinks to filter, just output appended
if [[ -z "$filter" ]]; then
echo -en "$(cat $dir/appended)"

# if there are, filter with grep
else
echo -en "$(grep -vE "${filter}" $dir/appended)"
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions modules/hyprland/settings/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
inherit (lib) filterAttrs hasSuffix mkIf mkShellScript removeSuffix;

inputs = with pkgs; [
bluez
config.programs.rofi.finalPackage
coreutils
gawk
gettext
gnugrep
gnused
grim
hyprland
Expand All @@ -17,6 +19,7 @@
keyd
libnotify
procps
pulseaudio
slurp
socat
swappy
Expand All @@ -25,7 +28,7 @@

scripts = attrNames( filterAttrs
( n: v: v == "regular" && hasSuffix ".sh" n)
( readDir ../bin )
( readDir ../scripts )
);

in {
Expand All @@ -36,7 +39,7 @@ in {
mkShellScript {
inherit inputs;
name = removeSuffix ".sh" name;
text = ../bin/${name};
text = ../scripts/${name};
}
)) scripts;

Expand Down

0 comments on commit ac51d5d

Please sign in to comment.