Update

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2024-11-13 23:37:29 +0100
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2024-11-13 23:37:29 +0100
Commit 628a44fcc62c1e3c52d559efabb2aee32f148b53 (patch)
-rwxr-xr-x .newsboat/urls 1
-rwxr-xr-x .shenanigans.sh 91
-rw-r--r-- .vimrc 1
3 files changed, 10 insertions, 83 deletions
diff --git a/.newsboat/urls b/.newsboat/urls
1
https://theorangeduck.com/feeds/pages
1
https://theorangeduck.com/feeds/pages
  
2
https://geohot.github.io/blog/feed.xml
2
https://lwn.net/headlines/rss
3
https://lwn.net/headlines/rss
3
https://kristoff.it/index.xml
4
https://kristoff.it/index.xml
4
https://www.computerenhance.com/feed
5
https://www.computerenhance.com/feed
...
diff --git a/.shenanigans.sh b/.shenanigans.sh
1
# Magical environment variables.
1
# Magical environment variables.
2
NIX_SHELL_PRESERVE_PROMPT=1
2
export NIX_SHELL_PRESERVE_PROMPT=1
3
TERM=xterm-256color
3
export COLORTERM=truecolor
4
VISUAL=vim
4
export TERM=xterm-256color
5
EDITOR=vim
5
export VISUAL=vim
  
6
export EDITOR=vim
6
  
7
  
7
parse_git_branch() {
8
parse_git_branch() {
8
	git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
9
	git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
...
19
export PS1="[\033[38;5;166m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ "
20
export PS1="[\033[38;5;166m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ "
20
  
21
  
21
# General aliases.
22
# General aliases.
22
alias ls='ls --color=none'
23
alias l='ls -lh'
23
alias l='ls -lh --color=none'
24
alias ll='ls -lha'
24
alias ll='ls -lha --color=none'
  
25
alias t='tree -L 2'
25
alias t='tree -L 2'
26
alias ..='cd ..'
26
alias ..='cd ..'
27
alias grep='grep --color=always'
27
alias grep='grep --color=always'
...
40
export PATH=$HOME/go/bin:$PATH
40
export PATH=$HOME/go/bin:$PATH
41
export PATH=/usr/local/go/bin:$PATH
41
export PATH=/usr/local/go/bin:$PATH
42
  
42
  
43
# Language server.
43
# Language servers.
44
export PATH=$HOME/.local/bin/luals/bin:$PATH
44
export PATH=$HOME/.local/bin/luals/bin:$PATH
45
  
45
  
46
# History and search. Stolen from J.
46
# History and search. Stolen from J.
...
99
  
99
  
100
	# Return back to original directory
100
	# Return back to original directory
101
	cd $CWD
101
	cd $CWD
102
}
  
103
  
  
104
# Simple ticket system based on https://github.com/mitjafelicijan/ticket.
  
105
export TICKETS=~/Vault/tickets
  
106
tt() {
  
107
	if [ "$(uname -s)" != "Linux" ]; then
  
108
		printf "Currently only Linux is supported.\n"
  
109
		return 1
  
110
	fi
  
111
  
  
112
	if [ -z "$TICKETS" ]; then
  
113
		TICKETS="$HOME/tickets"
  
114
	fi
  
115
  
  
116
	mkdir -p $TICKETS
  
117
  
  
118
	# Display open tickets if no argument provided.
  
119
	if [ -z "$1" ]; then
  
120
		echo "`tt -o`"
  
121
		return 0
  
122
	fi
  
123
  
  
124
	case $1 in
  
125
		-n|-new)
  
126
			# ticket_id=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 10 | head -n 1)
  
127
			ticket_id=$(echo -n "$(date)" | md5sum | cut -c 9-20)
  
128
			ticket_file=$TICKETS/$ticket_id
  
129
			printf "id: %s\n" $ticket_id > $ticket_file
  
130
			printf "responsible: %s\n" `whoami`@`hostname` >> $ticket_file
  
131
			printf "created: %s\n" "`date`" >> $ticket_file
  
132
			printf "status: open\n" >> $ticket_file
  
133
			printf "title: ?\n" >> $ticket_file
  
134
			printf "====\n" >> $ticket_file
  
135
			printf "Description...\n" >> $ticket_file
  
136
			$EDITOR $ticket_file
  
137
			;;
  
138
		-o|-open)
  
139
			printf "%-14s %-21s %s\n" "Ticket ID" "Created at" "Title"
  
140
			printf "%0.s-" {1..100}
  
141
			printf "\n"
  
142
			grep --color=never -l 'status: open' $TICKETS/* | while read file; do
  
143
				id=$(head -n 1 "$file" | tail -n 1 | awk '{ print $2 }')
  
144
				title=$(head -n 5 "$file" | tail -n 1 | awk '{$1=""; print $0}')
  
145
				cdate=$(head -n 3 "$file" | tail -n 1 | awk '{$1=""; print $0}')
  
146
				cdate_fmt=$(date -d "$cdate" "+%Y-%m-%d %H:%M:%S")
  
147
				printf "%-14s %-20s %.66s\n" "$id" "$cdate_fmt" "$title"
  
148
			done
  
149
			;;
  
150
		-c|-closed)
  
151
			printf "%-14s %-21s %s\n" "Ticket ID" "Created at" "Title"
  
152
			printf "%0.s-" {1..100}
  
153
			printf "\n"
  
154
			grep --color=never -l 'status: closed' $TICKETS/* | while read file; do
  
155
				id=$(head -n 1 "$file" | tail -n 1 | awk '{ print $2 }')
  
156
				title=$(head -n 5 "$file" | tail -n 1 | awk '{$1=""; print $0}')
  
157
				cdate=$(head -n 3 "$file" | tail -n 1 | awk '{$1=""; print $0}')
  
158
				cdate_fmt=$(date -d "$cdate" "+%Y-%m-%d %H:%M:%S")
  
159
				printf "%-14s %-20s %.66s\n" "$id" "$cdate_fmt" "$title"
  
160
			done
  
161
			;;
  
162
		-h|-help)
  
163
			printf "Usage: ticket [option]\n"
  
164
			printf "  -n, -new          creates a new ticket\n"
  
165
			printf "  -o, -open         lists open tickets\n"
  
166
			printf "  -c, -closed       lists closed tickets\n"
  
167
			printf "  -h, -help         shows this help\n"
  
168
			;;
  
169
		*)
  
170
			if [ -e "$TICKETS/$1" ] && [ -f "$TICKETS/$1" ]; then
  
171
				$EDITOR "$TICKETS/$1"
  
172
			else
  
173
				printf "Ticket not found: $TICKETS/$1\n"
  
174
			fi
  
175
			;;
  
176
	esac
  
177
}
102
}
178
  
103
  
179
# Toggles between pulseaudio sinks in round-robin.
104
# Toggles between pulseaudio sinks in round-robin.
...
diff --git a/.vimrc b/.vimrc
...
25
nmap <silent> gd :ALEGoToDefinition<cr>
25
nmap <silent> gd :ALEGoToDefinition<cr>
26
nmap <silent> re :ALERename<cr>
26
nmap <silent> re :ALERename<cr>
27
  
27
  
  
28
let g:ale_completion_enabled = 1
28
let g:ale_hover_to_floating_preview = 1
29
let g:ale_hover_to_floating_preview = 1
29
let g:ale_detail_to_floating_preview = 1
30
let g:ale_detail_to_floating_preview = 1
30
let g:ale_floating_window_border = 0
31
let g:ale_floating_window_border = 0
...