Gen 423: Converted shell scripts into nix files
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@@ -825,11 +825,11 @@
|
|||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728762317,
|
"lastModified": 1728764915,
|
||||||
"narHash": "sha256-bEy9sZy4K2owEYrc+9WTqYTyWxjxK/WfusH+RDngNZU=",
|
"narHash": "sha256-2FQdE8mF1VcSCjM3tLggVwm+LO2FrMHVuWIUpjzBkrE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "0d5a843741d2c551f3023bff528f236ec0dfe9d0",
|
"rev": "dfb94a4063e762fb282b91af80bff1ad1ddeb27f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ nur, inputs, username, system, ... }:
|
{ nur, self, inputs, username, system, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ self, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
VISUAL = "/nixbin/nvim";
|
VISUAL = "/nixbin/nvim";
|
||||||
LANG = "en_US.UTF-8";
|
LANG = "en_US.UTF-8";
|
||||||
BROWSER = "/nixbin/firefox";
|
BROWSER = "/nixbin/firefox";
|
||||||
NVIM = "~/dots/nixvim/config/";
|
NVIM = "${self}/nixvim/config/";
|
||||||
HYPRCONF = "~/dots/hyprland/";
|
HYPRCONF = "${self}/hyprland/";
|
||||||
SYSCONF = "~/sysflakes/glasshouse-desktop/sys";
|
SYSCONF = "${self}/glasshouse-desktop/sys";
|
||||||
};
|
};
|
||||||
|
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
unalias ls
|
unalias ls
|
||||||
ls() {
|
ls() {
|
||||||
eza -1 --group-directories-first --icons "$@"
|
eza -1 --group-directories-first --icons "$@"
|
||||||
scheck && runbg aplay ~/media/sound/sys/ls.wav
|
scheck && runbg aplay ${self}/media/sound/ls.wav
|
||||||
}
|
}
|
||||||
|
|
||||||
cd() {
|
cd() {
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
eza -1 --group-directories-first --icons "$@"
|
eza -1 --group-directories-first --icons "$@"
|
||||||
builtin cd "$@" || exit
|
builtin cd "$@" || exit
|
||||||
export SOUNDS_ENABLED=1
|
export SOUNDS_ENABLED=1
|
||||||
scheck && (aplay ~/media/sound/sys/cd.wav > /dev/null 2>&1 &)
|
scheck && runbg aplay ${self}/media/sound/cd.wav
|
||||||
}
|
}
|
||||||
if [ ! -e $HOME/.zsh_history ]; then
|
if [ ! -e $HOME/.zsh_history ]; then
|
||||||
touch $HOME/.zsh_history
|
touch $HOME/.zsh_history
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
unalias ls
|
unalias ls
|
||||||
clear
|
clear
|
||||||
splash
|
splash
|
||||||
scheck && runbg aplay ~/media/sound/sys/sh-source.wav
|
scheck && runbg aplay ${self}/media/sound/sh-source.wav
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ inputs, nixpkgs, config, username, ... }:
|
{ inputs, nixpkgs, config, self, username, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, inputs, pkgs, username, ... }:
|
{ config, inputs, pkgs, username, self, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
nur = config.nur;
|
nur = config.nur;
|
||||||
@@ -9,7 +9,7 @@ in
|
|||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
backupFileExtension = "backup";
|
backupFileExtension = "backup";
|
||||||
extraSpecialArgs = { inherit inputs username nur; };
|
extraSpecialArgs = { inherit self inputs username nur; };
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
imports = [ ./../home ];
|
imports = [ ./../home ];
|
||||||
|
|||||||
8
glasshouse-laptop/home/scripts/scripts/compress.sh → glasshouse-laptop/home/scripts/compress.nix
Executable file → Normal file
8
glasshouse-laptop/home/scripts/scripts/compress.sh → glasshouse-laptop/home/scripts/compress.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
compress = pkgs.writeShellScriptBin "compress" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if (( $# == 1 )) then
|
if (( $# == 1 )) then
|
||||||
@@ -7,4 +11,6 @@ if (( $# == 1 )) then
|
|||||||
tar -cvzf "$1.tar.gz" $1
|
tar -cvzf "$1.tar.gz" $1
|
||||||
else
|
else
|
||||||
echo "Wrong number of arguments..."
|
echo "Wrong number of arguments..."
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
10
glasshouse-laptop/home/scripts/crs.nix
Normal file
10
glasshouse-laptop/home/scripts/crs.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
crs = pkgs.writeShellScriptBin "crs" (''
|
||||||
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
|
cargo test && \
|
||||||
|
cargo run
|
||||||
|
'');
|
||||||
|
}
|
||||||
@@ -1,84 +1,60 @@
|
|||||||
{pkgs, ...}: let
|
{ ... }:
|
||||||
wall-change = pkgs.writeShellScriptBin "wall-change" (builtins.readFile ./scripts/wall-change.sh);
|
|
||||||
wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (builtins.readFile ./scripts/wallpaper-picker.sh);
|
|
||||||
|
|
||||||
runbg = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh);
|
let
|
||||||
music = pkgs.writeShellScriptBin "music" (builtins.readFile ./scripts/music.sh);
|
compress = import ./compress.nix;
|
||||||
lofi = pkgs.writeScriptBin "lofi" (builtins.readFile ./scripts/lofi.sh);
|
crs = import ./crs.nix;
|
||||||
|
extract = import ./extract.nix;
|
||||||
splash = pkgs.writeShellScriptBin "splash" (builtins.readFile ./scripts/splash.sh);
|
garbage-collect = import ./garbage-collect.nix;
|
||||||
switchmon = pkgs.writeShellScriptBin "switchmon" (builtins.readFile ./scripts/switchmon.sh);
|
homep = import ./homep.nix;
|
||||||
nixswitch = pkgs.writeShellScriptBin "nixswitch" (builtins.readFile ./scripts/nixswitch.sh);
|
homer = import ./homer.nix;
|
||||||
garbage-collect = pkgs.writeShellScriptBin "garbage-collect" (builtins.readFile ./scripts/garbage-collect.sh);
|
invoke = import ./invoke.nix;
|
||||||
scheck = pkgs.writeShellScriptBin "scheck" (builtins.readFile ./scripts/s_check.sh);
|
lofi = import ./lofi.nix;
|
||||||
mcd = pkgs.writeShellScriptBin "mcd" (builtins.readFile ./scripts/mcd.sh);
|
maxfetch = import ./maxfetch.nix;
|
||||||
crs = pkgs.writeShellScriptBin "crs" (builtins.readFile ./scripts/crs.sh);
|
mcd = import ./mcd.nix;
|
||||||
nixcommit = pkgs.writeShellScriptBin "nixcommit" (builtins.readFile ./scripts/nixcommit.sh);
|
music = import ./music.nix;
|
||||||
invoke = pkgs.writeShellScriptBin "invoke" (builtins.readFile ./scripts/invoke.sh);
|
nixcommit = import ./nixcommit.nix;
|
||||||
nsp = pkgs.writeShellScriptBin "nsp" (builtins.readFile ./scripts/nsp.sh);
|
nixp = import ./nixp.nix;
|
||||||
nixp = pkgs.writeShellScriptBin "nixp" (builtins.readFile ./scripts/nixp.sh);
|
nixr = import ./nixr.nix;
|
||||||
nixr = pkgs.writeShellScriptBin "nixr" (builtins.readFile ./scripts/nixr.sh);
|
nixswitch = import ./nixswitch.nix;
|
||||||
homep = pkgs.writeShellScriptBin "homep" (builtins.readFile ./scripts/homep.sh);
|
nsp = import ./nsp.nix;
|
||||||
homer = pkgs.writeShellScriptBin "homer" (builtins.readFile ./scripts/homer.sh);
|
record = import ./record.nix;
|
||||||
|
runbg = import ./runbg.nix;
|
||||||
|
s_check = import ./s_check.nix;
|
||||||
toggle_blur = pkgs.writeScriptBin "toggle_blur" (builtins.readFile ./scripts/toggle_blur.sh);
|
shutdown-script = import ./shutdown-script.nix;
|
||||||
toggle_oppacity = pkgs.writeScriptBin "toggle_oppacity" (builtins.readFile ./scripts/toggle_oppacity.sh);
|
splash = import ./splash.nix;
|
||||||
|
switchmon = import ./switchmon.nix;
|
||||||
maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ./scripts/maxfetch.sh);
|
toggle_blur = import ./toggle_blur.nix;
|
||||||
|
toggle_float = import ./toggle_float.nix;
|
||||||
compress = pkgs.writeScriptBin "compress" (builtins.readFile ./scripts/compress.sh);
|
toggle_oppacity = import ./toggle_oppacity.nix;
|
||||||
extract = pkgs.writeScriptBin "extract" (builtins.readFile ./scripts/extract.sh);
|
toggle_waybar = import ./toggle_waybar.nix;
|
||||||
|
in
|
||||||
shutdown-script = pkgs.writeScriptBin "shutdown-script" (builtins.readFile ./scripts/shutdown-script.sh);
|
{
|
||||||
|
|
||||||
show-keybinds = pkgs.writeScriptBin "show-keybinds" (builtins.readFile ./scripts/keybinds.sh);
|
|
||||||
|
|
||||||
vm-start = pkgs.writeScriptBin "vm-start" (builtins.readFile ./scripts/vm-start.sh);
|
|
||||||
|
|
||||||
ascii = pkgs.writeScriptBin "ascii" (builtins.readFile ./scripts/ascii.sh);
|
|
||||||
|
|
||||||
record = pkgs.writeScriptBin "record" (builtins.readFile ./scripts/record.sh);
|
|
||||||
in {
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
nixswitch
|
nixswitch
|
||||||
garbage-collect
|
garbage-collect
|
||||||
scheck
|
mcd
|
||||||
mcd
|
crs
|
||||||
crs
|
nixcommit
|
||||||
nixcommit
|
invoke
|
||||||
invoke
|
nsp
|
||||||
nsp
|
nixp
|
||||||
wall-change
|
nixr
|
||||||
wallpaper-picker
|
homep
|
||||||
nixp
|
s_check
|
||||||
nixr
|
homer
|
||||||
homep
|
runbg
|
||||||
homer
|
music
|
||||||
|
lofi
|
||||||
runbg
|
splash
|
||||||
music
|
switchmon
|
||||||
lofi
|
toggle_blur
|
||||||
|
toggle_float
|
||||||
splash
|
toggle_oppacity
|
||||||
switchmon
|
toggle_waybar
|
||||||
|
maxfetch
|
||||||
toggle_blur
|
compress
|
||||||
toggle_oppacity
|
extract
|
||||||
|
shutdown-script
|
||||||
maxfetch
|
record
|
||||||
|
];
|
||||||
compress
|
|
||||||
extract
|
|
||||||
|
|
||||||
shutdown-script
|
|
||||||
|
|
||||||
show-keybinds
|
|
||||||
|
|
||||||
vm-start
|
|
||||||
|
|
||||||
ascii
|
|
||||||
|
|
||||||
record
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
6
glasshouse-laptop/home/scripts/scripts/extract.sh → glasshouse-laptop/home/scripts/extract.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/extract.sh → glasshouse-laptop/home/scripts/extract.nix
Executable file → Normal file
@@ -1,6 +1,12 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
extract = pkgs.writeShellScriptBin "extract" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
for i in "$@" ; do
|
for i in "$@" ; do
|
||||||
tar -xvzf $i
|
tar -xvzf $i
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/garbage-collect.sh → glasshouse-laptop/home/scripts/garbage-collect.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/garbage-collect.sh → glasshouse-laptop/home/scripts/garbage-collect.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
garbage-collect = pkgs.writeShellScriptBin "garbage-collect" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
|
|
||||||
@@ -24,3 +28,5 @@ fi
|
|||||||
total_freed=$(echo "$nix_freed + $rm_freed" | bc)
|
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"
|
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"
|
scheck && runbg aplay "$HOME/media/sound/sys/rm.wav"
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/homep.sh → glasshouse-laptop/home/scripts/homep.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/homep.sh → glasshouse-laptop/home/scripts/homep.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
homep = pkgs.writeShellScriptBin "homep" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
# Ensure the package manifest is generated or updated
|
# Ensure the package manifest is generated or updated
|
||||||
@@ -28,3 +32,5 @@ if [ -n "$selected_packages" ]; then
|
|||||||
else
|
else
|
||||||
echo "No packages selected."
|
echo "No packages selected."
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/homer.sh → glasshouse-laptop/home/scripts/homer.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/homer.sh → glasshouse-laptop/home/scripts/homer.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
homer = pkgs.writeShellScriptBin "homer" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
|
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
|
||||||
@@ -22,3 +26,5 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'');
|
||||||
|
}
|
||||||
9
glasshouse-laptop/home/scripts/invoke.nix
Normal file
9
glasshouse-laptop/home/scripts/invoke.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
invoke = pkgs.writeShellScriptBin "invoke" (''
|
||||||
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
|
nix run nixpkgs#$"@"
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/keybinds.sh → glasshouse-laptop/home/scripts/keybinds.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/keybinds.sh → glasshouse-laptop/home/scripts/keybinds.nix
Executable file → Normal file
@@ -1,6 +1,12 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
keybinds = pkgs.writeShellScriptBin "keybinds" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
config_file=~/.config/hypr/hyprland.conf
|
config_file=~/.config/hypr/hyprland.conf
|
||||||
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
|
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
|
||||||
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
||||||
rofi -dmenu -theme-str 'window {width: 50%;}' <<< "$keybinds"
|
rofi -dmenu -theme-str 'window {width: 50%;}' <<< "$keybinds"
|
||||||
|
'');
|
||||||
|
}
|
||||||
8
glasshouse-laptop/home/scripts/scripts/lofi.sh → glasshouse-laptop/home/scripts/lofi.nix
Executable file → Normal file
8
glasshouse-laptop/home/scripts/scripts/lofi.sh → glasshouse-laptop/home/scripts/lofi.nix
Executable file → Normal file
@@ -1,7 +1,13 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
lofi = pkgs.writeShellScriptBin "lofi" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if (ps aux | grep mpv | grep -v grep > /dev/null) then
|
if (ps aux | grep mpv | grep -v grep > /dev/null) then
|
||||||
pkill mpv
|
pkill mpv
|
||||||
else
|
else
|
||||||
runbg mpv --no-video https://www.youtube.com/live/jfKfPfyJRdk?si=OF0HKrYFFj33BzMo
|
runbg mpv --no-video https://www.youtube.com/live/jfKfPfyJRdk?si=OF0HKrYFFj33BzMo
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
8
glasshouse-laptop/home/scripts/scripts/maxfetch.sh → glasshouse-laptop/home/scripts/maxfetch.nix
Executable file → Normal file
8
glasshouse-laptop/home/scripts/scripts/maxfetch.sh → glasshouse-laptop/home/scripts/maxfetch.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
maxfetch = pkgs.writeShellScriptBin "maxfetch" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
unicode=" "
|
unicode=" "
|
||||||
@@ -50,4 +54,6 @@ fetch() {
|
|||||||
echo " ╰─────────────╯ "
|
echo " ╰─────────────╯ "
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch && exit 0
|
fetch && exit 0
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/mcd.sh → glasshouse-laptop/home/scripts/mcd.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/mcd.sh → glasshouse-laptop/home/scripts/mcd.nix
Executable file → Normal file
@@ -1,5 +1,11 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
mcd = pkgs.writeShellScriptBin "mcd" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "$1"
|
mkdir -p "$1"
|
||||||
cd "$1" || exit
|
cd "$1" || exit
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/music.sh → glasshouse-laptop/home/scripts/music.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/music.sh → glasshouse-laptop/home/scripts/music.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
music = pkgs.writeShellScriptBin "music" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if (ps aux | grep audacious | grep -v grep > /dev/null) then
|
if (ps aux | grep audacious | grep -v grep > /dev/null) then
|
||||||
@@ -8,3 +12,5 @@ else
|
|||||||
audtool playlist-repeat-status |grep "on" || audtool playlist-repeat-toggle
|
audtool playlist-repeat-status |grep "on" || audtool playlist-repeat-toggle
|
||||||
audtool playlist-shuffle-status|grep "on" || audtool playlist-shuffle-toggle
|
audtool playlist-shuffle-status|grep "on" || audtool playlist-shuffle-toggle
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/nixcommit.sh → glasshouse-laptop/home/scripts/nixcommit.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/nixcommit.sh → glasshouse-laptop/home/scripts/nixcommit.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixcommit = pkgs.writeShellScriptBin "nixcommit" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
scheck && runbg aplay ~/media/sound/sys/nixswitch-start.wav
|
scheck && runbg aplay ~/media/sound/sys/nixswitch-start.wav
|
||||||
@@ -22,3 +26,5 @@ git commit -m "Gen $gen: $1"
|
|||||||
git push
|
git push
|
||||||
scheck && runbg aplay ~/media/sound/sys/gitpush.wav
|
scheck && runbg aplay ~/media/sound/sys/gitpush.wav
|
||||||
builtin cd - || exit
|
builtin cd - || exit
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/nixp.sh → glasshouse-laptop/home/scripts/nixp.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/nixp.sh → glasshouse-laptop/home/scripts/nixp.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixp = pkgs.writeShellScriptBin "nixp" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
# Ensure the package manifest is generated or updated
|
# Ensure the package manifest is generated or updated
|
||||||
@@ -28,3 +32,5 @@ if [ -n "$selected_packages" ]; then
|
|||||||
else
|
else
|
||||||
echo "No packages selected."
|
echo "No packages selected."
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/nixr.sh → glasshouse-laptop/home/scripts/nixr.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/nixr.sh → glasshouse-laptop/home/scripts/nixr.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixr = pkgs.writeShellScriptBin "nixr" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
|
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
|
||||||
@@ -22,3 +26,5 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/nixswitch.sh → glasshouse-laptop/home/scripts/nixswitch.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/nixswitch.sh → glasshouse-laptop/home/scripts/nixswitch.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixswitch = pkgs.writeShellScriptBin "nixswitch" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
scheck && runbg aplay ~/media/sound/sys/nixswitch-start.wav
|
scheck && runbg aplay ~/media/sound/sys/nixswitch-start.wav
|
||||||
@@ -11,3 +15,5 @@ else
|
|||||||
scheck && runbg aplay ~/media/sound/sys/error.wav
|
scheck && runbg aplay ~/media/sound/sys/error.wav
|
||||||
fi
|
fi
|
||||||
builtin cd "$OLDPWD" || exit
|
builtin cd "$OLDPWD" || exit
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/nsp.sh → glasshouse-laptop/home/scripts/nsp.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/nsp.sh → glasshouse-laptop/home/scripts/nsp.nix
Executable file → Normal file
@@ -1,3 +1,9 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nsp = pkgs.writeShellScriptBin "nsp" (''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
nix-shell -p "$@" --run zsh
|
nix-shell -p "$@" --run zsh
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/power-menu.sh → glasshouse-laptop/home/scripts/power-menu.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/power-menu.sh → glasshouse-laptop/home/scripts/power-menu.nix
Executable file → Normal file
@@ -1,3 +1,9 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
power-menu = pkgs.writeShellScriptBin "power-menu" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
rofi -show p -modi p:'rofi-power-menu' -theme-str 'window {width: 10em; height: 15em;} listview {lines: 5;}'
|
rofi -show p -modi p:'rofi-power-menu' -theme-str 'window {width: 10em; height: 15em;} listview {lines: 5;}'
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/record.sh → glasshouse-laptop/home/scripts/record.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/record.sh → glasshouse-laptop/home/scripts/record.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
record = pkgs.writeShellScriptBin "record" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
TMP_FILE_UNOPTIMIZED="/tmp/recording_unoptimized.gif"
|
TMP_FILE_UNOPTIMIZED="/tmp/recording_unoptimized.gif"
|
||||||
@@ -123,3 +127,5 @@ case "$1" in
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
'');
|
||||||
|
}
|
||||||
8
glasshouse-laptop/home/scripts/scripts/runbg.sh → glasshouse-laptop/home/scripts/runbg.nix
Executable file → Normal file
8
glasshouse-laptop/home/scripts/scripts/runbg.sh → glasshouse-laptop/home/scripts/runbg.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
runbg = pkgs.writeShellScriptBin "runbg" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
[ $# -eq 0 ] && { # $# is number of args
|
[ $# -eq 0 ] && { # $# is number of args
|
||||||
@@ -13,4 +17,6 @@ shift # remove $1, now $prog, from args
|
|||||||
tty -s && exec </dev/null # if stdin is a terminal, redirect from null
|
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 <&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)
|
tty -s <&2 && exec 2>&1 # stderr to stdout (which might not be null)
|
||||||
"$prog" "$@" & # $@ is all args
|
"$prog" "$@" & # $@ is all args
|
||||||
|
'');
|
||||||
|
}
|
||||||
9
glasshouse-laptop/home/scripts/s_check.nix
Normal file
9
glasshouse-laptop/home/scripts/s_check.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
s_check = pkgs.writeShellScriptBin "s_check" (''
|
||||||
|
#!/run/current-system/sw/bin/bash
|
||||||
|
|
||||||
|
[ "$SOUNDS_ENABLED" -eq 1 ]
|
||||||
|
'');
|
||||||
|
}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
RED=$(tput setaf 1)
|
|
||||||
GREEN=$(tput setaf 2)
|
|
||||||
BLUE=$(tput setaf 4)
|
|
||||||
MAGENTA=$(tput setaf 5)
|
|
||||||
CYAN=$(tput setaf 6)
|
|
||||||
NORMAL=$(tput sgr0)
|
|
||||||
|
|
||||||
echo -e "┌─────────────┬─────────────┬─────────────┬─────────────┐"
|
|
||||||
echo -e "│ ${BLUE}Dec${NORMAL} ${GREEN}Hex${NORMAL} Chr │ ${BLUE}Dec${NORMAL} ${GREEN}Hex${NORMAL} Chr │ ${BLUE}Dec${NORMAL} ${GREEN}Hex${NORMAL} Chr │ ${BLUE}Dec${NORMAL} ${GREEN}Hex${NORMAL} Chr │"
|
|
||||||
echo -e "├─────────────┼─────────────┼─────────────┼─────────────┤"
|
|
||||||
echo -e "│ 0 0 \033[2mNUL\033[0m\033[0m │ 32 20 │ 64 40 ${CYAN}@${NORMAL} │ 96 60 ${CYAN}\`${NORMAL} │"
|
|
||||||
echo -e "│ 1 1 \033[2mSOH\033[0m │ 33 21 ${CYAN}!${NORMAL} │ 65 41 ${GREEN}A${NORMAL} │ 97 61 ${GREEN}a${NORMAL} │"
|
|
||||||
echo -e "│ 2 2 \033[2mSTX\033[0m │ 34 22 ${CYAN}\"${NORMAL} │ 66 42 ${GREEN}B${NORMAL} │ 98 62 ${GREEN}b${NORMAL} │"
|
|
||||||
echo -e "│ 3 3 \033[2mETX\033[0m │ 35 23 ${CYAN}#${NORMAL} │ 67 43 ${GREEN}C${NORMAL} │ 99 63 ${GREEN}c${NORMAL} │"
|
|
||||||
echo -e "│ 4 4 \033[2mEOT\033[0m │ 36 24 ${CYAN}\$${NORMAL} │ 68 44 ${GREEN}D${NORMAL} │ 100 64 ${GREEN}d${NORMAL} │"
|
|
||||||
echo -e "│ 5 5 \033[2mENQ\033[0m │ 37 25 ${CYAN}%${NORMAL} │ 69 45 ${GREEN}E${NORMAL} │ 101 65 ${GREEN}e${NORMAL} │"
|
|
||||||
echo -e "│ 6 6 \033[2mACK\033[0m │ 38 26 ${CYAN}&${NORMAL} │ 70 46 ${GREEN}F${NORMAL} │ 102 66 ${GREEN}f${NORMAL} │"
|
|
||||||
echo -e "│ 7 7 \033[2mBEL\033[0m │ 39 27 ${CYAN}'${NORMAL} │ 71 47 ${GREEN}G${NORMAL} │ 103 67 ${GREEN}g${NORMAL} │"
|
|
||||||
echo -e "│ 8 8 \033[2mBS\033[0m │ 40 28 ${CYAN}(${NORMAL} │ 72 48 ${GREEN}H${NORMAL} │ 104 68 ${GREEN}h${NORMAL} │"
|
|
||||||
echo -e "│ 9 9 \033[2mHT\033[0m │ 41 29 ${CYAN})${NORMAL} │ 73 49 ${GREEN}I${NORMAL} │ 105 69 ${GREEN}i${NORMAL} │"
|
|
||||||
echo -e "│ 10 A \033[2mLF\033[0m │ 42 2A ${CYAN}*${NORMAL} │ 74 4A ${GREEN}J${NORMAL} │ 106 6A ${GREEN}j${NORMAL} │"
|
|
||||||
echo -e "│ 11 B \033[2mVT\033[0m │ 43 2B ${CYAN}+${NORMAL} │ 75 4B ${GREEN}K${NORMAL} │ 107 6B ${GREEN}k${NORMAL} │"
|
|
||||||
echo -e "│ 12 C \033[2mFF\033[0m │ 44 2C ${CYAN},${NORMAL} │ 76 4C ${GREEN}L${NORMAL} │ 108 6C ${GREEN}l${NORMAL} │"
|
|
||||||
echo -e "│ 13 D \033[2mCR\033[0m │ 45 2D ${CYAN}-${NORMAL} │ 77 4D ${GREEN}M${NORMAL} │ 109 6D ${GREEN}m${NORMAL} │"
|
|
||||||
echo -e "│ 14 E \033[2mSO\033[0m │ 46 2E ${CYAN}.${NORMAL} │ 78 4E ${GREEN}N${NORMAL} │ 110 6E ${GREEN}n${NORMAL} │"
|
|
||||||
echo -e "│ 15 F \033[2mSI\033[0m │ 47 2F ${CYAN}/${NORMAL} │ 79 4F ${GREEN}O${NORMAL} │ 111 6F ${GREEN}o${NORMAL} │"
|
|
||||||
echo -e "│ 16 10 \033[2mDLE\033[0m │ 48 30 ${RED}0${NORMAL} │ 80 50 ${GREEN}P${NORMAL} │ 112 70 ${GREEN}p${NORMAL} │"
|
|
||||||
echo -e "│ 17 11 \033[2mDC1\033[0m │ 49 31 ${RED}1${NORMAL} │ 81 51 ${GREEN}Q${NORMAL} │ 113 71 ${GREEN}q${NORMAL} │"
|
|
||||||
echo -e "│ 18 12 \033[2mDC2\033[0m │ 50 32 ${RED}2${NORMAL} │ 82 52 ${GREEN}R${NORMAL} │ 114 72 ${GREEN}r${NORMAL} │"
|
|
||||||
echo -e "│ 19 13 \033[2mDC3\033[0m │ 51 33 ${RED}3${NORMAL} │ 83 53 ${GREEN}S${NORMAL} │ 115 73 ${GREEN}s${NORMAL} │"
|
|
||||||
echo -e "│ 20 14 \033[2mDC4\033[0m │ 52 34 ${RED}4${NORMAL} │ 84 54 ${GREEN}T${NORMAL} │ 116 74 ${GREEN}t${NORMAL} │"
|
|
||||||
echo -e "│ 21 15 \033[2mNAK\033[0m │ 53 35 ${RED}5${NORMAL} │ 85 55 ${GREEN}U${NORMAL} │ 117 75 ${GREEN}u${NORMAL} │"
|
|
||||||
echo -e "│ 22 16 \033[2mSYN\033[0m │ 54 36 ${RED}6${NORMAL} │ 86 56 ${GREEN}V${NORMAL} │ 118 76 ${GREEN}v${NORMAL} │"
|
|
||||||
echo -e "│ 23 17 \033[2mETB\033[0m │ 55 37 ${RED}7${NORMAL} │ 87 57 ${GREEN}W${NORMAL} │ 119 77 ${GREEN}w${NORMAL} │"
|
|
||||||
echo -e "│ 24 18 \033[2mCAN\033[0m │ 56 38 ${RED}8${NORMAL} │ 88 58 ${GREEN}X${NORMAL} │ 120 78 ${GREEN}x${NORMAL} │"
|
|
||||||
echo -e "│ 25 19 \033[2mEM\033[0m │ 57 39 ${RED}9${NORMAL} │ 89 59 ${GREEN}Y${NORMAL} │ 121 79 ${GREEN}y${NORMAL} │"
|
|
||||||
echo -e "│ 26 1A \033[2mSUB\033[0m │ 58 3A ${CYAN}:${NORMAL} │ 90 5A ${GREEN}Z${NORMAL} │ 122 7A ${GREEN}z${NORMAL} │"
|
|
||||||
echo -e "│ 27 1B \033[2mESC\033[0m │ 59 3B ${CYAN};${NORMAL} │ 91 5B ${CYAN}[${NORMAL} │ 123 7B ${CYAN}{${NORMAL} │"
|
|
||||||
echo -e "│ 28 1C \033[2mFS\033[0m │ 60 3C ${CYAN}<${NORMAL} │ 92 5C ${CYAN}\\${NORMAL} │ 124 7C ${CYAN}|${NORMAL} │"
|
|
||||||
echo -e "│ 29 1D \033[2mGS\033[0m │ 61 3D ${CYAN}=${NORMAL} │ 93 5D ${CYAN}]${NORMAL} │ 125 7D ${CYAN}}${NORMAL} │"
|
|
||||||
echo -e "│ 30 1E \033[2mRS\033[0m │ 62 3E ${CYAN}>${NORMAL} │ 94 5E ${CYAN}^${NORMAL} │ 126 7E ${CYAN}~${NORMAL} │"
|
|
||||||
echo -e "│ 31 1F \033[2mUS\033[0m │ 63 3F ${CYAN}?${NORMAL} │ 95 5F ${CYAN}_${NORMAL} │ 127 7F \033[2mDEL\033[0m │"
|
|
||||||
echo -e "└─────────────┴─────────────┴─────────────┴─────────────┘"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/run/current-system/sw/bin/bash
|
|
||||||
|
|
||||||
cargo test && \
|
|
||||||
cargo run
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/run/current-system/sw/bin/bash
|
|
||||||
|
|
||||||
nix run nixpkgs#$"@"
|
|
||||||
@@ -1,281 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This script defines just a mode for rofi instead of being a self-contained
|
|
||||||
# executable that launches rofi by itself. This makes it more flexible than
|
|
||||||
# running rofi inside this script as now the user can call rofi as one pleases.
|
|
||||||
# For instance:
|
|
||||||
#
|
|
||||||
# rofi -show powermenu -modi powermenu:./rofi-power-menu
|
|
||||||
#
|
|
||||||
# See README.md for more information.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -u
|
|
||||||
|
|
||||||
# All supported choices
|
|
||||||
all=(shutdown reboot suspend hibernate lockscreen)
|
|
||||||
|
|
||||||
# By default, show all (i.e., just copy the array)
|
|
||||||
show=("${all[@]}")
|
|
||||||
|
|
||||||
declare -A texts
|
|
||||||
texts[lockscreen]="lock screen"
|
|
||||||
texts[switchuser]="switch user"
|
|
||||||
texts[logout]="log out"
|
|
||||||
texts[suspend]="suspend"
|
|
||||||
texts[hibernate]="hibernate"
|
|
||||||
texts[reboot]="reboot"
|
|
||||||
texts[shutdown]="shut down"
|
|
||||||
|
|
||||||
declare -A icons
|
|
||||||
icons[lockscreen]="\Uf033e"
|
|
||||||
icons[switchuser]="\Uf0019"
|
|
||||||
icons[logout]="\Uf0343"
|
|
||||||
icons[suspend]="\Uf04b2"
|
|
||||||
icons[hibernate]="\Uf02ca"
|
|
||||||
icons[reboot]="\Uf0709"
|
|
||||||
icons[shutdown]="\Uf0425"
|
|
||||||
icons[cancel]="\Uf0156"
|
|
||||||
|
|
||||||
declare -A actions
|
|
||||||
actions[lockscreen]="hyprlock"
|
|
||||||
#actions[switchuser]="???"
|
|
||||||
actions[logout]="sway exit"
|
|
||||||
actions[suspend]="systemctl suspend"
|
|
||||||
actions[hibernate]="systemctl hibernate"
|
|
||||||
actions[reboot]="systemctl reboot"
|
|
||||||
actions[shutdown]="systemctl poweroff"
|
|
||||||
|
|
||||||
# By default, ask for confirmation for actions that are irreversible
|
|
||||||
confirmations=(reboot shutdown hibernate)
|
|
||||||
|
|
||||||
# By default, no dry run
|
|
||||||
dryrun=false
|
|
||||||
showsymbols=true
|
|
||||||
showtext=true
|
|
||||||
|
|
||||||
function check_valid {
|
|
||||||
option="$1"
|
|
||||||
shift 1
|
|
||||||
for entry in "${@}"
|
|
||||||
do
|
|
||||||
if [ -z "${actions[$entry]+x}" ]
|
|
||||||
then
|
|
||||||
echo "Invalid choice in $1: $entry" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse command-line options
|
|
||||||
parsed=$(getopt --options=h --longoptions=help,dry-run,confirm:,choices:,choose:,symbols,no-symbols,text,no-text,symbols-font: --name "$0" -- "$@")
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo 'Terminating...' >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
eval set -- "$parsed"
|
|
||||||
unset parsed
|
|
||||||
while true; do
|
|
||||||
case "$1" in
|
|
||||||
"-h"|"--help")
|
|
||||||
echo "rofi-power-menu - a power menu mode for Rofi"
|
|
||||||
echo
|
|
||||||
echo "Usage: rofi-power-menu [--choices CHOICES] [--confirm CHOICES]"
|
|
||||||
echo " [--choose CHOICE] [--dry-run] [--symbols|--no-symbols]"
|
|
||||||
echo
|
|
||||||
echo "Use with Rofi in script mode. For instance, to ask for shutdown or reboot:"
|
|
||||||
echo
|
|
||||||
echo " rofi -show menu -modi \"menu:rofi-power-menu --choices=shutdown/reboot\""
|
|
||||||
echo
|
|
||||||
echo "Available options:"
|
|
||||||
echo " --dry-run Don't perform the selected action but print it to stderr."
|
|
||||||
echo " --choices CHOICES Show only the selected choices in the given order. Use /"
|
|
||||||
echo " as the separator. Available choices are lockscreen,"
|
|
||||||
echo " logout,suspend, hibernate, reboot and shutdown. By"
|
|
||||||
echo " default, all available choices are shown."
|
|
||||||
echo " --confirm CHOICES Require confirmation for the gives choices only. Use / as"
|
|
||||||
echo " the separator. Available choices are lockscreen, logout,"
|
|
||||||
echo " suspend, hibernate, reboot and shutdown. By default, only"
|
|
||||||
echo " irreversible actions logout, reboot and shutdown require"
|
|
||||||
echo " confirmation."
|
|
||||||
echo " --choose CHOICE Preselect the given choice and only ask for a"
|
|
||||||
echo " confirmation (if confirmation is set to be requested). It"
|
|
||||||
echo " is strongly recommended to combine this option with"
|
|
||||||
echo " --confirm=CHOICE if the choice wouldn't require"
|
|
||||||
echo " confirmation by default. Available choices are"
|
|
||||||
echo " lockscreen, logout, suspend, hibernate, reboot and"
|
|
||||||
echo " shutdown."
|
|
||||||
echo " --[no-]symbols Show Unicode symbols or not. Requires a font with support"
|
|
||||||
echo " for the symbols. Use, for instance, fonts from the"
|
|
||||||
echo " Nerdfonts collection. By default, they are shown"
|
|
||||||
echo " --[no-]text Show text description or not."
|
|
||||||
echo " --symbols-font FONT Use the given font for symbols. By default, the symbols"
|
|
||||||
echo " use the same font as the text. That font is configured"
|
|
||||||
echo " with rofi."
|
|
||||||
echo " -h,--help Show this help text."
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
"--dry-run")
|
|
||||||
dryrun=true
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
"--confirm")
|
|
||||||
IFS='/' read -ra confirmations <<< "$2"
|
|
||||||
check_valid "$1" "${confirmations[@]}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
"--choices")
|
|
||||||
IFS='/' read -ra show <<< "$2"
|
|
||||||
check_valid "$1" "${show[@]}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
"--choose")
|
|
||||||
# Check that the choice is valid
|
|
||||||
check_valid "$1" "$2"
|
|
||||||
selectionID="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
"--symbols")
|
|
||||||
showsymbols=true
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
"--no-symbols")
|
|
||||||
showsymbols=false
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
"--text")
|
|
||||||
showtext=true
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
"--no-text")
|
|
||||||
showtext=false
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
"--symbols-font")
|
|
||||||
symbols_font="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
"--")
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Internal error" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$showsymbols" = "false" -a "$showtext" = "false" ]
|
|
||||||
then
|
|
||||||
echo "Invalid options: cannot have --no-symbols and --no-text enabled at the same time." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define the messages after parsing the CLI options so that it is possible to
|
|
||||||
# configure them in the future.
|
|
||||||
|
|
||||||
function write_message {
|
|
||||||
if [ -z ${symbols_font+x} ];
|
|
||||||
then
|
|
||||||
icon="<span font_size=\"medium\">$1</span>"
|
|
||||||
else
|
|
||||||
icon="<span font=\"${symbols_font}\" font_size=\"medium\">$1</span>"
|
|
||||||
fi
|
|
||||||
text="<span font_size=\"medium\">$2</span>"
|
|
||||||
if [ "$showsymbols" = "true" ]
|
|
||||||
then
|
|
||||||
if [ "$showtext" = "true" ]
|
|
||||||
then
|
|
||||||
echo -n "\u200e$icon \u2068$text\u2069"
|
|
||||||
else
|
|
||||||
echo -n "\u200e$icon"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -n "$text"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function print_selection {
|
|
||||||
echo -e "$1" | $(read -r -d '' entry; echo "echo $entry")
|
|
||||||
}
|
|
||||||
|
|
||||||
declare -A messages
|
|
||||||
declare -A confirmationMessages
|
|
||||||
for entry in "${all[@]}"
|
|
||||||
do
|
|
||||||
messages[$entry]=$(write_message "${icons[$entry]}" "${texts[$entry]^}")
|
|
||||||
done
|
|
||||||
for entry in "${all[@]}"
|
|
||||||
do
|
|
||||||
confirmationMessages[$entry]=$(write_message "${icons[$entry]}" "Yes, ${texts[$entry]}")
|
|
||||||
done
|
|
||||||
confirmationMessages[cancel]=$(write_message "${icons[cancel]}" "No, cancel")
|
|
||||||
|
|
||||||
if [ $# -gt 0 ]
|
|
||||||
then
|
|
||||||
# If arguments given, use those as the selection
|
|
||||||
selection="${@}"
|
|
||||||
else
|
|
||||||
# Otherwise, use the CLI passed choice if given
|
|
||||||
if [ -n "${selectionID+x}" ]
|
|
||||||
then
|
|
||||||
selection="${messages[$selectionID]}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Don't allow custom entries
|
|
||||||
echo -e "\0no-custom\x1ftrue"
|
|
||||||
# Use markup
|
|
||||||
echo -e "\0markup-rows\x1ftrue"
|
|
||||||
|
|
||||||
if [ -z "${selection+x}" ]
|
|
||||||
then
|
|
||||||
echo -e "\0prompt\x1fPower menu"
|
|
||||||
for entry in "${show[@]}"
|
|
||||||
do
|
|
||||||
echo -e "${messages[$entry]}\0icon\x1f${icons[$entry]}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
for entry in "${show[@]}"
|
|
||||||
do
|
|
||||||
if [ "$selection" = "$(print_selection "${messages[$entry]}")" ]
|
|
||||||
then
|
|
||||||
# Check if the selected entry is listed in confirmation requirements
|
|
||||||
for confirmation in "${confirmations[@]}"
|
|
||||||
do
|
|
||||||
if [ "$entry" = "$confirmation" ]
|
|
||||||
then
|
|
||||||
# Ask for confirmation
|
|
||||||
echo -e "\0prompt\x1fAre you sure"
|
|
||||||
echo -e "${confirmationMessages[$entry]}\0icon\x1f${icons[$entry]}"
|
|
||||||
echo -e "${confirmationMessages[cancel]}\0icon\x1f${icons[cancel]}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# If not, then no confirmation is required, so mark confirmed
|
|
||||||
selection=$(print_selection "${confirmationMessages[$entry]}")
|
|
||||||
fi
|
|
||||||
if [ "$selection" = "$(print_selection "${confirmationMessages[$entry]}")" ]
|
|
||||||
then
|
|
||||||
if [ $dryrun = true ]
|
|
||||||
then
|
|
||||||
# Tell what would have been done
|
|
||||||
echo "Selected: $entry" >&2
|
|
||||||
else
|
|
||||||
# Perform the action
|
|
||||||
pkill -9 rofi
|
|
||||||
${actions[$entry]}
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if [ "$selection" = "$(print_selection "${confirmationMessages[cancel]}")" ]
|
|
||||||
then
|
|
||||||
# Do nothing
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# The selection didn't match anything, so raise an error
|
|
||||||
echo "Invalid selection: $selection" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/run/current-system/sw/bin/bash
|
|
||||||
|
|
||||||
[ "$SOUNDS_ENABLED" -eq 1 ]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
dir="$HOME/Pictures/Screenshots"
|
|
||||||
time=$(date +'%Y_%m_%d_at_%Hh%Mm%Ss')
|
|
||||||
file="${dir}/Screenshot_${time}.png"
|
|
||||||
|
|
||||||
copy() {
|
|
||||||
grimblast --notify --freeze copy area
|
|
||||||
}
|
|
||||||
|
|
||||||
save() {
|
|
||||||
grimblast --notify --freeze save area "$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
swappy_() {
|
|
||||||
grimblast --notify --freeze save area "$file"
|
|
||||||
swappy -f "$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ ! -d "$dir" ]]; then
|
|
||||||
mkdir -p "$dir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "--copy" ]]; then
|
|
||||||
copy
|
|
||||||
elif [[ "$1" == "--save" ]]; then
|
|
||||||
save
|
|
||||||
elif [[ "$1" == "--swappy" ]]; then
|
|
||||||
swappy_
|
|
||||||
else
|
|
||||||
echo -e "Available Options: --copy --save --swappy"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
# VM name
|
|
||||||
vm_name="win10"
|
|
||||||
export LIBVIRT_DEFAULT_URI="qemu:///system"
|
|
||||||
|
|
||||||
# change workspace
|
|
||||||
hyprctl dispatch workspace 6
|
|
||||||
|
|
||||||
virsh start ${vm_name}
|
|
||||||
virt-viewer -f -w -a ${vm_name}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
PIDS=$(pgrep -f "swaybg")
|
|
||||||
|
|
||||||
swaybg -m fill -i $1 &
|
|
||||||
|
|
||||||
if [ -n "$PIDS" ]; then
|
|
||||||
echo "$PIDS" | xargs kill
|
|
||||||
fi
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
wallpaper_path=$HOME/Pictures/wallpapers
|
|
||||||
wallpapers_folder=$HOME/Pictures/Wallpapers
|
|
||||||
wallpaper_name="$(ls $wallpapers_folder | rofi -dmenu || pkill rofi)"
|
|
||||||
if [[ -f $wallpapers_folder/$wallpaper_name ]]; then
|
|
||||||
find ~/Pictures/Wallpapers -maxdepth 1 -type f -delete
|
|
||||||
cp $wallpapers_folder/$wallpaper_name $wallpaper_path/$wallpaper_name
|
|
||||||
wall-change $wallpaper_path/$wallpaper_name
|
|
||||||
else
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
6
glasshouse-laptop/home/scripts/scripts/shutdown-script.sh → glasshouse-laptop/home/scripts/shutdown-script.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/shutdown-script.sh → glasshouse-laptop/home/scripts/shutdown-script.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
shutdown-script = pkgs.writeShellScriptBin "shutdown-script" (''
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
|
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
|
||||||
@@ -13,3 +17,5 @@ then
|
|||||||
else
|
else
|
||||||
notify-send "cancel shutdown"
|
notify-send "cancel shutdown"
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/splash.sh → glasshouse-laptop/home/scripts/splash.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/splash.sh → glasshouse-laptop/home/scripts/splash.nix
Executable file → Normal file
@@ -1,6 +1,12 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
splash = pkgs.writeShellScriptBin "splash" (''
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux"
|
echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux"
|
||||||
date +"%A %B %-d %Y"
|
date +"%A %B %-d %Y"
|
||||||
echo -e "\033[38;2;0;180;205m$(toilet -t -f Slant.flf glasshouse)\033[0m"
|
echo -e "\033[38;2;0;180;205m$(toilet -t -f Slant.flf glasshouse)\033[0m"
|
||||||
echo
|
echo
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/switchmon.sh → glasshouse-laptop/home/scripts/switchmon.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/switchmon.sh → glasshouse-laptop/home/scripts/switchmon.nix
Executable file → Normal file
@@ -1,3 +1,9 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
switchmon = pkgs.writeShellScriptBin "switchmon" (''
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
hyprctl dispatch focusmonitor $(echo "$(hyprctl -j monitors)" | jq -r '.[] | select(.focused == false) | .name')
|
hyprctl dispatch focusmonitor $(echo "$(hyprctl -j monitors)" | jq -r '.[] | select(.focused == false) | .name')
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/toggle_blur.sh → glasshouse-laptop/home/scripts/toggle_blur.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/toggle_blur.sh → glasshouse-laptop/home/scripts/toggle_blur.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
toggle_blur = pkgs.writeShellScriptBin "toggle_blur" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
|
if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
|
||||||
@@ -5,3 +9,5 @@ if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
|
|||||||
else
|
else
|
||||||
hyprctl keyword decoration:blur:enabled true >/dev/null
|
hyprctl keyword decoration:blur:enabled true >/dev/null
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/toggle_float.sh → glasshouse-laptop/home/scripts/toggle_float.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/toggle_float.sh → glasshouse-laptop/home/scripts/toggle_float.nix
Executable file → Normal file
@@ -1,5 +1,11 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
toggle_float = pkgs.writeShellScriptBin "toggle_float" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
hyprctl dispatch togglefloating
|
hyprctl dispatch togglefloating
|
||||||
hyprctl dispatch resizeactive exact 950 600
|
hyprctl dispatch resizeactive exact 950 600
|
||||||
hyprctl dispatch centerwindow
|
hyprctl dispatch centerwindow
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/toggle_oppacity.sh → glasshouse-laptop/home/scripts/toggle_oppacity.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/toggle_oppacity.sh → glasshouse-laptop/home/scripts/toggle_oppacity.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
toggle_oppacity = pkgs.writeShellScriptBin "toggle_oppacity" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if hyprctl getoption decoration:active_opacity | grep "float: 1" >/dev/null ; then
|
if hyprctl getoption decoration:active_opacity | grep "float: 1" >/dev/null ; then
|
||||||
@@ -7,3 +11,5 @@ else
|
|||||||
hyprctl keyword decoration:active_opacity 1 >/dev/null
|
hyprctl keyword decoration:active_opacity 1 >/dev/null
|
||||||
hyprctl keyword decoration:inactive_opacity 1 >/dev/null
|
hyprctl keyword decoration:inactive_opacity 1 >/dev/null
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
6
glasshouse-laptop/home/scripts/scripts/toggle_waybar.sh → glasshouse-laptop/home/scripts/toggle_waybar.nix
Executable file → Normal file
6
glasshouse-laptop/home/scripts/scripts/toggle_waybar.sh → glasshouse-laptop/home/scripts/toggle_waybar.nix
Executable file → Normal file
@@ -1,3 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
toggle_waybar = pkgs.writeShellScriptBin "toggle_waybar" (''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
SERVICE=".waybar-wrapped"
|
SERVICE=".waybar-wrapped"
|
||||||
@@ -8,3 +12,5 @@ then
|
|||||||
else
|
else
|
||||||
runbg waybar
|
runbg waybar
|
||||||
fi
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
BIN
media/sound/backspace.wav
Normal file
BIN
media/sound/backspace.wav
Normal file
Binary file not shown.
BIN
media/sound/bell.wav
Normal file
BIN
media/sound/bell.wav
Normal file
Binary file not shown.
BIN
media/sound/cd.wav
Normal file
BIN
media/sound/cd.wav
Normal file
Binary file not shown.
BIN
media/sound/collectgarbage.wav
Normal file
BIN
media/sound/collectgarbage.wav
Normal file
Binary file not shown.
BIN
media/sound/enter.wav
Normal file
BIN
media/sound/enter.wav
Normal file
Binary file not shown.
BIN
media/sound/error.wav
Normal file
BIN
media/sound/error.wav
Normal file
Binary file not shown.
BIN
media/sound/gitpush.wav
Normal file
BIN
media/sound/gitpush.wav
Normal file
Binary file not shown.
BIN
media/sound/login.wav
Normal file
BIN
media/sound/login.wav
Normal file
Binary file not shown.
BIN
media/sound/ls.wav
Normal file
BIN
media/sound/ls.wav
Normal file
Binary file not shown.
BIN
media/sound/move_h.wav
Normal file
BIN
media/sound/move_h.wav
Normal file
Binary file not shown.
BIN
media/sound/move_v.wav
Normal file
BIN
media/sound/move_v.wav
Normal file
Binary file not shown.
BIN
media/sound/nixswitch-start.wav
Normal file
BIN
media/sound/nixswitch-start.wav
Normal file
Binary file not shown.
BIN
media/sound/rm.wav
Normal file
BIN
media/sound/rm.wav
Normal file
Binary file not shown.
BIN
media/sound/screenshot.wav
Normal file
BIN
media/sound/screenshot.wav
Normal file
Binary file not shown.
BIN
media/sound/sh-source.wav
Normal file
BIN
media/sound/sh-source.wav
Normal file
Binary file not shown.
BIN
media/sound/ssh.wav
Normal file
BIN
media/sound/ssh.wav
Normal file
Binary file not shown.
BIN
media/sound/update.wav
Normal file
BIN
media/sound/update.wav
Normal file
Binary file not shown.
BIN
media/sound/update_alt.wav
Normal file
BIN
media/sound/update_alt.wav
Normal file
Binary file not shown.
BIN
media/sound/warning.wav
Normal file
BIN
media/sound/warning.wav
Normal file
Binary file not shown.
BIN
media/wallpapers/catppuccin/cat-leaves.png
Normal file
BIN
media/wallpapers/catppuccin/cat-leaves.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
Reference in New Issue
Block a user