Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
SingularisArt committed May 1, 2024
1 parent c04c780 commit bf0628d
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 62 deletions.
8 changes: 6 additions & 2 deletions aspects/dotfiles/files/.config/git/config.temp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
count = !git --no-pager log --oneline | wc -l
cp = cherry-pick
delta = "!f() { git diff \"$@\" | delta; }; f"
ls = list-files
p = push
patch = add -p
get-root = rev-parse --show-toplevel
update-submodules = submodule update --remote

# http://stackoverflow.com/questions/224687/git-find-duplicate-blobs-files-in-this-tree/8408640#8408640
Expand Down Expand Up @@ -60,7 +62,6 @@

# %C(auto) requires Git 1.8.3 or later
one = !git --paginate log --pretty=format:'%C(auto)%h%Creset %s%C(auto)%d%Creset %C(magenta bold)(%cr)%Creset %C(cyan)%Creset'
oneline = !git --paginate log --pretty=format:'%C(auto)%h%Creset %s%C(auto)%d%Creset %C(magenta bold)(%cr)%Creset %C(cyan)%Creset'

# Recover previous COMMIT_EDITMSG, if there is one.
recover = !cat "$(git rev-parse --git-dir 2> /dev/null)/COMMIT_EDITMSG"
Expand Down Expand Up @@ -162,6 +163,9 @@
[log]
decorate = short

[maintenance]
repo = /home/hashem/.local/share/Singularis

[protocol]
# Added in Git 2.18.0.
version = 2
Expand All @@ -177,7 +181,7 @@
autosquash = true

[rerere]
enabled = true
enabled = true

[status]
submodulesummary = true
Expand Down
2 changes: 1 addition & 1 deletion aspects/dotfiles/files/.config/tmux/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bind-key -T copy-mode-vi Escape send-keys -X cancel
bind-key -r i run-shell 'tmux new-window -c "#{pane_current_path}" "tmux rename-window \"Cheat Sheet\"; ~/.local/bin/tmux/tmux-cht"'

# Create commonly used tmux sessions.
bind-key -r C-t run-shell '~/.local/bin/tmux/tmux-sessionizer'
bind-key -r a run-shell 'tmux new-window -c "#{pane_current_path}" "tmux rename-window \"Project Search\"; ~/.local/bin/tmux/tmux-sessionizer"'

# Break current pane into its own window.
bind-key m break-pane -d
Expand Down
46 changes: 3 additions & 43 deletions aspects/dotfiles/files/.config/zsh/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@ function git() {
if [ $# -eq 0 ]; then
command git status
elif [ "$1" = root ] || [ "$1" = r ]; then
cd $(git get-root) || exit
shift
local ROOT
if [ "$(command git rev-parse --is-inside-git-dir 2> /dev/null)" = true ]; then
if [ "$(command git rev-parse --is-bare-repository)" = true ]; then
ROOT="$(command git rev-parse --absolute-git-dir)"
else
# Note: This is a good-enough, rough heuristic, which ignores
# the possibility that GIT_DIR might be outside of the worktree;
# see:
# https://stackoverflow.com/a/38852055/2103996
ROOT="$(command git rev-parse --git-dir)/.."
fi
else
# Git 2.13.0 and above:
ROOT="$(command git rev-parse --show-superproject-working-tree 2> /dev/null)"
if [ -z "$ROOT" ]; then
ROOT="$(command git rev-parse --show-toplevel 2> /dev/null)"
fi
fi
if [ -z "$ROOT" ]; then
ROOT=.
fi
if [ $# -eq 0 ]; then
cd "$ROOT"
else
(cd "$ROOT" && eval "$@")
if [ $# -gt 0 ]; then
command git "$@"
fi
else
command git "$@"
Expand Down Expand Up @@ -155,24 +133,6 @@ function tmux() {
}


################################################################################
# #
# GPG #
# #
################################################################################
#
# - `gpg` with no arguments = `gpg --list-keys`
# - Run `gpg --help` to show what vanilla `gpg` without arguments would normally
# show.
#
function gpg() {
if [ "$1" = "" ]; then
command gpg --list-keys
else
command gpg "$@"
fi
}

#######################################################################
# #
# Pomodoro Timer #
Expand Down
42 changes: 26 additions & 16 deletions aspects/dotfiles/files/.local/bin/tmux/tmux-sessionizer
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
#!/usr/bin/env bash

declare -A sessions
while IFS= read -r line; do
tmux_file="$line/.tmux"
session_name=$(grep -oP '(?<=SESSION_NAME=")[^"]*' "$tmux_file")
sessions["$session_name"]=$line
done < <(find ~/Documents ~/Desktop -maxdepth 2 -type f -name ".tmux" -exec dirname {} \;)

sessions["System Configuration"]="$HOME/.local/share/Singularis/"

rofi() {
/usr/bin/rofi -markup-rows -kb-row-down Down -kb-custom-1 Ctrl+n -no-fixed-num-lines "$@"
}

selected=$(printf "%s\n" "${!sessions[@]}" | rofi -i -dmenu -window-title "Select Session")
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find ~/Documents ~/Desktop/*/Projects -mindepth 1 -maxdepth 1 -type d | fzf)
fi

if [[ -z $selected ]]; then
exit 0
fi

cd "${sessions[$selected]}" || exit
source .tmux
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)

cd "$selected"

if [[ -f "$selected/.tmux" ]]; then
source .tmux
current_session=$(tmux display-message -p '#S')
tmux kill-window -t "$current_session:Project Search" 2> /dev/null
else
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s "$selected_name" -c "$selected"
exit 0
fi

if ! tmux has-session -t="$selected_name" 2> /dev/null; then
tmux new-session -ds "$selected_name" -c "$selected"
fi

tmux switch-client -t "$selected_name"
fi
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/newsboat/cache.db
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/zathura/bookmarks.sqlite
Binary file not shown.
19 changes: 19 additions & 0 deletions aspects/systemd/files/.config/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file was created and is maintained by Git.
# Any edits made in this file might be replaced in the future
# by a Git command.

[Unit]
Description=Optimize Git repositories data

[Service]
Type=oneshot
ExecStart="/usr/lib/git-core/git" --exec-path="/usr/lib/git-core" for-each-repo --config=maintenance.repo maintenance run --schedule=%i
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_VSOCK
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
13 changes: 13 additions & 0 deletions aspects/systemd/files/.config/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was created and is maintained by Git.
# Any edits made in this file might be replaced in the future
# by a Git command.

[Unit]
Description=Optimize Git repositories data

[Timer]
OnCalendar=Tue..Sun *-*-* 0:08:00
Persistent=true

[Install]
WantedBy=timers.target
13 changes: 13 additions & 0 deletions aspects/systemd/files/.config/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was created and is maintained by Git.
# Any edits made in this file might be replaced in the future
# by a Git command.

[Unit]
Description=Optimize Git repositories data

[Timer]
OnCalendar=*-*-* 1..23:08:00
Persistent=true

[Install]
WantedBy=timers.target
13 changes: 13 additions & 0 deletions aspects/systemd/files/.config/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was created and is maintained by Git.
# Any edits made in this file might be replaced in the future
# by a Git command.

[Unit]
Description=Optimize Git repositories data

[Timer]
OnCalendar=Mon 0:08:00
Persistent=true

[Install]
WantedBy=timers.target

0 comments on commit bf0628d

Please sign in to comment.