add waybar animation variable, add config files for starship and emoji selector, and add scripts back

This commit is contained in:
Tyler Kelley 2024-05-14 17:53:36 -05:00
parent 66fdbea669
commit 796fa5fbaa
16 changed files with 2116 additions and 6 deletions

1630
config/emoji Normal file

File diff suppressed because it is too large Load Diff

148
config/starship.toml Normal file
View File

@ -0,0 +1,148 @@
## FIRST LINE/ROW: Info & Status
# First param ─┌
[username]
format = " [╭─$user]($style)@"
show_always = true
style_root = "bold red"
style_user = "bold red"
# Second param
[hostname]
disabled = false
format = "[$hostname]($style) in "
ssh_only = false
style = "bold dimmed red"
# If enabled hostnames with dashes will be cut off ##
#trim_at = "-"
# Third param
[directory]
style = "purple"
truncate_to_repo = true
truncation_length = 0
truncation_symbol = "repo: "
# Fourth param
[sudo]
disabled = false
# Before all the version info (python, nodejs, php, etc.)
[git_status]
ahead = "⇡${count}"
behind = "⇣${count}"
deleted = "x"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
style = "white"
# Last param in the first line/row
[cmd_duration]
disabled = true
format = "took [$duration]($style)"
min_time = 1
## SECOND LINE/ROW: Prompt
# Somethere at the beginning
[battery]
charging_symbol = ""
disabled = true
discharging_symbol = ""
full_symbol = ""
[[battery.display]] # "bold red" style when capacity is between 0% and 10%
disabled = false
style = "bold red"
threshold = 15
[[battery.display]] # "bold yellow" style when capacity is between 10% and 30%
disabled = true
style = "bold yellow"
threshold = 50
[[battery.display]] # "bold green" style when capacity is between 10% and 30%
disabled = true
style = "bold green"
threshold = 80
# Prompt: optional param 1
[time]
disabled = true
format = " 🕙 $time($style)\n"
style = "bright-white"
time_format = "%T"
# Prompt: param 2
[character]
error_symbol = " [×](bold red)"
success_symbol = " [╰─](bold red)"
# SYMBOLS
[status]
disabled = false
format = '[\[$symbol$status_common_meaning$status_signal_name$status_maybe_int\]]($style)'
map_symbol = true
pipestatus = true
symbol = "🔴"
[aws]
symbol = " "
[conda]
symbol = " "
[dart]
symbol = " "
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[git_branch]
symbol = " "
[golang]
symbol = " "
[hg_branch]
symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[package]
symbol = " "
[perl]
symbol = " "
[php]
symbol = " "
[python]
symbol = " "
[ruby]
symbol = " "
[rust]
symbol = " "
[swift]
symbol = "ﯣ "

View File

@ -9,7 +9,7 @@
let let
palette = config.colorScheme.palette; palette = config.colorScheme.palette;
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 waybarAnimations;
in in
with lib; with lib;
{ {
@ -217,7 +217,14 @@ with lib;
color: #${palette.base00}; color: #${palette.base00};
background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09}); background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09});
background-size: 300% 300%; background-size: 300% 300%;
${
if waybarAnimations == true then
''
animation: gradient_horizontal 15s ease infinite; animation: gradient_horizontal 15s ease infinite;
''
else
''''
}
opacity: 0.5; opacity: 0.5;
transition: ${betterTransition}; transition: ${betterTransition};
} }
@ -229,7 +236,14 @@ with lib;
color: #${palette.base00}; color: #${palette.base00};
background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09}); background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09});
background-size: 300% 300%; background-size: 300% 300%;
${
if waybarAnimations == true then
''
animation: gradient_horizontal 15s ease infinite; animation: gradient_horizontal 15s ease infinite;
''
else
''''
}
transition: ${betterTransition}; transition: ${betterTransition};
opacity: 1.0; opacity: 1.0;
min-width: 40px; min-width: 40px;
@ -239,7 +253,14 @@ with lib;
color: #${palette.base00}; color: #${palette.base00};
background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09}); background: linear-gradient(45deg, #${palette.base0E}, #${palette.base0F}, #${palette.base0D}, #${palette.base09});
background-size: 300% 300%; background-size: 300% 300%;
${
if waybarAnimations == true then
''
animation: gradient_horizontal 15s ease infinite; animation: gradient_horizontal 15s ease infinite;
''
else
''''
}
opacity: 0.8; opacity: 0.8;
transition: ${betterTransition}; transition: ${betterTransition};
} }
@ -288,7 +309,14 @@ with lib;
color: #${palette.base01}; color: #${palette.base01};
background: linear-gradient(45deg, #${palette.base0C}, #${palette.base0F}, #${palette.base0B}, #${palette.base08}); background: linear-gradient(45deg, #${palette.base0C}, #${palette.base0F}, #${palette.base0B}, #${palette.base08});
background-size: 300% 300%; background-size: 300% 300%;
${
if waybarAnimations == true then
''
animation: gradient_horizontal 15s ease infinite; animation: gradient_horizontal 15s ease infinite;
''
else
''''
}
margin: 4px; margin: 4px;
padding: 2px 10px; padding: 2px 10px;
border-radius: 10px; border-radius: 10px;
@ -360,7 +388,14 @@ with lib;
color: #${palette.base00}; color: #${palette.base00};
background: linear-gradient(45deg, #${palette.base09}, #${palette.base03}, #${palette.base0C}, #${palette.base07}); background: linear-gradient(45deg, #${palette.base09}, #${palette.base03}, #${palette.base0C}, #${palette.base07});
background-size: 300% 300%; background-size: 300% 300%;
${
if waybarAnimations == true then
''
animation: gradient_horizontal 15s ease infinite; animation: gradient_horizontal 15s ease infinite;
''
else
''''
}
margin: 4px; margin: 4px;
padding: 2px 10px; padding: 2px 10px;
border-radius: 10px; border-radius: 10px;

View File

@ -4,6 +4,7 @@
host, host,
inputs, inputs,
username, username,
options,
... ...
}: }:
@ -22,6 +23,10 @@ in
../../modules/local-hardware-clock.nix ../../modules/local-hardware-clock.nix
]; ];
# Kernel
boot.kernelPackages = pkgs.linuxPackages;
# boot.kernelPackages = pkgs.linuxPackages_zen;
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@ -195,6 +200,7 @@ in
}; };
libinput.enable = true; libinput.enable = true;
openssh.enable = true; openssh.enable = true;
flatpak.enable = false;
printing.enable = true; printing.enable = true;
avahi = { avahi = {
enable = true; enable = true;
@ -217,6 +223,13 @@ in
rpcbind.enable = true; rpcbind.enable = true;
nfs.server.enable = true; nfs.server.enable = true;
}; };
systemd.services.flatpak-repo = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.flatpak ];
script = ''
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
'';
};
hardware.sane = { hardware.sane = {
enable = true; enable = true;
extraBackends = [ pkgs.sane-airscan ]; extraBackends = [ pkgs.sane-airscan ];

View File

@ -46,6 +46,8 @@ in
source = ../../config/fonts; source = ../../config/fonts;
recursive = true; recursive = true;
}; };
home.file.".config/starship.toml" = ../../config/starship.toml;
home.file.".emoji".source = .../../config/emoji;
# Install & Configure Git # Install & Configure Git
programs.git = { programs.git = {
@ -69,7 +71,84 @@ in
}; };
}; };
# Scripts
home.packages = with pkgs; [
(import ./../scripts/emopicker9000.nix { inherit pkgs; })
(import ./../scripts/task-waybar.nix { inherit pkgs; })
(import ./../scripts/squirtle.nix { inherit pkgs; })
(import ./../scripts/themechange.nix { inherit pkgs; inherit host; })
(import ./../scripts/theme-selector.nix { inherit pkgs; })
(import ./../scripts/nvidia-offload.nix { inherit pkgs; })
(import ./../scripts/web-search.nix { inherit pkgs; })
(import ./../scripts/rofi-launcher.nix { inherit pkgs; })
(import ./../scripts/screenshootin.nix { inherit pkgs; })
(import ./../scripts/list-hypr-bindings.nix { inherit pkgs; inherit host; })
];
programs = { programs = {
gh.enable = true;
kitty = {
enable = true;
package = pkgs.kitty;
font.name = "JetBrainsMono Nerd Font";
font.size = 16;
settings = {
scrollback_lines = 2000;
wheel_scroll_min_lines = 1;
window_padding_width = 4;
confirm_os_window_close = 0;
background_opacity = "0.85";
};
extraConfig = ''
foreground #${palette.base05}
background #${palette.base00}
color0 #${palette.base03}
color1 #${palette.base08}
color2 #${palette.base0B}
color3 #${palette.base09}
color4 #${palette.base0D}
color5 #${palette.base0E}
color6 #${palette.base0C}
color7 #${palette.base06}
color8 #${palette.base04}
color9 #${palette.base08}
color10 #${palette.base0B}
color11 #${palette.base0A}
color12 #${palette.base0C}
color13 #${palette.base0E}
color14 #${palette.base0C}
color15 #${palette.base07}
color16 #${palette.base00}
color17 #${palette.base0F}
color18 #${palette.base0B}
color19 #${palette.base09}
color20 #${palette.base0D}
color21 #${palette.base0E}
color22 #${palette.base0C}
color23 #${palette.base06}
cursor #${palette.base07}
cursor_text_color #${palette.base00}
selection_foreground #${palette.base01}
selection_background #${palette.base0D}
url_color #${palette.base0C}
active_border_color #${palette.base04}
inactive_border_color #${palette.base00}
bell_border_color #${palette.base03}
tab_bar_style fade
tab_fade 1
active_tab_foreground #${palette.base04}
active_tab_background #${palette.base00}
active_tab_font_style bold
inactive_tab_foreground #${palette.base07}
inactive_tab_background #${palette.base08}
inactive_tab_font_style bold
tab_bar_background #${palette.base00}
'';
};
starship = {
enable = true;
package = pkgs.starship;
};
bash = { bash = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;

View File

@ -12,6 +12,7 @@
# Waybar Settings # Waybar Settings
clock24h = false; clock24h = false;
waybarAnimations = false;
# Program Options # Program Options
browser = "firefox"; # Set Default Browser browser = "firefox"; # Set Default Browser

18
scripts/emopicker9000.nix Normal file
View File

@ -0,0 +1,18 @@
{ pkgs }:
pkgs.writeShellScriptBin "emopicker9000" ''
# Get user selection via wofi from emoji file.
chosen=$(cat $HOME/.emoji | ${pkgs.rofi-wayland}/bin/rofi -dmenu | 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
''

61
scripts/list-hypr-bindings.nix Executable file
View File

@ -0,0 +1,61 @@
{ 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" "Rofi App Launcher" "rofi -show drun" \
" + 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

@ -0,0 +1,9 @@
{ 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 "$@"
''

10
scripts/rofi-launcher.nix Normal file
View File

@ -0,0 +1,10 @@
{ 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
''

View File

@ -0,0 +1,5 @@
{ pkgs }:
pkgs.writeShellScriptBin "screenshootin" ''
grim -g "$(slurp)" - | swappy -f -
''

23
scripts/squirtle.nix Normal file
View File

@ -0,0 +1,23 @@
{ pkgs }:
pkgs.writeShellScriptBin "squirtle" ''
echo "

  
  
  



 
 
 
 
 
 
 
 
 
 
"
''

7
scripts/task-waybar.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs }:
pkgs.writeShellScriptBin "task-waybar" ''
sleep 0.1
${pkgs.swaynotificationcenter}/bin/swaync-client -t &
''

View File

@ -0,0 +1,17 @@
{ pkgs }:
pkgs.writeShellScriptBin "theme-selector" ''
# Get user selection for new theme from base16-themes file
chosen=$(cat $HOME/.base16-themes | ${pkgs.rofi-wayland}/bin/rofi -dmenu)
# Exit if none chosen.
[ -z "$chosen" ] && exit
if [ -n "$1" ]; then
themechange "$chosen"
else
${pkgs.libnotify}/bin/notify-send "$chosen is building please wait" &
themechange "$chosen"
${pkgs.libnotify}/bin/notify-send "Theme: $chosen has been applied." &
fi
''

11
scripts/themechange.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs, host, username, ... }:
pkgs.writeShellScriptBin "themechange" ''
if [[ ! $@ ]];then
echo "No Theme Given"
else
replacement="$1"
sed -i "/^\s*theme[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$replacement\"/" /home/${username}/zaneyos/hosts/${host}/variables.nix
kitty -e pkexec nixos-rebuild switch --flake /home/${username}/zaneyos
fi
''

43
scripts/web-search.nix Normal file
View File

@ -0,0 +1,43 @@
{ pkgs }:
pkgs.writeShellScriptBin "web-search" ''
declare -A URLS
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
gen_list() {
for i in "''${!URLS[@]}"
do
echo "$i"
done
}
main() {
# Pass the list to rofi
platform=$( (gen_list) | ${pkgs.rofi-wayland}/bin/rofi -dmenu )
if [[ -n "$platform" ]]; then
query=$( (echo ) | ${pkgs.rofi-wayland}/bin/rofi -dmenu )
if [[ -n "$query" ]]; then
url=''${URLS[$platform]}$query
xdg-open "$url"
else
exit
fi
else
exit
fi
}
main
exit 0
''