3 Commits

9 changed files with 124 additions and 26 deletions

19
dev-env
View File

@@ -42,8 +42,8 @@ update_dirs() {
log "copying over files from: $1" log "copying over files from: $1"
pushd $1 &>/dev/null pushd $1 &>/dev/null
( (
# Copy everything except systemd and zsh folders, they need treated differently. # Copy everything except systemd, share, and zsh folders, they need treated differently.
configs=$(find . -mindepth 1 -maxdepth 1 -type d \( -name "systemd" -o -name "zsh" \) -prune -o -type d -print) configs=$(find . -mindepth 1 -maxdepth 1 -type d \( -name "systemd" -o -name "zsh" -o -name "share" \) -prune -o -type d -print)
for c in $configs; do for c in $configs; do
directory=${2%/}/${c#./} directory=${2%/}/${c#./}
log " removing: rm -rf $directory" log " removing: rm -rf $directory"
@@ -103,14 +103,14 @@ update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME
update_dirs $DEV_ENV/env/.local $HOME/.local update_dirs $DEV_ENV/env/.local $HOME/.local
# SYSTEMD # SYSTEMD
mkdir -p $XDG_CONFIG_HOME/systemd/user mkdir -p $XDG_CONFIG_HOME/systemd/user >/dev/null 2>&1
copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user
# ZSH # ZSH
# NOTE: This keeps from clobbering zsh history and plugins vs. wiping the entire directory and # NOTE: This keeps from clobbering zsh history and plugins vs. wiping the entire directory and
# copying configuration. # copying configuration.
copy $DEV_ENV/env/.zshenv $HOME/.zshenv copy $DEV_ENV/env/.zshenv $HOME/.zshenv
mkdir -p $XDG_CONFIG_HOME/zsh mkdir -p $XDG_CONFIG_HOME/zsh >/dev/null 2>&1
update_dirs $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh update_dirs $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
copy_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh copy_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
@@ -118,18 +118,23 @@ copy_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
copy $DEV_ENV/env/.tmux.conf $HOME/.tmux.conf copy $DEV_ENV/env/.tmux.conf $HOME/.tmux.conf
# GPG # GPG
mkdir $HOME/.gnupg mkdir $HOME/.gnupg >/dev/null 2>&1
copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg
# Wallpapers # Wallpapers
mkdir $HOME/wallpapers mkdir $HOME/wallpapers >/dev/null 2>&1
copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers
# MISC # MISC
mkdir $HOME/Pictures mkdir $HOME/Pictures >/dev/null 2>&1
mkdir -p $XDG_DATA_HOME/clipse/tmp_files mkdir -p $XDG_DATA_HOME/clipse/tmp_files
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
mkdir -p $XDG_DATA_HOME/applications/icons
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
copy_files $DEV_ENV/env/.local/share/applications/icons $XDG_DATA_HOME/applications/icons
# TODO: Copy icons
systemctl --user daemon-reload systemctl --user daemon-reload
hyprctl reload hyprctl reload
exec zsh -l exec zsh -l

View File

@@ -52,13 +52,14 @@ bindd = $mainMod, J, Focus window - down, movefocus, d
bindd = $mainMod, K, Focus window - up, movefocus, u # move window focus using vim keys bindd = $mainMod, K, Focus window - up, movefocus, u # move window focus using vim keys
bindd = $mainMod, L, Focus window - right, movefocus, r # move window focus using vim keys bindd = $mainMod, L, Focus window - right, movefocus, r # move window focus using vim keys
bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1 bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1
bindd = $mainMod, M, [M]usic - apple, exec, $pwa --focus "https://music.apple.com" bindd = $HYPER, L, [L]ock computer, exec, hyprlock
bindd = $mainMod, M, [M]usic - apple, exec, $pwa --special music "https://music.apple.com"
bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/toggle-waybar bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/toggle-waybar
bindd = $mainMod, P, [P]assword manager, exec, $pwa --special pass "https://pass.proton.me" bindd = $mainMod, P, [P]assword manager, exec, $pwa --special pass "https://pass.proton.me"
bindd = $mainMod SHIFT, P, Toggle [p]seudo window mode, pseudo, # dwindle bindd = $mainMod SHIFT, P, Toggle [p]seudo window mode, pseudo, # dwindle
bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybar-restart bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybar-restart
bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace
bindd = $mainMod, Y, [Y]ouTube, exec, $pwa "https://youtube.com" bindd = $mainMod, Y, [Y]ouTube, exec, $pwa --focus "https://youtube.com"
bindd = $mainMod, U, [U]nifi, exec, $pwa "https://unifi.ui.com" bindd = $mainMod, U, [U]nifi, exec, $pwa "https://unifi.ui.com"
bindd = $mainMod SHIFT, U, [U]ninstall desktop app, exec, $uninstallDesktop bindd = $mainMod SHIFT, U, [U]ninstall desktop app, exec, $uninstallDesktop
bindd = $mainMod, V, Clipboard history, exec, $clipboardHistory bindd = $mainMod, V, Clipboard history, exec, $clipboardHistory
@@ -80,24 +81,24 @@ bindd = $mainMod, 0, Switch to workspace 1[0], workspace, 10
bindd = $mainMod SHIFT, 1, Switch all workspaces to monitor [1], exec, $scripts/mv-all-workspaces-to-monitor 1 bindd = $mainMod SHIFT, 1, Switch all workspaces to monitor [1], exec, $scripts/mv-all-workspaces-to-monitor 1
bindd = $mainMod SHIFT, 0, Switch all workspaces to monitor [0], exec, $scripts/mv-all-workspaces-to-monitor 0 bindd = $mainMod SHIFT, 0, Switch all workspaces to monitor [0], exec, $scripts/mv-all-workspaces-to-monitor 0
#################################################### #######################################################################################
# Window controls # Window controls
# #
# These should in general use the $windowMod prefix # These should in general use the $windowMod prefix
###################################################### #######################################################################################
# MOD # KEY # DESC # Action # # MOD # KEY # DESC # Action #
###################################################### #######################################################################################
bindd = CTRL SHIFT, F, Toggle [f]loating, exec, $scripts/window-toggle-floating bindd = CTRL SHIFT, F, Toggle [f]loating, exec, $scripts/window-toggle-floating
# TODO: Decide which is prefered to switch to fullscreen. # TODO: Decide which is prefered to switch to fullscreen.
bindd = CTRL, F, Toggle [f]ullscreen, fullscreen, bindd = CTRL, F, Toggle [f]ullscreen, fullscreen,
bindd = $windowMod, F, Toggle [f]ullscreen, fullscreen, bindd = $windowMod, F, Toggle [f]ullscreen, fullscreen,
bindd = $windowMod, H, Move window - left, movewindow, l # move windows with windowMod + vim keys bindd = $windowMod, H, Move window - left, movewindow, l # move windows with windowMod + vim keys
bindd = $windowMod, J, Move window - down, movewindow, d # move windows with windowMod + vim keys bindd = $windowMod, J, Move window - down, movewindow, d # move windows with windowMod + vim keys
bindd = $HYPER, J, Toggle split orientation, togglesplit # dwindle
bindd = $windowMod, K, Move window - up, movewindow, u # move windows with windowMod + vim keys bindd = $windowMod, K, Move window - up, movewindow, u # move windows with windowMod + vim keys
bindd = $windowMod, L, Move window - right , movewindow, r # move windows with windowMod + vim keys bindd = $windowMod, L, Move window - right , movewindow, r # move windows with windowMod + vim keys
bindd = $HYPER, J, Toggle split orientation, togglesplit # dwindle bindd = $windowMod, M, Move window to [m]usic workspace, movetoworkspace, special:music
bindd = $windowMod, S, Move window to [s]pecial workspace, movetoworkspacesilent, special:magic bindd = $windowMod, S, Move window to [s]pecial workspace, movetoworkspacesilent, special:magic
# FIX: Changes size of window, this works a different depending on if # FIX: Changes size of window, this works a different depending on if
# the window is on the right or left of the screen. # the window is on the right or left of the screen.
# #

View File

@@ -10,6 +10,11 @@ windowrule = float, tag:floating-window
windowrule = center, tag:floating-window windowrule = center, tag:floating-window
windowrule = size 800 600, tag:floating-window windowrule = size 800 600, tag:floating-window
# Weather tui
windowrule = float, class:^(com.ghostty.weather)$
windowrule = center, class:^(com.ghostty.weather)$
windowrule = size 90% 80%, class:^(com.ghostty.weather)$
# Force windows to be a floating window # Force windows to be a floating window
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$ windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$

78
env/.local/scripts/weather vendored Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env bash
usage() {
cat <<EOF
Get weather information using wttr.in for the given location [default: Cincinnati].
USAGE:
$ weather [OPTIONS] <location>
OPTIONS:
-i | --interactve: Prompts user to quit or refresh, which keeps the terminal alive until user quits.
-l | --launch: Launches the interactive option in a new ghostty terminal.
--window-class <name>: Optional window class used only with launch command [default: com.ghostty.weather]
--window-padding-x <n>: Optional window padding used only with launch command [default: 10]
-h | --help: Show usage.
EOF
}
location="Cincinnati"
interactive_flag="0"
launch_flag="0"
should_continue="0"
window_class="com.ghostty.weather"
window_padding_x="10"
while [[ $# -gt 0 ]]; do
if [[ $1 =~ ^-i ]] || [[ $1 =~ ^--interactive ]]; then
interactive_flag="1"
elif [[ $1 =~ ^-h ]] || [[ $1 =~ ^--help ]]; then
usage && exit 0
elif [[ $1 =~ ^-l ]] || [[ $1 =~ ^--launch ]]; then
launch_flag="1"
elif [[ $1 =~ ^--window-class ]]; then
shift
window_class=$1
elif [[ $1 =~ ^--window-padding-x ]]; then
shift
window_padding_x=$1
else
location=$1
fi
shift
done
get_weather() {
curl "wttr.in/$location"
}
##################################################
# MAIN
##################################################
if [[ -z $location ]]; then
# Fail if we don't have a location.
echo -e "\n[ERROR]: Invalid location"
usage && exit 1
elif [[ $launch_flag == "1" ]]; then
# Launch a new window and call this script with --interactive flag set, so the window stays open until the user quits.
ghostty --class=$window_class --window-padding-x=$window_padding_x \
--keybind="j=scroll_page_fractional:0.5" --keybind="k=scroll_page_fractional:-0.5" \
--keybind="q=quit" \
-e ${BASH_SOURCE[0]} --interactive
elif [[ $interactive_flag == "1" ]]; then
# Interactive mode starts a loop until the user quits. It prompts them to quit or refresh the weather results.
while [[ $should_continue == "0" ]]; do
echo "Fetching weather for: $location"
get_weather
# Set's should_continue to '0' if when user hits the quit option or '1' if the hit refresh.
should_continue=$(gum confirm "Weather: $location" --affirmative Refresh --negative Quit && echo "0" || echo "1")
done
else
# Just show the weather in normal mode.
get_weather
fi

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Version=1.0
Name=Weather
Comment=Get weather
Exec=/home/michael/.local/scripts/weather --launch
Icon=/home/michael/.local/share/applications/icons/weather.png
Terminal=false
Type=Application
StartupNotify=true

2
webapp
View File

@@ -54,7 +54,7 @@ install() {
# Install local icons if needed # Install local icons if needed
mkdir -p $XDG_DATA_HOME/applications/icons mkdir -p $XDG_DATA_HOME/applications/icons
for i in $(find $DEV_ENV/env/icons -mindepth 1 -maxdepth 1 -type f); do for i in $(find $DEV_ENV/env/.local/share/applications/icons -mindepth 1 -maxdepth 1 -type f); do
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then
cp $i $XDG_DATA_HOME/applications/icons cp $i $XDG_DATA_HOME/applications/icons
fi fi