removed mkbackup script, refactored all script files to use pkgs.writeShellApplication rather than pkgs.writeShellScriptBin
This commit is contained in:
@@ -1,58 +1,70 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellScriptBin "mkscreenshots" ''
|
||||
if [ -n "$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "4")')" ]; then
|
||||
echo "There are windows in workspace 4. This script uses workspace 4, so move those windows and run it again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prev_workspace=$(hyprctl activeworkspace -j | jq '.id')
|
||||
|
||||
hyprctl dispatch focusmonitor 0
|
||||
|
||||
screenshotfetch() {
|
||||
pkgs.writeShellApplication {
|
||||
name = "mkscreenshots";
|
||||
runtimeInputs = with pkgs; [
|
||||
jq
|
||||
neofetch
|
||||
kitty
|
||||
coreutils
|
||||
nemo
|
||||
grimblast
|
||||
git
|
||||
];
|
||||
text = ''
|
||||
if [ -n "$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "4")')" ]; then
|
||||
echo "There are windows in workspace 4. This script uses workspace 4, so move those windows and run it again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kitty @ scroll-window 20-
|
||||
prev_workspace=$(hyprctl activeworkspace -j | jq '.id')
|
||||
|
||||
exec sleep infinity
|
||||
}
|
||||
hyprctl dispatch focusmonitor 0
|
||||
|
||||
closewindows() {
|
||||
hyprctl clients -j | jq -r '.[] | select(.workspace.name == "4") | .address' | while read -r addr; do
|
||||
hyprctl dispatch closewindow address:"$addr"
|
||||
done
|
||||
}
|
||||
screenshotfetch() {
|
||||
neofetch
|
||||
|
||||
temp_script=$(mktemp)
|
||||
screenshotfetch_var=$(declare -f screenshotfetch)
|
||||
echo "$screenshotfetch_var" > "$temp_script"
|
||||
echo "screenshotfetch" >> "$temp_script"
|
||||
chmod +x "$temp_script"
|
||||
kitty @ scroll-window 20-
|
||||
|
||||
hyprctl dispatch workspace 4
|
||||
hyprctl dispatch exec "[float;size 40% 25%;move 1% 66%] kitty bash -c '$temp_script'"
|
||||
hyprctl dispatch exec "[float;size 40% 50%;move 57% 8%] nemo"
|
||||
exec sleep infinity
|
||||
}
|
||||
|
||||
sleep 1
|
||||
grimblast save output "$FLAKEPATH"/assets/screens/desktop-neofetch.png
|
||||
closewindows() {
|
||||
hyprctl clients -j | jq -r '.[] | select(.workspace.name == "4") | .address' | while read -r addr; do
|
||||
hyprctl dispatch closewindow address:"$addr"
|
||||
done
|
||||
}
|
||||
|
||||
closewindows
|
||||
temp_script=$(mktemp)
|
||||
screenshotfetch_var=$(declare -f screenshotfetch)
|
||||
echo "$screenshotfetch_var" > "$temp_script"
|
||||
echo "screenshotfetch" >> "$temp_script"
|
||||
chmod +x "$temp_script"
|
||||
|
||||
hyprctl dispatch exec 'kitty nvim'
|
||||
hyprctl dispatch exec 'kitty yazi'
|
||||
hyprctl dispatch exec 'kitty'
|
||||
hyprctl dispatch workspace 4
|
||||
hyprctl dispatch exec "[float;size 40% 25%;move 1% 66%] kitty bash -c '$temp_script'"
|
||||
hyprctl dispatch exec "[float;size 40% 50%;move 57% 8%] nemo"
|
||||
|
||||
sleep 1
|
||||
grimblast save output "$FLAKEPATH"/assets/screens/desktop-busy.png
|
||||
sleep 1
|
||||
grimblast save output "$FLAKEPATH"/assets/screens/desktop-neofetch.png
|
||||
|
||||
(
|
||||
cd "$FLAKEPATH"
|
||||
latest_hash=$(git rev-parse HEAD)
|
||||
sed -i "s|\(https://github.com/pagedMov/nixos-config/commit/\)[a-f0-9]\{40\}|\1$latest_hash|" "$FLAKEPATH"/README.md
|
||||
)
|
||||
closewindows
|
||||
|
||||
closewindows
|
||||
hyprctl dispatch exec 'kitty nvim'
|
||||
hyprctl dispatch exec 'kitty yazi'
|
||||
hyprctl dispatch exec 'kitty'
|
||||
|
||||
hyprctl dispatch workspace "$prev_workspace"
|
||||
''
|
||||
sleep 1
|
||||
grimblast save output "$FLAKEPATH"/assets/screens/desktop-busy.png
|
||||
|
||||
(
|
||||
cd "$FLAKEPATH"
|
||||
latest_hash=$(git rev-parse HEAD)
|
||||
sed -i "s|\(https://github.com/pagedMov/nixos-config/commit/\)[a-f0-9]\{40\}|\1$latest_hash|" "$FLAKEPATH"/README.md
|
||||
)
|
||||
|
||||
closewindows
|
||||
|
||||
hyprctl dispatch workspace "$prev_workspace"
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user