feat: add project script, change rofi oneline config

This commit is contained in:
2025-10-11 17:12:24 -07:00
parent aae6b21116
commit fa4c7a7e58
9 changed files with 176 additions and 148 deletions

View File

@@ -1 +1 @@
cliphist list | rofi -dmenu -p "Copy to clipboard:" -config ~/.config/rofi/oneline-config.rasi | cliphist decode | wl-copy
cliphist list | rofi -dmenu -p "Copy to clipboard:" | cliphist decode | wl-copy

27
scripts/project.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
projects=$(find ~/src -maxdepth 1 -type d -not -path ~/src | xargs -I {} basename {})
projects="$projects"$'\n'"dotfiles"
selected=$(echo "$projects" | rofi -dmenu -p "Select project:")
if [[ -n "$selected" ]]; then
if [[ "$selected" == "dotfiles" ]]; then
project_path="$HOME/dotfiles"
else
project_path="$HOME/src/$selected"
fi
if [[ -d "$project_path" ]]; then
ghostty --working-directory="$project_path" -e bash -c "
# Check if tmux session already exists
if tmux has-session -t '$selected' 2>/dev/null; then
tmux attach-session -t '$selected'
else
tmux new-session -s '$selected' -c '$project_path'
fi
"
else
notify-send "Error" "Project directory $project_path does not exist"
fi
fi

View File

@@ -1,6 +1,6 @@
workspaces=$(hyprctl workspaces -j | jq -r '.[].name')
target=$(echo "$workspaces" | rofi -dmenu -config ~/.config/rofi/oneline-config.rasi -p "Switch to workspace:")
target=$(echo "$workspaces" | rofi -dmenu -p "Switch to workspace:")
if [[ -n "$target" ]]; then
hyprctl dispatch workspace "$target"