feat: add project script, change rofi oneline config
This commit is contained in:
@@ -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
27
scripts/project.sh
Executable 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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user