From 586f56b99d9f5abe77a92dc6f39a16dfb3931705 Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Wed, 28 May 2025 05:37:15 -0500 Subject: [PATCH] update --- .config/scripts/sessions.sh | 54 +++++++++++++++++++---- .config/shell/export.zsh | 4 +- .config/sway/config | 10 +++-- .config/tmux/tmux.conf | 6 +-- .config/waybar/config | 2 +- ansible/roles/packages/vars/Archlinux.yml | 3 +- 6 files changed, 60 insertions(+), 19 deletions(-) diff --git a/.config/scripts/sessions.sh b/.config/scripts/sessions.sh index 026cb2f..d17073e 100755 --- a/.config/scripts/sessions.sh +++ b/.config/scripts/sessions.sh @@ -5,8 +5,24 @@ new() { dir=${1:-} - [ -z "${dir}" ] && dir=$(find $HOME/Documents/gitlab -mindepth 2 -maxdepth 2 -type d | awk -F/ '{print $(NF-1)"/"$NF " " $0}' | fzf --reverse --header "New Session" --with-nth=1 | awk '{print $2}') - [ -z "$dir" ] && return 1 + if [ -z "${dir}" ]; then + + name=$(find "$HOME/Documents/gitlab" -mindepth 2 -maxdepth 2 -type d \ + | awk -F/ '{print $(NF-1)"/"$NF}' \ + | sort \ + | wofi -dmenu -i -p "New Session" --columns 1) + + if [ -z "$name" ]; then + return + fi + + dir=$(find "$HOME/Documents/gitlab" -mindepth 2 -maxdepth 2 -type d | grep "$name$" | head -n 1) + + fi + + if [ -z "$dir" ]; then + return + fi name=$(basename "$dir") if [[ $name == .* ]]; then @@ -31,8 +47,29 @@ goland-new() { dir=${1:-} - [ -z "${dir}" ] && dir=$(find $HOME/Documents/gitlab -mindepth 2 -maxdepth 2 -type d | awk -F/ '{print $(NF-1)"/"$NF " " $0}' | fzf --reverse --header "New Session" --with-nth=1 | awk '{print $2}') - [ -z "$dir" ] && return 1 + if [ -z "${dir}" ]; then + + name=$(find "$HOME/Documents/gitlab" -mindepth 2 -maxdepth 2 -type d \ + | awk -F/ '{print $(NF-1)"/"$NF}' \ + | sort \ + | wofi -dmenu -i -p "New JetBrains Session" --columns 1) + + if [ -z "$name" ]; then + return + fi + + dir=$(find "$HOME/Documents/gitlab" -mindepth 2 -maxdepth 2 -type d | grep "$name$" | head -n 1) + + fi + + if [ -z "$dir" ]; then + return + fi + + name=$(basename "$dir") + if [[ $name == .* ]]; then + name=${name#.} + fi if [[ $dir == *'dotnet'* ]]; then /home/user/.local/share/JetBrains/Toolbox/apps/rider/bin/rider $dir & @@ -50,20 +87,21 @@ switch() { sed '/^popup/d' | sed '/^scratch/d' | sed '/^$/d' | - fzf --reverse --header 'Switch Session' --preview 'tmux capture-pane -pt {}' \ - --bind 'enter:execute(tmux switch-client -t {})+accept' + wofi -dmenu -i -p "Switch Sessions" --columns 1 | + xargs -r tmux switch-client -t } delete() { + tmux list-sessions -F '#{session_name}' | sed '/^popup/d' | sed '/^scratch/d' | sed '/^general/d' | sed '/^$/d' | - fzf --reverse --header 'Delete Session' --preview 'tmux capture-pane -pt {}' \ - --bind 'enter:execute(tmux kill-session -t {})+accept' + wofi -dmenu -i -p "Delete Session" --columns 1 | + xargs -r tmux kill-session -t } window() { diff --git a/.config/shell/export.zsh b/.config/shell/export.zsh index 7f5dc66..e1f826c 100644 --- a/.config/shell/export.zsh +++ b/.config/shell/export.zsh @@ -1,4 +1,4 @@ -export ZSH="$HOME/.oh-my-zsh" +#export ZSH="$HOME/.oh-my-zsh" export DEVPOD_DISABLE_TELEMETRY=true export DOTNET_CLI_TELEMETRY_OPTOUT=1 export POWERSHELL_TELEMETRY_OPTOUT=1 @@ -15,7 +15,7 @@ export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=none,fg=white,bold" export GEM_HOME="$HOME/gems" export XCURSOR_SIZE=24 export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" -eval "$(ssh-agent -s)" +eval "$(ssh-agent -s)" >> /dev/null export PATH="$HOME/.local/bin:$HOME/gems/bin:/usr/local/go/bin:$HOME/go/bin:/home/linuxbrew/.linuxbrew/bin:$PATH" export PATH="$HOME/.local/bin/DSC:$PATH" diff --git a/.config/sway/config b/.config/sway/config index aef8165..9ebcf5a 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -19,6 +19,7 @@ set $files nautilus set $browser flatpak run io.gitlab.librewolf-community set $bitwarden flatpak run com.bitwarden.desktop set $menu wofi +set $newScript "$HOME/.config/scripts/sessions.sh" set $next_or_new swaymsg -r -t get_workspaces | jq -r --arg OUTPUT $(swaymsg -t get_outputs -r | jq -r '.[] | select(.focused == true) | .name') '(. | (max_by(.num) | .num)) as $max | [.[] | select(.output == $OUTPUT)] | (max_by(.num) | .num) as $maxOutput | (.[] | select(.focused == true) | .num) as $current | if $maxOutput > $current then "next_on_output" else $max + 1 end' set $previous_or_first swaymsg -r -t get_workspaces | jq -r --arg OUTPUT $(swaymsg -t get_outputs -r | jq -r '.[] | select(.focused == true) | .name') '(. | (max_by(.num) | .num)) as $max | [.[] | select(.output == $OUTPUT)] | (min_by(.num) | .num) as $minOutput | (.[] | select(.focused == true) | .num) as $current | if $minOutput < $current then "prev_on_output" else $current end' @@ -66,10 +67,7 @@ bindgesture swipe:left workspace prev exec_always swaync # Toggle control center -bindsym $mod+Shift+n exec swaync-client -t -sw - -# Start IDE -bindsym $mod+Shift+i exec /opt/goland/bin/goland.sh +bindsym $mod+control+n exec swaync-client -t -sw ### Key bindings @@ -92,6 +90,10 @@ bindsym $mod+Shift+i exec /opt/goland/bin/goland.sh # Start your launcher bindsym $mod+space exec $menu + # Start your goland + bindsym $mod+n exec 'zsh -c ". $newScript new"' + bindsym $mod+Shift+n exec 'zsh -c ". $newScript goland-new"' + # 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. diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 45f301a..ff149d1 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -94,9 +94,9 @@ unbind % #bind % split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" -bind n display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh new" -bind s display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh switch" -bind d display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh delete" +bind n run 'zsh -c ". $HOME/.config/scripts/sessions.sh new"' +bind s run 'zsh -c ". $HOME/.config/scripts/sessions.sh switch"' +bind d run 'zsh -c ". $HOME/.config/scripts/sessions.sh delete"' bind w display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh window" bind g display-popup -E -w 80% -h 75% "lazygit" diff --git a/.config/waybar/config b/.config/waybar/config index 6a12f55..62d8730 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -5,7 +5,7 @@ "spacing": 15, "modules-left": ["sway/workspaces","sway/mode"], "modules-center": ["clock"], - "modules-right": ["tray","idle_inhibitor","network", "bluetooth", "battery","pulseaudio"], + "modules-right": ["tray","idle_inhibitor","bluetooth","network","battery","pulseaudio"], "sway/mode": { "format": "{}" diff --git a/ansible/roles/packages/vars/Archlinux.yml b/ansible/roles/packages/vars/Archlinux.yml index 7d312b6..4eba4df 100644 --- a/ansible/roles/packages/vars/Archlinux.yml +++ b/ansible/roles/packages/vars/Archlinux.yml @@ -42,7 +42,7 @@ required_packages_pacman: - curl - nmap - kubectl - - terraform + #- terraform - podman - grim - slurp @@ -119,6 +119,7 @@ required_packages_flatpak: - com.vscodium.codium - com.protonvpn.www - me.proton.Mail + - me.proton.Pass - org.chromium.Chromium - org.libreoffice.LibreOffice - com.brave.Browser