This commit is contained in:
Flo
2025-07-02 00:33:47 +02:00
parent d25a02c3e5
commit 7a42301bea
16 changed files with 295 additions and 0 deletions

Submodule .config/tmux/plugins/catppuccin-tmux added at e30336b799

Submodule .config/tmux/plugins/tmux-continuum added at 0698e8f4b1

Submodule .config/tmux/plugins/tmux-floax added at 61c7f466b9

Submodule .config/tmux/plugins/tmux-fzf added at e91c1ae553

Submodule .config/tmux/plugins/tmux-fzf-url added at 16381dce1c

Submodule .config/tmux/plugins/tmux-resurrect added at cff343cf9e

Submodule .config/tmux/plugins/tmux-sensible added at 25cb91f42d

Submodule .config/tmux/plugins/tmux-sessionx added at 42c18389e7

Submodule .config/tmux/plugins/tmux-thumbs added at ae91d5f7c0

Submodule .config/tmux/plugins/tmux-yank added at acfd36e4fc

Submodule .config/tmux/plugins/tpm added at 99469c4a9b

132
.config/tmux/scripts/cal.sh Normal file
View File

@ -0,0 +1,132 @@
#!/bin/bash
ALERT_IF_IN_NEXT_MINUTES=10
ALERT_POPUP_BEFORE_SECONDS=10
NERD_FONT_FREE="󱁕 "
NERD_FONT_MEETING="󰤙"
get_attendees() {
attendees=$(
icalBuddy \
--includeEventProps "attendees" \
--propertyOrder "datetime,title" \
--noCalendarNames \
--dateFormat "%A" \
--includeOnlyEventsFromNowOn \
--limitItems 1 \
--excludeAllDayEvents \
--separateByDate \
--excludeEndDates \
--bullet "" \
--excludeCals "training,anderer" \
eventsToday
)
}
parse_attendees() {
attendees_array=()
for line in $attendees; do
attendees_array+=("$line")
done
number_of_attendees=$((${#attendees_array[@]} - 3))
}
get_next_meeting() {
next_meeting=$(icalBuddy \
--includeEventProps "title,datetime" \
--propertyOrder "datetime,title" \
--noCalendarNames \
--dateFormat "%A" \
--includeOnlyEventsFromNowOn \
--limitItems 1 \
--excludeAllDayEvents \
--separateByDate \
--bullet "" \
--excludeCals "training,omerxx@gmail.com" \
eventsToday)
}
get_next_next_meeting() {
end_timestamp=$(date +"%Y-%m-%d ${end_time}:01 %z")
tonight=$(date +"%Y-%m-%d 23:59:00 %z")
next_next_meeting=$(
icalBuddy \
--includeEventProps "title,datetime" \
--propertyOrder "datetime,title" \
--noCalendarNames \
--dateFormat "%A" \
--limitItems 1 \
--excludeAllDayEvents \
--separateByDate \
--bullet "" \
--excludeCals "training,omerxx@gmail.com" \
eventsFrom:"${end_timestamp}" to:"${tonight}"
)
}
parse_result() {
array=()
for line in $1; do
array+=("$line")
done
time="${array[2]}"
end_time="${array[4]}"
title="${array[*]:5:30}"
}
calculate_times() {
epoc_meeting=$(date -j -f "%T" "$time:00" +%s)
epoc_now=$(date +%s)
epoc_diff=$((epoc_meeting - epoc_now))
minutes_till_meeting=$((epoc_diff / 60))
}
display_popup() {
tmux display-popup \
-S "fg=#eba0ac" \
-w50% \
-h50% \
-d '#{pane_current_path}' \
-T meeting \
icalBuddy \
--propertyOrder "datetime,title" \
--noCalendarNames \
--formatOutput \
--includeEventProps "title,datetime,notes,url,attendees" \
--includeOnlyEventsFromNowOn \
--limitItems 1 \
--excludeAllDayEvents \
--excludeCals "training" \
eventsToday
}
print_tmux_status() {
if [[ $minutes_till_meeting -lt $ALERT_IF_IN_NEXT_MINUTES &&
$minutes_till_meeting -gt -60 ]]; then
echo "$NERD_FONT_MEETING \
$time $title ($minutes_till_meeting minutes)"
else
echo "$NERD_FONT_FREE"
fi
if [[ $epoc_diff -gt $ALERT_POPUP_BEFORE_SECONDS && epoc_diff -lt $ALERT_POPUP_BEFORE_SECONDS+10 ]]; then
display_popup
fi
}
main() {
get_attendees
parse_attendees
get_next_meeting
parse_result "$next_meeting"
calculate_times
if [[ "$next_meeting" != "" && $number_of_attendees -lt 2 ]]; then
get_next_next_meeting
parse_result "$next_next_meeting"
calculate_times
fi
print_tmux_status
# echo "$minutes_till_meeting | $number_of_attendees"
}
main

73
.config/tmux/tmux.conf Normal file
View File

@ -0,0 +1,73 @@
source-file ~/.config/tmux/tmux.reset.conf
set-option -g default-terminal 'screen-256color'
set-option -g terminal-overrides ',xterm-256color:RGB'
set -g prefix ^A
set -g base-index 1 # start indexing windows at 1 instead of 0
set -g detach-on-destroy off # don't exit from tmux when closing a session
set -g escape-time 0 # zero-out escape time delay
set -g history-limit 1000000 # increase history size (from 2,000)
set -g renumber-windows on # renumber all windows when any window is closed
set -g set-clipboard on # use system clipboard
set -g status-position top # macOS / darwin style
set -g default-terminal "${TERM}"
setw -g mode-keys vi
set -g pane-active-border-style 'fg=magenta,bg=default'
set -g pane-border-style 'fg=brightblack,bg=default'
set -g @fzf-url-fzf-options '-p 60%,30% --prompt=" " --border-label=" Open URL "'
set -g @fzf-url-history-limit '2000'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'fcsonline/tmux-thumbs'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'omerxx/catppuccin-tmux' # My fork that holds the meetings script bc I'm lazy af
set -g @plugin 'omerxx/tmux-sessionx'
set -g @plugin 'omerxx/tmux-floax'
set -g @floax-width '80%'
set -g @floax-height '80%'
set -g @floax-border-color 'magenta'
set -g @floax-text-color 'blue'
set -g @floax-bind 'p'
set -g @floax-change-path 'true'
set -g @sessionx-bind-zo-new-window 'ctrl-y'
set -g @sessionx-auto-accept 'off'
set -g @sessionx-custom-paths '/home/user/simone/dotfiles'
set -g @sessionx-bind 'o'
set -g @sessionx-x-path '~/dotfiles'
set -g @sessionx-window-height '85%'
set -g @sessionx-window-width '75%'
set -g @sessionx-zoxide-mode 'on'
set -g @sessionx-custom-paths-subdirectories 'false'
set -g @sessionx-filter-current 'false'
set -g @continuum-restore 'on'
set -g @resurrect-strategy-nvim 'session'
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
#set -g @catppuccin_window_right_separator ""
set -g @catppuccin_window_middle_separator " █"
#set -g @catppuccin_window_middle_separator " ▇"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}"
set -g @catppuccin_status_modules_right "directory date_time"
set -g @catppuccin_status_modules_left "session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{b:pane_current_path}"
set -g @catppuccin_meetings_text "#($HOME/.config/tmux/scripts/cal.sh)"
set -g @catppuccin_date_time_text "%H:%M"
run '/usr/share/tmux-plugin-manager/tpm'
# NOTE: in tmux '^a I' um all plugins zu installieren

View File

@ -0,0 +1,40 @@
# First remove *all* keybindings
# unbind-key -a
# Now reinsert all the regular tmux keys
bind ^X lock-server
bind ^C new-window -c "$HOME"
bind ^D detach
bind * list-clients
bind H previous-window
bind L next-window
bind r command-prompt "rename-window %%"
bind R source-file ~/.config/tmux/tmux.conf
bind ^A last-window
bind ^W list-windows
bind w list-windows
bind z resize-pane -Z
bind ^L refresh-client
bind l refresh-client
bind | split-window
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind '"' choose-window
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r -T prefix , resize-pane -L 20
bind -r -T prefix . resize-pane -R 20
bind -r -T prefix - resize-pane -D 7
bind -r -T prefix = resize-pane -U 7
bind : command-prompt
bind * setw synchronize-panes
bind P set pane-border-status
bind c kill-pane
bind x swap-pane -D
bind S choose-session
bind R source-file ~/.config/tmux/tmux.conf
bind K send-keys "clear"\; send-keys "Enter"
bind-key -T copy-mode-vi v send-keys -X begin-selection

Binary file not shown.

39
.shell-aliases Normal file
View File

@ -0,0 +1,39 @@
alias ls='ls --group-directories-first --color=auto -F'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias np='nano -w PKGBUILD'
alias more=less
alias ll='ls -lF'
alias lla='ls -laF'
alias la='ls -aF'
alias l='eza -l --icons --git -a'
alias lt='eza --tree --level=2 --long --icons --git'
alias cat=bat
alias yaourts='yaourt --color --pager -Ss'
alias ..='cd ../'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
## GIT
alias ga='git add -p'
alias gadd='git add'
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -m'
alias gca='git commit -a -m'
alias gco='git checkout'
alias gcoall='git checkout -- .'
alias gdiff='git diff'
alias glog='git log --graph --topo-order --pretty='\''%w(100,0,6)%C(yellow)%h%C(bold)%C(black)%d %C(cyan)%ar %C(green)%an%n%C(bold)%C(white)%s %N'\'' --abbrev-commit'
alias gp='git push origin HEAD'
alias gpu='git pull origin'
alias gre='git reset'
alias gst='git status'
#alias gobust='gobuster dir --wordlist ~/security/wordlists/diccnoext.txt --wildcard --url'