Compare commits

...

17 Commits

Author SHA1 Message Date
e4258d8ec1 Install: Add qalc and qalculate 2025-12-04 09:13:37 -08:00
13bade3a4d Rofi: Add qalc command and hotkey 2025-12-04 09:13:25 -08:00
e251e675f4 Rofi: Move copyq script 2025-12-04 09:13:08 -08:00
f3522bf985 Sway: Add copyq hotkey and rofi integration 2025-12-03 21:27:43 -08:00
9d61d9f418 Sway: Add shortcut to open lazygit in floating window 2025-12-03 15:09:46 -08:00
738a15a00d Lazygit: Do not prompt to create new repo 2025-12-03 15:09:26 -08:00
46a2b9fd61 Install: Add LibreOffice and Okular 2025-12-03 14:45:09 -08:00
90922ccd77 Sway: Add rofi hotkey for window switching 2025-12-03 14:44:20 -08:00
eeb24c1233 Sway: Fix typo 2025-12-03 14:43:49 -08:00
34ad6a3aa1 Foot: Add theme and font 2025-12-03 14:43:30 -08:00
9c9d0188bb Dunst: Add theme 2025-12-03 14:43:25 -08:00
44a7ecce2e Direnv: Modify autoenv_fish to not override cd
Instead, automatically execute a function when the PWD variable changes.
2025-12-02 08:47:01 -08:00
26939a3be8 Direnv: Switch to autoenv_fish 2025-12-01 21:53:24 -08:00
855c2f7434 Git: Update editor to nvim 2025-12-01 20:59:44 -08:00
0a7d920b58 Direnv: Add 2025-12-01 20:59:35 -08:00
a93d11a2c8 Install: Add gh and copyq 2025-12-01 14:10:38 -08:00
52adaeccbd Sway: Add default applications at startup 2025-12-01 14:09:46 -08:00
10 changed files with 343 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
#
# Catppuccin Latte
# https://github.com/catppuccin/dunst/blob/main/themes/latte.conf
#
[global]
frame_color = "#1e66f5"
separator_color= frame
highlight = "#1e66f5"
[urgency_low]
background = "#eff1f5"
foreground = "#4c4f69"
[urgency_normal]
background = "#eff1f5"
foreground = "#4c4f69"
[urgency_critical]
background = "#eff1f5"
foreground = "#4c4f69"
frame_color = "#fe640b"

View File

@@ -15,6 +15,9 @@ if status is-interactive
# Override globals
set -gx EDITOR nvim
# Enable autoenv
source ~/.config/fish/functions/activate.fish
# Aliases
alias vim="nvim"
alias dc="podman compose"

View File

@@ -0,0 +1,133 @@
#!/usr/bin/env fish
#
# Autoenv for fish shell.
# Based on, but heavily modified from:
# https://github.com/loopbit/autoenv_fish
#
set AUTOENV_AUTH_FILE ~/.autoenv_authorized
if [ -z "$AUTOENV_ENV_FILENAME" ]
set AUTOENV_ENV_FILENAME ".env"
end
# probe to see if we have access to a shasum command, otherwise disable autoenv
if which gsha1sum 2>/dev/null >&2
# Okay
else if which sha1sum 2>/dev/null >&2
# Okay
else if which shasum 2>/dev/null >&2
# Okay
else
echo "Autoenv cannot locate a compatible shasum binary; not enabling"
exit 1
end
# This function will be automatically called on directory change
# without needing to override the `cd` command.
function autoenv_init --on-variable PWD
set defIFS $IFS
set IFS (echo -en "\n\b")
set target $argv[1]
set home (dirname $HOME)
set search_dir $PWD
while [ $search_dir != / -a $search_dir != "$home" ]
set file "$search_dir/$AUTOENV_ENV_FILENAME"
if [ -e $file ]
set files $files $file
end
set search_dir (dirname $search_dir)
end
set numerator (count $files)
if [ $numerator -gt 0 ]
for x in (seq $numerator)
set envfile $files[$x]
autoenv_check_authz_and_run "$envfile"
end
end
set IFS $defIFS
end
function autoenv_run
set file "(realpath "$argv[1]")"
autoenv_check_authz_and_run "$file"
end
function autoenv_env
builtin echo "autoenv:" "$argv[1]"
end
function autoenv_printf
builtin printf "autoenv: "
builtin printf "$argv[1]"
end
function autoenv_indent
cat -e $argv[1] | sed 's/.*/autoenv: &/'
end
function autoenv_hashline
# typeset envfile hash
set envfile $argv[1]
set hash (shasum "$envfile" | cut -d' ' -f 1)
echo "$envfile:$hash"
end
function autoenv_check_authz
# typeset envfile hash
set envfile $argv[1]
set hash (autoenv_hashline "$envfile")
touch $AUTOENV_AUTH_FILE
grep -Gq "$hash" $AUTOENV_AUTH_FILE
end
function autoenv_check_authz_and_run
set envfile $argv[1]
if autoenv_check_authz "$envfile"
autoenv_source "$envfile"
return 0
end
if [ -z $MC_SID ] #make sure mc is not running
autoenv_env
autoenv_env "WARNING:"
autoenv_env "This is the first time you are about to source $envfile":
autoenv_env
autoenv_env " --- (begin contents) ---------------------------------------"
autoenv_indent "$envfile"
autoenv_env " --- (end contents) -----------------------------------------"
autoenv_env
autoenv_printf "Are you sure you want to allow this? (y/N) \n"
read answer
if [ $answer = y -o $answer = Y ]
autoenv_authorize_env "$envfile"
autoenv_source "$envfile"
end
end
end
function autoenv_deauthorize_env
#typeset envfile
set envfile $argv[1]
cp "$AUTOENV_AUTH_FILE" "$AUTOENV_AUTH_FILE.tmp"
grep -Gv "$envfile:" "$AUTOENV_AUTH_FILE.tmp" >$AUTOENV_AUTH_FILE
end
function autoenv_authorize_env
#typeset envfile
set envfile $argv[1]
autoenv_deauthorize_env "$envfile"
autoenv_hashline "$envfile" >>$AUTOENV_AUTH_FILE
end
function autoenv_source
#TODO: Why are global vars not being passed to sourced script?
set -g AUTOENV_CUR_FILE $argv[1]
set -g AUTOENV_CUR_DIR (dirname $argv[1])
source "$argv[1]"
#set -e AUTOENV_CUR_FILE
#set -e AUTOENV_CUR_DIR
end

View File

@@ -0,0 +1,46 @@
font=JetBrainsMonoNerdFontMono:size=12
# Should automatically use these.
#font-bold=JetBrainsMonoNerdFontMono:weight=bold
#font-italic=JetBrainsMonoNerdFontMono:slant=italic
#font-bold-italic=JetBrainsMonoNerdFontMono:weight=bold:slant=italic
#
# Catppuccine Latte
# https://github.com/catppuccin/foot
#
[colors]
cursor=eff1f5 dc8a78
foreground=4c4f69
background=eff1f5
regular0=5c5f77
regular1=d20f39
regular2=40a02b
regular3=df8e1d
regular4=1e66f5
regular5=ea76cb
regular6=179299
regular7=acb0be
bright0=6c6f85
bright1=d20f39
bright2=40a02b
bright3=df8e1d
bright4=1e66f5
bright5=ea76cb
bright6=179299
bright7=bcc0cc
16=fe640b
17=dc8a78
selection-foreground=4c4f69
selection-background=ccced7
search-box-no-match=dce0e8 d20f39
search-box-match=4c4f69 ccd0da
jump-labels=dce0e8 fe640b
urls=1e66f5

View File

@@ -4,6 +4,7 @@ customCommands:
description: "Force push with lease."
key: "x"
promptToReturnFromSubprocess: false # removes "press enter to return to lazygit" popup
notARepository: 'skip'
git:
autoForwardBranches: "none"
os:

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Read the most recent items from CopyQ and present them in a rofi menu.
#
# Converted to bash from
# https://github.com/cjbassi/rofi-copyq/blob/master/rofi-copyq
# CopyQ script to get all clipboard items as JSON
copyq_script_getAll='
var result=[];
for ( var i = 0; i < size(); ++i ) {
var obj = {};
obj.row = i;
obj.mimetypes = str(read("?", i)).split("\n");
obj.mimetypes.pop();
obj.text = str(read(i));
result.push(obj);
}
JSON.stringify(result);
'
# Get clipboard items from CopyQ
json_arr=$(printf '%s' "$copyq_script_getAll" | copyq -)
# Parse JSON and format items for rofi
# Process each JSON object separately, replacing newlines within each item
items=$(printf '%s' "$json_arr" | jq -r '.[] | .text | gsub("\n"; " ") | gsub(" +"; " ")')
# Show rofi menu and get selected index
title='rofi-copyq'
selected_index=$(printf '%s' "$items" | rofi -dmenu -i -p "$title" -format i)
# If user selected an item, select it in CopyQ
if [ -n "$selected_index" ]; then
echo "Selected item: $selected_index"
copyq "select($selected_index);"
fi

View File

@@ -0,0 +1,71 @@
#!/usr/bin/env bash
# https://github.com/onespaceman/menu-calc
# https://github.com/BarbUk/menu-qalc
# https://github.com/ClemaX/menu-qalc-wayland
#
# Calculator for use with rofi
# Copying to the clipboard requires wl-copy
usage() {
echo "$(tput bold)menu-calc$(tput sgr0)"
echo "A calculator for Rofi"
echo
echo "$(tput bold)Usage:$(tput sgr0)"
echo " = 4+2"
echo " = (4+2)/(4+3)"
echo " = 4^2"
echo " = sqrt(4)"
echo " = c(2)"
echo
echo "$(tput bold)Passing arguments to Rofi:$(tput sgr0)"
echo "Any parameters after ' -- ' will be passed to Rofi."
echo
echo " = -- <Rofi args>"
echo
echo "The answer can be copied to the clipboard and used for further calculations inside (or outside) Rofi."
echo
echo "If launched outside of Rofi the expression may need quotation marks."
exit
}
process_query() { # query
local query="$1"
qalc +u8 -color=never -terse <<<"$query" |
awk '!/^>/ && !/^$/ {gsub(/^[ \t]+|[ \t]+$/, "", $0); print}'
}
# Process CLI parameters
for var in "$@"; do
case $var in
-h | --help) usage ;;
--) break ;;
esac
done
# Path to menu application
if [[ -n $(command -v rofi) ]]; then
menu="$(command -v rofi)"
menu="$menu -dmenu -lines 3"
else
>&2 echo "Rofi not found"
exit
fi
# Determine args to pass to rofi
while [[ $# -gt 0 && $1 != "--" ]]; do
shift
done
[[ $1 == "--" ]] && shift
while true; do
action=$(echo -e "Copy\nClear\nClose" | ${menu} "$@" -p "= $answer")
case "$action" in
"Clear") answer= ;;
"Copy") wl-copy -- "$answer" ;;
"Close" | "") exit ;;
*) answer=$(process_query "$answer $action") ;;
esac
done

View File

@@ -73,6 +73,20 @@ input "2362:628:PIXA3854:00_093A:0274_Touchpad" {
# Start your launcher
bindsym $mod+d exec $menu
# Window switching
bindsym $mod+Tab exec rofi -show window -modes window
# Clipboard history
bindsym $mod+Shift+v exec /home/tgrosinger/.config/rofi/scripts/copyq.sh
# Calculator
bindsym $mod+Equal exec /home/tgrosinger/.config/rofi/scripts/qalc.sh
# Lazygit
bindsym $mod+g exec alacritty --title Floating-Lazygit --command /home/linuxbrew/.linuxbrew/bin/lazygit; grab_focus; floating enable
for_window [title="Floating-Lazygit"] floating enable
for_window [title="Floating-Lazygit"] resize set 1800 1200
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
@@ -212,6 +226,13 @@ client.urgent $peach $base $peach $overlay0 $peach
client.placeholder $overlay0 $base $text $overlay0 $overlay0
client.background $base
#
# Launch default apps
#
exec copyq
exec workrave
# Include configs from 3 locations:
# - /usr/share/sway/config.d
# - /etc/sway/config.d

View File

@@ -36,7 +36,7 @@
sync = "!git fetch -p && git rebase origin/$(git default-branch)"
[core]
editor = vim
editor = nvim
pager = delta
attributesfile = /home/tgrosinger/.gitattributes
excludesfile = /home/tgrosinger/.gitignore_global

View File

@@ -15,6 +15,7 @@ brew install \
fish \
fzf \
gcc \
gh \
git \
git-delta \
jq \
@@ -49,10 +50,13 @@ brew services start atuin
# Install system packages
sudo dnf install \
alacritty \
copyq \
direnv \
distrobox \
fuse-libs \ # For running appimages
gstreamer1-plugin-openh264 mozilla-openh264 \ # For twitch videos
podman
podman \
qalculate qalculate-gtk # Homebrew version installs x11 and waylany in brew.
# Install tailscale
# https://tailscale.com/kb/1511/install-fedora-2
@@ -62,6 +66,8 @@ flatpak install io.dbeaver.DBeaverCommunity
flatpak install flathub org.gimp.GIMP
flatpak install flathub org.gnucash.GnuCash
flatpak install flathub org.kde.digikam
flatpak install flathub org.libreoffice.LibreOffice
flatpak install flathub org.kde.okular
# Install devbox
# https://www.jetify.com/docs/devbox/installing-devbox