initial commit
This commit is contained in:
3
users/scripts/askpass.nix
Normal file
3
users/scripts/askpass.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "askpass" ''
|
||||
${pkgs.wofi}/bin/wofi -d -P -L 1 -p "$(printf $1 | sed s/://)"''
|
||||
3
users/scripts/backup.nix
Normal file
3
users/scripts/backup.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "backup" ''
|
||||
cp -r "$1" "$1.bak.$(date +%Y%m%d%H%M%S)"''
|
||||
4
users/scripts/hyprland-autostart.nix
Normal file
4
users/scripts/hyprland-autostart.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "hyprland-autostart" ''
|
||||
${pkgs.waybar}/bin/waybar &
|
||||
${pkgs.wlsunset}/bin/wlsunset -l 48.5 -L 2.2 -d 1500''
|
||||
3
users/scripts/keygen.nix
Normal file
3
users/scripts/keygen.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "keygen"
|
||||
"tr -cd '[:alnum:]' < /dev/urandom | fold -w 64 | head -n 1 | tr -d '\n'"
|
||||
10
users/scripts/launch-with-emacsclient.nix
Normal file
10
users/scripts/launch-with-emacsclient.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
pkgs,
|
||||
emacsPackage,
|
||||
...
|
||||
}:
|
||||
pkgs.writeShellScriptBin "launch-with-emacsclient" ''
|
||||
filename="$1"
|
||||
line="$2"
|
||||
column="$3"
|
||||
${emacsPackage}/bin/emacsclient +$line:$column "$filename"''
|
||||
3
users/scripts/mp42webm.nix
Normal file
3
users/scripts/mp42webm.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "mp42webm" ''
|
||||
${pkgs.ffmpeg}/bin/ffmpeg -i "$1" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "$1".webm''
|
||||
18
users/scripts/scripts.nix
Normal file
18
users/scripts/scripts.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
askpass = import ./askpass.nix {inherit pkgs;};
|
||||
in [
|
||||
askpass
|
||||
(import ./backup.nix {inherit pkgs;})
|
||||
(import ./hyprland-autostart.nix {inherit pkgs;})
|
||||
(import ./keygen.nix {inherit pkgs;})
|
||||
(import ./launch-with-emacsclient.nix {
|
||||
inherit pkgs;
|
||||
emacsPackage = config.emacsPkg;
|
||||
})
|
||||
(import ./mp42webm.nix {inherit pkgs;})
|
||||
(import ./sshbind.nix {inherit pkgs;})
|
||||
]
|
||||
3
users/scripts/sshbind.nix
Normal file
3
users/scripts/sshbind.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "sshbind" ''
|
||||
ssh -L "$1:$3:$1" "$2" -N''
|
||||
18
users/scripts/ytplay.nix
Normal file
18
users/scripts/ytplay.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{pkgs, ...}: let
|
||||
rofi = pkgs.rofi-wayland;
|
||||
in
|
||||
pkgs.writeShellScriptBin "ytplay" ''
|
||||
URL=$(${rofi}/bin/rofi -dmenu -i -p "Video URL")
|
||||
if [ -z "$URL" ]; then
|
||||
echo "You need to provide a URL"
|
||||
exit 1
|
||||
fi
|
||||
RESOLUTION_CHOICE=$(${pkgs.yt-dlp}/bin/yt-dlp --list-formats "$URL" | \
|
||||
grep -E "webm.*[0-9]+x[0-9]" | \
|
||||
awk '{print $3 " " $1}' | \
|
||||
sort -gu | \
|
||||
${rofi}/bin/rofi -dmenu -i -p "Resolution")
|
||||
mapfile -t RESOLUTION <<< "$RESOLUTION_CHOICE"
|
||||
RESOLUTION_CODE=''${RESOLUTION[0]}
|
||||
${pkgs.mpv}/bin/mpv --ytdl-format="''${RESOLUTION_CODE}+bestaudio/best" "$URL"
|
||||
''
|
||||
Reference in New Issue
Block a user