init (podpierdolenie)
This commit is contained in:
17
scripts/emopicker9000.nix
Normal file
17
scripts/emopicker9000.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "emopicker9000" ''
|
||||
# Get user selection via wofi from emoji file.
|
||||
chosen=$(cat $HOME/.config/.emoji | ${pkgs.rofi-wayland}/bin/rofi -i -dmenu -config ~/.config/rofi/config-emoji.rasi | awk '{print $1}')
|
||||
|
||||
# Exit if none chosen.
|
||||
[ -z "$chosen" ] && exit
|
||||
|
||||
# If you run this command with an argument, it will automatically insert the
|
||||
# character. Otherwise, show a message that the emoji has been copied.
|
||||
if [ -n "$1" ]; then
|
||||
${pkgs.ydotool}/bin/ydotool type "$chosen"
|
||||
else
|
||||
printf "$chosen" | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
${pkgs.libnotify}/bin/notify-send "'$chosen' copied to clipboard." &
|
||||
fi
|
||||
''
|
||||
64
scripts/list-hypr-bindings.nix
Executable file
64
scripts/list-hypr-bindings.nix
Executable file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
pkgs,
|
||||
host,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../hosts/${host}/variables.nix) terminal browser;
|
||||
in
|
||||
pkgs.writeShellScriptBin "list-hypr-bindings" ''
|
||||
yad --width=800 --height=650 \
|
||||
--center \
|
||||
--fixed \
|
||||
--title="Hyprland Keybindings" \
|
||||
--no-buttons \
|
||||
--list \
|
||||
--column=Key: \
|
||||
--column=Description: \
|
||||
--column=Command: \
|
||||
--timeout=90 \
|
||||
--timeout-indicator=right \
|
||||
" = Windows/Super/CAPS LOCK" "Modifier Key, used for keybindings" "Doesn't really execute anything by itself." \
|
||||
" + ENTER" "Terminal" "${terminal}" \
|
||||
" + SHIFT + ENTER" "App Launcher" "rofi" \
|
||||
" + ALT + W" "Change Wallpaper" "wallsetter" \
|
||||
" + Q" "Kill Focused Window" "killactive" \
|
||||
" + SHIFT + W" "Search Websites Like Nix Packages" "web-search" \
|
||||
" + SHIFT + N" "Reload SwayNC Styling" "swaync-client -rs" \
|
||||
" + W" "Launch Web Browser" "${browser}" \
|
||||
" + E" "Launch Emoji Selector" "emopicker9000" \
|
||||
" + S" "Take Screenshot" "screenshootin" \
|
||||
" + D" "Launch Discord" "discord" \
|
||||
" + O" "Launch OBS" "obs" \
|
||||
" + G" "Launch GIMP" "gimp" \
|
||||
" + N" "Launch New File Browser Window" "thunar" \
|
||||
" + M" "Launch Plexamp" "Plexamp" \
|
||||
" + P" "Pseudo Tiling" "pseudo" \
|
||||
" + SHIFT + I" "Toggle Split Direction" "togglesplit" \
|
||||
" + F" "Toggle Focused Fullscreen" "fullscreen" \
|
||||
" + SHIFT + F" "Toggle Focused Floating" "fullscreen" \
|
||||
" + SHIFT + C" "Quit / Exit Hyprland" "exit" \
|
||||
" + Left" "Move Focus To Window On The Left" "movefocus,l" \
|
||||
" + Right" "Move Focus To Window On The Right" "movefocus,r" \
|
||||
" + Up" "Move Focus To Window On The Up" "movefocus,u" \
|
||||
" + Down" "Move Focus To Window On The Down" "movefocus,d" \
|
||||
" + SHIFT + Left" "Move Focused Window Left" "movewindow,l" \
|
||||
" + SHIFT + Right" "Move Focused Window Right" "movewindow,r" \
|
||||
" + SHIFT + Up" "Move Focused Window Up" "movewindow,u" \
|
||||
" + SHIFT + Down" "Move Focused Window Down" "movewindow,d" \
|
||||
" + H" "Move Focus To Window On The Left" "movefocus,l" \
|
||||
" + L" "Move Focus To Window On The Right" "movefocus,r" \
|
||||
" + K" "Move Focus To Window On The Up" "movefocus,u" \
|
||||
" + J" "Move Focus To Window On The Down" "movefocus,d" \
|
||||
" + SHIFT + H" "Move Focused Window Left" "movewindow,l" \
|
||||
" + SHIFT + L" "Move Focused Window Right" "movewindow,r" \
|
||||
" + SHIFT + K" "Move Focused Window Up" "movewindow,u" \
|
||||
" + SHIFT + J" "Move Focused Window Down" "movewindow,d" \
|
||||
" + SPACE" "Toggle Special Workspace" "togglespecialworkspace" \
|
||||
" + SHIFT + SPACE" "Send Focused Window To Special Workspace" "movetoworkspace,special" \
|
||||
" + 1-0" "Move To Workspace 1 - 10" "workspace,X" \
|
||||
" + SHIFT + 1-0" "Move Focused Window To Workspace 1 - 10" "movetoworkspace,X" \
|
||||
" + MOUSE_LEFT" "Move/Drag Window" "movewindow" \
|
||||
" + MOUSE_RIGHT" "Resize Window" "resizewindow" \
|
||||
"ALT + TAB" "Cycle Window Focus + Bring To Front" "cyclenext & bringactivetotop" \
|
||||
""
|
||||
''
|
||||
8
scripts/nvidia-offload.nix
Normal file
8
scripts/nvidia-offload.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "nvidia-offload" ''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
''
|
||||
9
scripts/rofi-launcher.nix
Normal file
9
scripts/rofi-launcher.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "rofi-launcher" ''
|
||||
if pgrep -x "rofi" > /dev/null; then
|
||||
# Rofi is running, kill it
|
||||
pkill -x rofi
|
||||
exit 0
|
||||
fi
|
||||
rofi -show drun
|
||||
''
|
||||
4
scripts/screenshootin.nix
Normal file
4
scripts/screenshootin.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "screenshootin" ''
|
||||
grim -g "$(slurp)" - | swappy -f -
|
||||
''
|
||||
22
scripts/squirtle.nix
Normal file
22
scripts/squirtle.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "squirtle" ''
|
||||
echo "
|
||||
[38;2;0;0;0m ████████ ██████
|
||||
[38;2;0;0;0m ██[38;2;82;156;154m██[38;2;115;198;243m██████[38;2;0;0;0m████ ██[38;2;115;198;243m██████[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;115;200;243m████████████[38;2;85;137;157m██[38;2;8;0;0m██[38;2;0;0;0m██ ██[38;2;115;198;243m██████[38;2;79;159;151m████[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;115;200;243m████████████[38;2;123;206;235m██[38;2;46;69;78m██[38;2;189;107;37m██[38;2;0;0;0m████ ██[38;2;115;198;243m████[38;2;82;156;154m██[38;2;57;66;65m██[38;2;68;113;108m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m██[38;2;115;198;243m██[38;2;115;200;243m████[38;2;159;208;204m██[38;2;96;162;155m██[38;2;115;198;243m██████[38;2;82;156;154m██[38;2;66;61;66m██[38;2;214;132;38m██[38;2;198;119;38m██[38;2;0;0;0m██[38;2;86;146;154m██[38;2;107;214;243m██[38;2;82;156;154m██[38;2;66;66;66m██[38;2;82;156;154m████[38;2;0;0;0m██
|
||||
[38;2;0;0;0m██[38;2;115;198;243m██[38;2;115;200;243m████[38;2;33;115;105m██[38;2;222;255;254m██[38;2;0;0;0m██[38;2;115;198;243m████[38;2;82;156;154m██[38;2;66;61;66m██[38;2;140;96;52m██[38;2;198;119;38m████[38;2;66;78;66m██[38;2;86;146;154m██[38;2;82;156;154m██[38;2;66;66;66m██[38;2;82;156;154m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m██[38;2;115;198;243m██[38;2;115;200;243m████[38;2;77;144;162m██[38;2;0;4;0m██[38;2;41;8;1m██[38;2;123;214;235m██[38;2;82;156;154m████[38;2;66;66;66m██[38;2;255;255;255m██[38;2;140;82;44m██[38;2;214;140;46m██[38;2;90;103;88m██[38;2;49;111;121m██[38;2;85;159;151m██[38;2;46;80;76m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;115;200;243m████[38;2;115;214;243m██[38;2;0;4;0m██[38;2;68;77;79m██[38;2;96;145;157m██[38;2;82;156;154m██[38;2;66;66;66m██[38;2;192;192;192m██[38;2;255;255;255m██[38;2;140;82;44m██[38;2;214;140;46m██[38;2;173;86;21m██[38;2;90;103;88m██[38;2;85;159;151m██[38;2;8;0;0m██[38;2;0;0;0m
|
||||
[38;2;0;0;0m [38;2;8;0;0m██[38;2;49;77;76m██[38;2;82;156;154m████[38;2;99;132;115m████[38;2;57;74;81m██[38;2;118;129;107m██[38;2;66;66;66m██[38;2;148;198;220m██[38;2;255;255;255m██[38;2;140;82;44m██[38;2;189;103;37m██[38;2;66;66;66m██[38;2;82;156;154m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m [38;2;8;0;0m██[38;2;91;154;152m██[38;2;66;66;66m████[38;2;49;103;113m██[38;2;198;189;118m██[38;2;239;239;159m██[38;2;57;74;81m██[38;2;148;198;220m██[38;2;66;66;66m██[38;2;255;255;255m██[38;2;140;82;44m██[38;2;148;91;47m██[38;2;66;66;66m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ████[38;2;247;231;143m██████[38;2;66;66;66m██[38;2;115;198;243m██████[38;2;66;66;66m██[38;2;140;82;44m██[38;2;189;107;37m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;206;173;94m████[38;2;66;66;66m██[38;2;115;198;243m████[38;2;82;156;154m██[38;2;66;66;66m██[38;2;140;82;44m██[38;2;189;107;37m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;57;115;105m██[38;2;80;85;69m██[38;2;239;239;159m██[38;2;255;231;127m██[38;2;74;66;58m██[38;2;82;156;154m██[38;2;66;66;66m██[38;2;58;69;71m██[38;2;173;198;197m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;57;115;105m██[38;2;80;85;69m██[38;2;0;8;24m██[38;2;195;176;104m████[38;2;66;66;66m████[38;2;115;133;134m██[38;2;58;69;71m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ████ ██[38;2;66;66;66m██[38;2;115;206;243m██[38;2;76;151;151m██[38;2;82;156;154m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██[38;2;76;151;151m██[38;2;57;123;105m██[38;2;82;156;154m██[38;2;0;0;0m██
|
||||
[38;2;0;0;0m ██████ [0m
|
||||
"
|
||||
''
|
||||
5
scripts/task-waybar.nix
Normal file
5
scripts/task-waybar.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "task-waybar" ''
|
||||
sleep 0.1
|
||||
${pkgs.swaynotificationcenter}/bin/swaync-client -t &
|
||||
''
|
||||
14
scripts/wallsetter.nix
Normal file
14
scripts/wallsetter.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "wallsetter" ''
|
||||
|
||||
for pid in $(pidof -o %PPID -x wallsetter); do
|
||||
kill $pid
|
||||
done
|
||||
|
||||
if ! [ -d ~/Pictures/Wallpapers ]; then notify-send -t 5000 "~/Pictures/Wallpapers does not exist" && exit 1; fi
|
||||
if [ $(ls -1 ~/Pictures/Wallpapers | wc -l) -lt 1 ]; then notify-send -t 9000 "The wallpaper folder is expected to have more than 1 image. Exiting Wallsetter." && exit 1; fi
|
||||
|
||||
WALLPAPER=$(find ~/Pictures/Wallpapers -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1)
|
||||
|
||||
${pkgs.swww}/bin/swww img "$WALLPAPER" --transition-type random --transition-step 1 --transition-fps 60
|
||||
''
|
||||
42
scripts/web-search.nix
Normal file
42
scripts/web-search.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "web-search" ''
|
||||
declare -A URLS
|
||||
|
||||
URLS=(
|
||||
["🌎 Search"]="https://search.garandplg.com/search?q="
|
||||
["❄️ Unstable Packages"]="https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query="
|
||||
["🎞️ YouTube"]="https://www.youtube.com/results?search_query="
|
||||
["🦥 Arch Wiki"]="https://wiki.archlinux.org/title/"
|
||||
["🐃 Gentoo Wiki"]="https://wiki.gentoo.org/index.php?title="
|
||||
)
|
||||
|
||||
# List for rofi
|
||||
gen_list() {
|
||||
for i in "''${!URLS[@]}"
|
||||
do
|
||||
echo "$i"
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
# Pass the list to rofi
|
||||
platform=$( (gen_list) | ${pkgs.wofi}/bin/wofi -dmenu )
|
||||
|
||||
if [[ -n "$platform" ]]; then
|
||||
query=$( (echo ) | ${pkgs.wofi}/bin/wofi -dmenu )
|
||||
|
||||
if [[ -n "$query" ]]; then
|
||||
url=''${URLS[$platform]}$query
|
||||
xdg-open "$url"
|
||||
else
|
||||
exit
|
||||
fi
|
||||
else
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
exit 0
|
||||
''
|
||||
Reference in New Issue
Block a user