Gen 444: Consolidated desktop/laptop configs into one, differing options are declared in hosts folder
This commit is contained in:
15
modules/home/scripts/commands/compress.nix
Normal file
15
modules/home/scripts/commands/compress.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "compress" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if (( $# == 1 )) then
|
||||
# echo -ne "Archive name: "
|
||||
# read name
|
||||
# tar -cvzf "$name.tar.gz" $1
|
||||
tar -cvzf "$1.tar.gz" $1
|
||||
else
|
||||
echo "Wrong number of arguments..."
|
||||
fi
|
||||
'')
|
||||
9
modules/home/scripts/commands/crs.nix
Normal file
9
modules/home/scripts/commands/crs.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "crs" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
cargo test && \
|
||||
cargo run
|
||||
'')
|
||||
11
modules/home/scripts/commands/extract.nix
Normal file
11
modules/home/scripts/commands/extract.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "extract" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for i in "$@" ; do
|
||||
tar -xvzf $i
|
||||
break
|
||||
done
|
||||
'')
|
||||
8
modules/home/scripts/commands/invoke.nix
Normal file
8
modules/home/scripts/commands/invoke.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "invoke" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
nix run nixpkgs#$"@"
|
||||
'')
|
||||
11
modules/home/scripts/commands/keybinds.nix
Normal file
11
modules/home/scripts/commands/keybinds.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "keybinds" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
config_file=~/.config/hypr/hyprland.conf
|
||||
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
|
||||
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
||||
rofi -dmenu -theme-str 'window {width: 50%;}' <<< "$keybinds"
|
||||
'')
|
||||
10
modules/home/scripts/commands/mcd.nix
Normal file
10
modules/home/scripts/commands/mcd.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "mcd" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
|
||||
mkdir -p "$1"
|
||||
cd "$1" || exit
|
||||
'')
|
||||
21
modules/home/scripts/commands/runbg.nix
Normal file
21
modules/home/scripts/commands/runbg.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "runbg" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
[ $# -eq 0 ] && { # $# is number of args
|
||||
echo "$(basename $0): missing command" >&2
|
||||
exit 1
|
||||
}
|
||||
prog="$(which "$1")" # see below
|
||||
[ -z "$prog" ] && {
|
||||
echo "$(basename $0): unknown command: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
shift # remove $1, now $prog, from args
|
||||
tty -s && exec </dev/null # if stdin is a terminal, redirect from null
|
||||
tty -s <&1 && exec >/dev/null # if stdout is a terminal, redirect to null
|
||||
tty -s <&2 && exec 2>&1 # stderr to stdout (which might not be null)
|
||||
"$prog" "$@" & # $@ is all args
|
||||
'')
|
||||
8
modules/home/scripts/commands/s_check.nix
Normal file
8
modules/home/scripts/commands/s_check.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "scheck" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
[ "$SOUNDS_ENABLED" -eq 1 ]
|
||||
'')
|
||||
12
modules/home/scripts/commands/splash.nix
Normal file
12
modules/home/scripts/commands/splash.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "splash" (''
|
||||
#!/bin/bash
|
||||
|
||||
echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux"
|
||||
date +"%A %B %-d %Y"
|
||||
echo -e "\033[38;2;0;180;205m$(toilet -t -f Slant.flf glasshouse)\033[0m"
|
||||
echo
|
||||
'')
|
||||
|
||||
56
modules/home/scripts/default.nix
Normal file
56
modules/home/scripts/default.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ self, pkgs, ... }:
|
||||
|
||||
let
|
||||
compress = (import ./commands/compress.nix { self = self; pkgs = pkgs;});
|
||||
crs = (import ./commands/crs.nix { self = self; pkgs = pkgs;});
|
||||
extract = (import ./commands/extract.nix { self = self; pkgs = pkgs;});
|
||||
invoke = (import ./commands/invoke.nix { self = self; pkgs = pkgs;});
|
||||
splash = (import ./commands/splash.nix { self = self; pkgs = pkgs;});
|
||||
scheck = (import ./commands/s_check.nix { self = self; pkgs = pkgs;});
|
||||
runbg = (import ./commands/runbg.nix { self = self; pkgs = pkgs;});
|
||||
mcd = (import ./commands/mcd.nix { self = self; pkgs = pkgs;});
|
||||
garbage-collect = (import ./nix/garbage-collect.nix { self = self; pkgs = pkgs;});
|
||||
homep = (import ./nix/homep.nix { self = self; pkgs = pkgs;});
|
||||
homer = (import ./nix/homer.nix { self = self; pkgs = pkgs;});
|
||||
nsp = (import ./nix/nsp.nix { self = self; pkgs = pkgs;});
|
||||
nixswitch = (import ./nix/nixswitch.nix { self = self; pkgs = pkgs;});
|
||||
nixr = (import ./nix/nixr.nix { self = self; pkgs = pkgs;});
|
||||
nixp = (import ./nix/nixp.nix { self = self; pkgs = pkgs;});
|
||||
nixcommit = (import ./nix/nixcommit.nix { self = self; pkgs = pkgs;});
|
||||
lofi = (import ./wm-controls/lofi.nix { self = self; pkgs = pkgs;});
|
||||
music = (import ./wm-controls/music.nix { self = self; pkgs = pkgs;});
|
||||
shutdown-script = (import ./wm-controls/shutdown-script.nix { self = self; pkgs = pkgs;});
|
||||
switchmon = (import ./wm-controls/switchmon.nix { self = self; pkgs = pkgs;});
|
||||
toggle_blur = (import ./wm-controls/toggle_blur.nix { self = self; pkgs = pkgs;});
|
||||
toggle_float = (import ./wm-controls/toggle_float.nix { self = self; pkgs = pkgs;});
|
||||
toggle_oppacity = (import ./wm-controls/toggle_oppacity.nix { self = self; pkgs = pkgs;});
|
||||
toggle_waybar = (import ./wm-controls/toggle_waybar.nix { self = self; pkgs = pkgs;});
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
compress
|
||||
crs
|
||||
extract
|
||||
garbage-collect
|
||||
homep
|
||||
homer
|
||||
invoke
|
||||
lofi
|
||||
mcd
|
||||
music
|
||||
nixcommit
|
||||
nixp
|
||||
nixr
|
||||
nixswitch
|
||||
nsp
|
||||
runbg
|
||||
scheck
|
||||
shutdown-script
|
||||
splash
|
||||
switchmon
|
||||
toggle_blur
|
||||
toggle_float
|
||||
toggle_oppacity
|
||||
toggle_waybar
|
||||
];
|
||||
}
|
||||
31
modules/home/scripts/nix/garbage-collect.nix
Normal file
31
modules/home/scripts/nix/garbage-collect.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "garbage-collect" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
|
||||
echo "This will delete all unused paths in the nix store and delete any files in the gtrash folder."
|
||||
echo -e "\033[1;4;38;2;243;139;168mThis process is irreversible.\033[0m Are you sure?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
Yes ) echo "Sweeping system...";scheck && runbg aplay "$HOME/media/sound/sys/collectgarbage.wav";break;;
|
||||
No ) echo "Canceling garbage collection."; return;;
|
||||
esac
|
||||
done
|
||||
output=$(nix-collect-garbage | tee /dev/tty)
|
||||
|
||||
nix_freed=$(echo "$output" | grep -oP '\d+(\.\d+)? MiB freed' | cut -d' ' -f1)
|
||||
|
||||
if [ "$(ls -A ~/.local/share/Trash/files/ 2>/dev/null)" ]; then
|
||||
rm_freed=$(du ~/.local/share/Trash/files 2> /dev/null | awk '{print $1}')
|
||||
rm_freed=$(echo "scale=2; $rm_freed / 1000" | bc)
|
||||
/run/current-system/sw/bin/rm -rfv ~/.local/share/Trash/files
|
||||
mkdir ~/.local/share/Trash/files
|
||||
else
|
||||
rm_freed="0"
|
||||
fi
|
||||
total_freed=$(echo "$nix_freed + $rm_freed" | bc)
|
||||
echo -e "System cleaning complete, freed \033[1;4;38;2;166;227;161m$total_freed MiB\033[0m in total"
|
||||
scheck && runbg aplay "$HOME/media/sound/sys/rm.wav"
|
||||
'')
|
||||
35
modules/home/scripts/nix/homep.nix
Normal file
35
modules/home/scripts/nix/homep.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "homep" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Ensure the package manifest is generated or updated
|
||||
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
|
||||
echo "Generating Nixpkgs manifest..."
|
||||
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
|
||||
fi
|
||||
|
||||
# Select packages using fzf with multi-select enabled
|
||||
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
|
||||
|
||||
# Check if any packages were selected
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
# Append each selected package to the Nix config file
|
||||
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
|
||||
echo "Added $package to the Home Manager configuration."
|
||||
done
|
||||
|
||||
echo "Packages added successfully. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages selected."
|
||||
fi
|
||||
'')
|
||||
29
modules/home/scripts/nix/homer.nix
Normal file
29
modules/home/scripts/nix/homer.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "homer" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
|
||||
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
|
||||
echo "Removed $package from the Home Manager configuration."
|
||||
done
|
||||
|
||||
echo "Removed packages. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages removed."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
'')
|
||||
29
modules/home/scripts/nix/nixcommit.nix
Normal file
29
modules/home/scripts/nix/nixcommit.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "nixcommit" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
|
||||
builtin cd "$HOME/sysflakes" || exit
|
||||
nix flake update
|
||||
if [ -n "$2" ]; then
|
||||
echo "too many arguments"
|
||||
exit
|
||||
fi
|
||||
|
||||
gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/')
|
||||
gen=$((gen + 1))
|
||||
|
||||
diffcheck=$(git status | grep "working tree clean")
|
||||
if [ -n "$diffcheck" ]; then
|
||||
scheck && runbg aplay ${self}/media/sound/warning.wav
|
||||
echo "Nothing to commit"
|
||||
exit
|
||||
fi
|
||||
git add .
|
||||
git commit -m "Gen $gen: $1"
|
||||
git push
|
||||
scheck && runbg aplay ${self}/media/sound/gitpush.wav
|
||||
builtin cd - || exit
|
||||
'')
|
||||
35
modules/home/scripts/nix/nixp.nix
Normal file
35
modules/home/scripts/nix/nixp.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "nixp" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
# Ensure the package manifest is generated or updated
|
||||
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
|
||||
echo "Generating Nixpkgs manifest..."
|
||||
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
|
||||
fi
|
||||
|
||||
# Select packages using fzf with multi-select enabled
|
||||
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
|
||||
|
||||
# Check if any packages were selected
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
# Append each selected package to the Nix config file
|
||||
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
|
||||
echo "Added $package to the Nix configuration."
|
||||
done
|
||||
|
||||
echo "Packages added successfully. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages selected."
|
||||
fi
|
||||
'')
|
||||
29
modules/home/scripts/nix/nixr.nix
Normal file
29
modules/home/scripts/nix/nixr.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "nixr" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
|
||||
|
||||
if [ -n "$selected_packages" ]; then
|
||||
echo "$selected_packages" | while read -r package; do
|
||||
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
|
||||
echo "Removed $package from the Nix configuration."
|
||||
done
|
||||
|
||||
echo "Removed packages. Rebuild system config?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
"Yes" ) nixswitch;break;;
|
||||
"No" ) exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
else
|
||||
echo "No packages removed."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
'')
|
||||
18
modules/home/scripts/nix/nixswitch.nix
Normal file
18
modules/home/scripts/nix/nixswitch.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "nixswitch" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
|
||||
builtin cd "$HOME/sysflakes" || exit
|
||||
|
||||
nix flake update
|
||||
sudo nixos-rebuild switch --flake "$HOME/sysflakes#glasshouse-desktop"
|
||||
if [ $? -eq 0 ]; then
|
||||
scheck && runbg aplay ${self}/media/sound/update.wav
|
||||
else
|
||||
scheck && runbg aplay ${self}/media/sound/error.wav
|
||||
fi
|
||||
builtin cd "$OLDPWD" || exit
|
||||
'')
|
||||
8
modules/home/scripts/nix/nsp.nix
Normal file
8
modules/home/scripts/nix/nsp.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "nsp" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
nix-shell -p "$@" --run zsh
|
||||
'')
|
||||
12
modules/home/scripts/wm-controls/lofi.nix
Normal file
12
modules/home/scripts/wm-controls/lofi.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "lofi" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if (ps aux | grep mpv | grep -v grep > /dev/null) then
|
||||
pkill mpv
|
||||
else
|
||||
runbg mpv --no-video https://www.youtube.com/live/jfKfPfyJRdk?si=OF0HKrYFFj33BzMo
|
||||
fi
|
||||
'')
|
||||
15
modules/home/scripts/wm-controls/music.nix
Normal file
15
modules/home/scripts/wm-controls/music.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "music" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if (ps aux | grep audacious | grep -v grep > /dev/null) then
|
||||
pkill audacious
|
||||
else
|
||||
hyprctl dispatch exec "[workspace 5 silent] audacious -t ~/Music/playlist"
|
||||
sleep 0.5
|
||||
audtool playlist-repeat-status |grep "on" || audtool playlist-repeat-toggle
|
||||
audtool playlist-shuffle-status|grep "on" || audtool playlist-shuffle-toggle
|
||||
fi
|
||||
'')
|
||||
8
modules/home/scripts/wm-controls/power-menu.nix
Normal file
8
modules/home/scripts/wm-controls/power-menu.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "power-menu" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rofi -show p -modi p:'rofi-power-menu' -theme-str 'window {width: 10em; height: 15em;} listview {lines: 5;}'
|
||||
'')
|
||||
20
modules/home/scripts/wm-controls/shutdown-script.nix
Normal file
20
modules/home/scripts/wm-controls/shutdown-script.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "shutdown-script" (''
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
|
||||
|
||||
if [ $respond = ' Shutdown' ]
|
||||
then
|
||||
echo "shutdown"
|
||||
shutdown now
|
||||
elif [ $respond = ' Restart' ]
|
||||
then
|
||||
echo "restart"
|
||||
reboot
|
||||
else
|
||||
notify-send "cancel shutdown"
|
||||
fi
|
||||
'')
|
||||
8
modules/home/scripts/wm-controls/switchmon.nix
Normal file
8
modules/home/scripts/wm-controls/switchmon.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "switchmon" (''
|
||||
#!/bin/zsh
|
||||
|
||||
hyprctl dispatch focusmonitor $(echo "$(hyprctl -j monitors)" | jq -r '.[] | select(.focused == false) | .name')
|
||||
'')
|
||||
12
modules/home/scripts/wm-controls/toggle_blur.nix
Normal file
12
modules/home/scripts/wm-controls/toggle_blur.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "toggle_blur" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
|
||||
hyprctl keyword decoration:blur:enabled false >/dev/null
|
||||
else
|
||||
hyprctl keyword decoration:blur:enabled true >/dev/null
|
||||
fi
|
||||
'')
|
||||
10
modules/home/scripts/wm-controls/toggle_float.nix
Normal file
10
modules/home/scripts/wm-controls/toggle_float.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "toggle_float" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hyprctl dispatch togglefloating
|
||||
hyprctl dispatch resizeactive exact 950 600
|
||||
hyprctl dispatch centerwindow
|
||||
'')
|
||||
14
modules/home/scripts/wm-controls/toggle_oppacity.nix
Normal file
14
modules/home/scripts/wm-controls/toggle_oppacity.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "toggle_oppacity" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if hyprctl getoption decoration:active_opacity | grep "float: 1" >/dev/null ; then
|
||||
hyprctl keyword decoration:active_opacity 0.90 >/dev/null
|
||||
hyprctl keyword decoration:inactive_opacity 0.90 >/dev/null
|
||||
else
|
||||
hyprctl keyword decoration:active_opacity 1 >/dev/null
|
||||
hyprctl keyword decoration:inactive_opacity 1 >/dev/null
|
||||
fi
|
||||
'')
|
||||
15
modules/home/scripts/wm-controls/toggle_waybar.nix
Normal file
15
modules/home/scripts/wm-controls/toggle_waybar.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "toggle_waybar" (''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SERVICE=".waybar-wrapped"
|
||||
|
||||
if pgrep -x "$SERVICE" >/dev/null
|
||||
then
|
||||
pkill -9 waybar
|
||||
else
|
||||
runbg waybar
|
||||
fi
|
||||
'')
|
||||
Reference in New Issue
Block a user