using a modified version of jakoolits keybind script and fixing scripts

This commit is contained in:
Tyler Kelley 2025-02-17 14:50:36 -06:00
parent c2e17fbf15
commit 499a65cfd8
7 changed files with 325 additions and 371 deletions

View File

@ -68,6 +68,5 @@
v4l-utils v4l-utils
virt-viewer virt-viewer
wget wget
yad
]; ];
} }

View File

@ -1,21 +1,20 @@
{ pkgs, username, host, ... }:
{ {
pkgs,
username,
...
}: {
home.packages = [ home.packages = [
(import ./emopicker9000.nix { inherit pkgs; }) (import ./emopicker9000.nix {inherit pkgs;})
(import ./task-waybar.nix { inherit pkgs; }) (import ./keybinds.nix {inherit pkgs;})
(import ./squirtle.nix { inherit pkgs; }) (import ./task-waybar.nix {inherit pkgs;})
(import ./nvidia-offload.nix { inherit pkgs; }) (import ./squirtle.nix {inherit pkgs;})
(import ./nvidia-offload.nix {inherit pkgs;})
(import ./wallsetter.nix { (import ./wallsetter.nix {
inherit pkgs; inherit pkgs;
inherit username; inherit username;
}) })
(import ./web-search.nix { inherit pkgs; }) (import ./web-search.nix {inherit pkgs;})
(import ./rofi-launcher.nix { inherit pkgs; }) (import ./rofi-launcher.nix {inherit pkgs;})
(import ./screenshootin.nix { inherit pkgs; }) (import ./screenshootin.nix {inherit pkgs;})
(import ./list-hypr-bindings.nix {
inherit pkgs;
inherit host;
})
]; ];
} }

View File

@ -0,0 +1,15 @@
{pkgs}:
pkgs.writeShellScriptBin "list-keybinds" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
rofi_theme="$HOME/.config/rofi/config-wide.rasi"
msg=' NOTE : Clicking with Mouse or Pressing ENTER will have NO function'
keybinds=$(cat ~/.config/hypr/hyprland.conf | grep modifier)
# use rofi to display the keybinds with the modified content
echo "$keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg"
''

View File

@ -1,62 +0,0 @@
{ 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 Spotify" "spotify" \
" + 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" \
""
''

View File

@ -1,10 +1,8 @@
{ pkgs }: {pkgs}:
pkgs.writeShellScriptBin "rofi-launcher" '' pkgs.writeShellScriptBin "rofi-launcher" ''
if pgrep -x "rofi" > /dev/null; then # check if rofi is already running
# Rofi is running, kill it if pidof rofi > /dev/null; then
pkill -x rofi pkill rofi
exit 0
fi fi
rofi -show drun rofi -show drun
'' ''

View File

@ -1,40 +1,45 @@
{pkgs}: {pkgs}:
pkgs.writeShellScriptBin "web-search" '' pkgs.writeShellScriptBin "web-search" ''
declare -A URLS # check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
URLS=( declare -A URLS
["🌎 Search"]="https://search.brave.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 URLS=(
gen_list() { ["🌎 Search"]="https://search.brave.com/search?q="
for i in "''${!URLS[@]}" [" Unstable Packages"]="https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query="
do ["🎞 YouTube"]="https://www.youtube.com/results?search_query="
echo "$i" ["🦥 Arch Wiki"]="https://wiki.archlinux.org/title/"
done ["🐃 Gentoo Wiki"]="https://wiki.gentoo.org/index.php?title="
} )
main() { # List for rofi
# Pass the list to rofi gen_list() {
platform=$( (gen_list) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi ) for i in "''${!URLS[@]}"
do
echo "$i"
done
}
if [[ -n "$platform" ]]; then main() {
query=$( (echo ) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi ) # Pass the list to rofi
platform=$( (gen_list) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi )
if [[ -n "$query" ]]; then if [[ -n "$platform" ]]; then
url=''${URLS[$platform]}$query query=$( (echo ) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi )
xdg-open "$url"
else if [[ -n "$query" ]]; then
exit url=''${URLS[$platform]}$query
fi xdg-open "$url"
else else
exit exit
fi fi
} else
exit
fi
}
main main

View File

@ -4,274 +4,274 @@
host, host,
config, config,
... ...
}: }: let
let
betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)";
inherit (import ../../hosts/${host}/variables.nix) clock24h; inherit (import ../../hosts/${host}/variables.nix) clock24h;
in in
with lib; with lib; {
{ # Configure & Theme Waybar
# Configure & Theme Waybar programs.waybar = {
programs.waybar = { enable = true;
enable = true; package = pkgs.waybar;
package = pkgs.waybar; settings = [
settings = [ {
{ layer = "top";
layer = "top"; position = "top";
position = "top"; modules-center = ["hyprland/workspaces"];
modules-center = [ "hyprland/workspaces" ]; modules-left = [
modules-left = [ "custom/startmenu"
"custom/startmenu" "hyprland/window"
"hyprland/window" "pulseaudio"
"pulseaudio" "cpu"
"cpu" "memory"
"memory" "idle_inhibitor"
"idle_inhibitor" ];
]; modules-right = [
modules-right = [ "custom/hyprbindings"
"custom/hyprbindings" "custom/notification"
"custom/notification" "custom/exit"
"custom/exit" "battery"
"battery" "tray"
"tray" "clock"
"clock" ];
];
"hyprland/workspaces" = { "hyprland/workspaces" = {
format = "{name}"; format = "{name}";
format-icons = { format-icons = {
default = " "; default = " ";
active = " "; active = " ";
urgent = " "; urgent = " ";
};
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
}; };
on-scroll-up = "hyprctl dispatch workspace e+1"; "clock" = {
on-scroll-down = "hyprctl dispatch workspace e-1"; format =
}; if clock24h == true
"clock" = { then '' {:L%H:%M}''
format = if clock24h == true then '' {:L%H:%M}'' else '' {:L%I:%M %p}''; else '' {:L%I:%M %p}'';
tooltip = true; tooltip = true;
tooltip-format = "<big>{:%A, %d.%B %Y }</big>\n<tt><small>{calendar}</small></tt>"; tooltip-format = "<big>{:%A, %d.%B %Y }</big>\n<tt><small>{calendar}</small></tt>";
};
"hyprland/window" = {
max-length = 22;
separate-outputs = false;
rewrite = {
"" = " 🙈 No Windows? ";
}; };
}; "hyprland/window" = {
"memory" = { max-length = 22;
interval = 5; separate-outputs = false;
format = " {}%"; rewrite = {
tooltip = true; "" = " 🙈 No Windows? ";
}; };
"cpu" = { };
interval = 5; "memory" = {
format = " {usage:2}%"; interval = 5;
tooltip = true; format = " {}%";
}; tooltip = true;
"disk" = { };
format = " {free}"; "cpu" = {
tooltip = true; interval = 5;
}; format = " {usage:2}%";
"network" = { tooltip = true;
format-icons = [ };
"󰤯" "disk" = {
"󰤟" format = " {free}";
"󰤢" tooltip = true;
"󰤥" };
"󰤨" "network" = {
]; format-icons = [
format-ethernet = " {bandwidthDownOctets}"; "󰤯"
format-wifi = "{icon} {signalStrength}%"; "󰤟"
format-disconnected = "󰤮"; "󰤢"
tooltip = false; "󰤥"
}; "󰤨"
"tray" = {
spacing = 12;
};
"pulseaudio" = {
format = "{icon} {volume}% {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = " {icon} {format_source}";
format-muted = " {format_source}";
format-source = " {volume}%";
format-source-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [
""
""
""
]; ];
format-ethernet = " {bandwidthDownOctets}";
format-wifi = "{icon} {signalStrength}%";
format-disconnected = "󰤮";
tooltip = false;
}; };
on-click = "sleep 0.1 && pavucontrol"; "tray" = {
}; spacing = 12;
"custom/exit" = {
tooltip = false;
format = "";
on-click = "sleep 0.1 && wlogout";
};
"custom/startmenu" = {
tooltip = false;
format = "";
# exec = "rofi -show drun";
on-click = "sleep 0.1 && rofi-launcher";
};
"custom/hyprbindings" = {
tooltip = false;
format = "󱕴";
on-click = "sleep 0.1 && list-hypr-bindings";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
}; };
tooltip = "true"; "pulseaudio" = {
}; format = "{icon} {volume}% {format_source}";
"custom/notification" = { format-bluetooth = "{volume}% {icon} {format_source}";
tooltip = false; format-bluetooth-muted = " {icon} {format_source}";
format = "{icon} {}"; format-muted = " {format_source}";
format-icons = { format-source = " {volume}%";
notification = "<span foreground='red'><sup></sup></span>"; format-source-muted = "";
none = ""; format-icons = {
dnd-notification = "<span foreground='red'><sup></sup></span>"; headphone = "";
dnd-none = ""; hands-free = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>"; headset = "";
inhibited-none = ""; phone = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>"; portable = "";
dnd-inhibited-none = ""; car = "";
default = [
""
""
""
];
};
on-click = "sleep 0.1 && pavucontrol";
}; };
return-type = "json"; "custom/exit" = {
exec-if = "which swaync-client"; tooltip = false;
exec = "swaync-client -swb"; format = "";
on-click = "sleep 0.1 && task-waybar"; on-click = "sleep 0.1 && wlogout";
escape = true; };
}; "custom/startmenu" = {
"battery" = { tooltip = false;
states = { format = "";
warning = 30; # exec = "rofi -show drun";
critical = 15; on-click = "sleep 0.1 && rofi-launcher";
};
"custom/hyprbindings" = {
tooltip = false;
format = "󱕴";
on-click = "sleep 0.1 && list-keybinds";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
tooltip = "true";
};
"custom/notification" = {
tooltip = false;
format = "{icon} {}";
format-icons = {
notification = "<span foreground='red'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "sleep 0.1 && task-waybar";
escape = true;
};
"battery" = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = "󰂄 {capacity}%";
format-plugged = "󱘖 {capacity}%";
format-icons = [
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
on-click = "";
tooltip = false;
}; };
format = "{icon} {capacity}%";
format-charging = "󰂄 {capacity}%";
format-plugged = "󱘖 {capacity}%";
format-icons = [
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
on-click = "";
tooltip = false;
};
}
];
style = concatStrings [
''
* {
font-family: JetBrainsMono Nerd Font Mono;
font-size: 16px;
border-radius: 0px;
border: none;
min-height: 0px;
} }
window#waybar { ];
background: rgba(0,0,0,0); style = concatStrings [
} ''
#workspaces { * {
color: #${config.lib.stylix.colors.base00}; font-family: JetBrainsMono Nerd Font Mono;
background: #${config.lib.stylix.colors.base01}; font-size: 16px;
margin: 4px 4px; border-radius: 0px;
padding: 5px 5px; border: none;
border-radius: 16px; min-height: 0px;
} }
#workspaces button { window#waybar {
font-weight: bold; background: rgba(0,0,0,0);
padding: 0px 5px; }
margin: 0px 3px; #workspaces {
border-radius: 16px; color: #${config.lib.stylix.colors.base00};
color: #${config.lib.stylix.colors.base00}; background: #${config.lib.stylix.colors.base01};
background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); margin: 4px 4px;
opacity: 0.5; padding: 5px 5px;
transition: ${betterTransition}; border-radius: 16px;
} }
#workspaces button.active { #workspaces button {
font-weight: bold; font-weight: bold;
padding: 0px 5px; padding: 0px 5px;
margin: 0px 3px; margin: 0px 3px;
border-radius: 16px; border-radius: 16px;
color: #${config.lib.stylix.colors.base00}; color: #${config.lib.stylix.colors.base00};
background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D});
transition: ${betterTransition}; opacity: 0.5;
opacity: 1.0; transition: ${betterTransition};
min-width: 40px; }
} #workspaces button.active {
#workspaces button:hover { font-weight: bold;
font-weight: bold; padding: 0px 5px;
border-radius: 16px; margin: 0px 3px;
color: #${config.lib.stylix.colors.base00}; border-radius: 16px;
background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); color: #${config.lib.stylix.colors.base00};
opacity: 0.8; background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D});
transition: ${betterTransition}; transition: ${betterTransition};
} opacity: 1.0;
tooltip { min-width: 40px;
background: #${config.lib.stylix.colors.base00}; }
border: 1px solid #${config.lib.stylix.colors.base08}; #workspaces button:hover {
border-radius: 12px; font-weight: bold;
} border-radius: 16px;
tooltip label { color: #${config.lib.stylix.colors.base00};
color: #${config.lib.stylix.colors.base08}; background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D});
} opacity: 0.8;
#window, #pulseaudio, #cpu, #memory, #idle_inhibitor { transition: ${betterTransition};
font-weight: bold; }
margin: 4px 0px; tooltip {
margin-left: 7px; background: #${config.lib.stylix.colors.base00};
padding: 0px 18px; border: 1px solid #${config.lib.stylix.colors.base08};
background: #${config.lib.stylix.colors.base04}; border-radius: 12px;
color: #${config.lib.stylix.colors.base00}; }
border-radius: 24px 10px 24px 10px; tooltip label {
} color: #${config.lib.stylix.colors.base08};
#custom-startmenu { }
color: #${config.lib.stylix.colors.base0B}; #window, #pulseaudio, #cpu, #memory, #idle_inhibitor {
background: #${config.lib.stylix.colors.base02}; font-weight: bold;
font-size: 28px; margin: 4px 0px;
margin: 0px; margin-left: 7px;
padding: 0px 30px 0px 15px; padding: 0px 18px;
border-radius: 0px 0px 40px 0px; background: #${config.lib.stylix.colors.base04};
} color: #${config.lib.stylix.colors.base00};
#custom-hyprbindings, #network, #battery, border-radius: 24px 10px 24px 10px;
#custom-notification, #tray, #custom-exit { }
font-weight: bold; #custom-startmenu {
background: #${config.lib.stylix.colors.base0F}; color: #${config.lib.stylix.colors.base0B};
color: #${config.lib.stylix.colors.base00}; background: #${config.lib.stylix.colors.base02};
margin: 4px 0px; font-size: 28px;
margin-right: 7px; margin: 0px;
border-radius: 10px 24px 10px 24px; padding: 0px 30px 0px 15px;
padding: 0px 18px; border-radius: 0px 0px 40px 0px;
} }
#clock { #custom-hyprbindings, #network, #battery,
font-weight: bold; #custom-notification, #tray, #custom-exit {
color: #0D0E15; font-weight: bold;
background: linear-gradient(90deg, #${config.lib.stylix.colors.base0E}, #${config.lib.stylix.colors.base0C}); background: #${config.lib.stylix.colors.base0F};
margin: 0px; color: #${config.lib.stylix.colors.base00};
padding: 0px 15px 0px 30px; margin: 4px 0px;
border-radius: 0px 0px 0px 40px; margin-right: 7px;
} border-radius: 10px 24px 10px 24px;
'' padding: 0px 18px;
]; }
}; #clock {
} font-weight: bold;
color: #0D0E15;
background: linear-gradient(90deg, #${config.lib.stylix.colors.base0E}, #${config.lib.stylix.colors.base0C});
margin: 0px;
padding: 0px 15px 0px 30px;
border-radius: 0px 0px 0px 40px;
}
''
];
};
}