Skip to content

Commit c65fdda

Browse files
committed
Massive refactor to support Manjaro
1 parent 210d84f commit c65fdda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+739
-524
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ root = true
66

77
[*]
88
charset = utf-8
9-
indent_size = 4
9+
indent_size = 2
1010
indent_style = space
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
path = common/bashlog
33
url = https://github.com/elamperti/bashlog.git
44
[submodule "common/progressbar"]
5-
path = common/progressbar
5+
path = utils/common/progressbar
66
url = https://github.com/elamperti/bash-progressbar.git

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ See [requirements](#requirements), [setup instructions](#installing) and [how to
55
There's also some [unrelated documentation](./docs/).
66

77
## Screenshots
8+
89
![i3 desktop](https://user-images.githubusercontent.com/910672/46715151-2b80e280-cc35-11e8-99ee-d681e4e74ab5.jpg)
910
![tmux featuring vim and bash](https://user-images.githubusercontent.com/910672/44622666-921f8c00-a893-11e8-86a4-1b3355ada324.jpg)
1011
![bash prompt in a git repo](https://user-images.githubusercontent.com/910672/44622668-92b82280-a893-11e8-9b74-78e4693c179d.jpg)
@@ -22,6 +23,7 @@ The setup will look for the following packages (and try to install them, if you
2223
* `stow` to symlink several files
2324

2425
## Installing
26+
2527
Just execute `setup.sh` and keep an eye on what happens :crystal_ball:
2628

2729
```sh
@@ -59,16 +61,16 @@ After installing all the required packages, bundle scripts will finish their ins
5961
You should really take a look at [`setup.sh`](./setup.sh) to see what it does. Apart from that, you may want to change the following to suit your needs:
6062

6163
* [Files in `shell/`](./shell/), which are most of the dotfiles
62-
* [Files in `home/`](./home/), which will be symlinked to your home folder
63-
* [Package lists](./common/package-lists.sh)
64+
* [Files in `home/`](./home/), which will be symlinked to your home directory
65+
* [Package lists](./config/package-lists.sh)
6466
* [Bundles](./bundles/), for more details see [the guide](./bundles/about-bundles.md)
6567
* `~/.bash*` files affixed with `.local` will be sourced (as long as they have their corresponding file in [`shell`](./shell/)
6668
* Edit the [prompt templates](./art/prompt/templates/), or create a style for an existing one (it's as easy as changing values in a JSON file)
6769
* Add your own [ascii art](./art/motd/) to use it as MOTD, or custom scripts in [`motd/`](./motd/); the MOTD wizard will let you pick which ones to use.
6870

6971
## Testing
7072

71-
Tests are written using [Bats](https://github.com/sstephenson/bats) and live in the [`test`](./test/) folder. To run them locally:
73+
Tests are written using [Bats](https://github.com/sstephenson/bats) and live in the [`test`](./test/) directory. To run them locally:
7274

7375
```sh
7476
bats test

aliases/apt.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# apt shortcuts
4+
alias sapar='sudo apt-get autoremove'
5+
alias sapi='sudo apt-get install'
6+
alias sapr='sudo apt-get remove'
7+
alias saps='sudo apt-cache search'
8+
alias sapu='sudo apt-get update'
9+
alias sapup='sudo apt-get upgrade'
10+
alias sapy='sudo apt-get install -y'
11+

aliases/colorize.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Colorize things
4+
alias dir='dir --color=auto'
5+
alias egrep='egrep --color=auto'
6+
alias fgrep='fgrep --color=auto'
7+
alias grep='grep --color=auto'
8+
alias ls='ls --color=auto'

shell/.bash_aliases aliases/git.sh

+1-48
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,5 @@
11
#!/bin/bash
22

3-
# Colorize things
4-
alias dir='dir --color=auto'
5-
alias egrep='egrep --color=auto'
6-
alias fgrep='fgrep --color=auto'
7-
alias grep='grep --color=auto'
8-
alias ls='ls --color=auto'
9-
10-
# Other useful aliases
11-
alias :q='exit'
12-
alias chx='chmod +x'
13-
alias df='df -h'
14-
alias du='du -h'
15-
alias la='ls -lAh --group-directories-first'
16-
alias lad='ls -lAh --color=always|grep "^d" --color=never'
17-
alias map='xargs -n1'
18-
alias s='cd ..'
19-
alias sl='ls'
20-
alias units='units -1 --compact -o '"'"'%.4g'"'"
21-
alias poewroff='poweroff'
22-
23-
# Turn Bash history on/off
24-
alias histoff='set +o history'
25-
alias histon='set -o history'
26-
27-
# Short utilities
28-
alias cc='xclip -selection clip'
29-
alias https='http --default-scheme=https'
30-
alias tk='pkill'
31-
alias ports='sudo netstat -tulpn'
32-
33-
alias e='vim'
34-
alias o='xdg-open'
35-
alias q='exit'
36-
37-
# apt shortcuts
38-
alias sapar='sudo apt-get autoremove'
39-
alias sapi='sudo apt-get install'
40-
alias sapr='sudo apt-get remove'
41-
alias saps='sudo apt-cache search'
42-
alias sapu='sudo apt-get update'
43-
alias sapup='sudo apt-get upgrade'
44-
alias sapy='sudo apt-get install -y'
45-
463
# Git shortcut madness
474
alias g='git'
485
alias ga='git add'
@@ -79,8 +36,8 @@ alias grbm='git rebase master'
7936
alias grm='git rm --cached'
8037
alias grs='git reset'
8138
alias gs='git status' # -sb
82-
alias gsa='git stash apply'
8339
alias gsh='git stash save'
40+
alias gsha='git stash apply'
8441
alias gsl='git stash list'
8542
alias gsp='git stash pop'
8643
alias gsw='git show'
@@ -118,7 +75,3 @@ if type __git_complete &>/dev/null; then
11875
__git_complete gsl _git_stash
11976
__git_complete gsp _git_stash
12077
fi
121-
122-
# Ledger
123-
alias led='ledger'
124-
alias lbr='led bal Expenses --effective --flat -S amount --no-total --period'

aliases/ledger.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# Ledger
4+
alias led='ledger'
5+
alias lbr='led bal Expenses --effective --flat -S amount --no-total --period'

aliases/misc.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Other useful aliases
4+
alias :q='exit'
5+
alias chx='chmod +x'
6+
alias df='df -h'
7+
alias du='du -h'
8+
alias la='ls -lAh --group-directories-first'
9+
alias lad='ls -lAh --color=always|grep "^d" --color=never'
10+
alias map='xargs -n1'
11+
alias s='cd ..'
12+
alias sl='ls'
13+
alias units='units -1 --compact -o '"'"'%.4g'"'"
14+
alias poewroff='poweroff'
15+
16+
# Turn Bash history on/off
17+
alias histoff='set +o history'
18+
alias histon='set -o history'
19+
20+
alias e='vim'
21+
alias o='xdg-open'
22+
alias q='exit'

aliases/pacman.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# yay+pacman shortcuts
4+
alias pacup='sudo pacman -Syu'
5+
alias paca='yay -S'
6+
alias pacar='sudo pacman -Qdtq'
7+
alias pacr='sudo pacman -R'
8+
alias pacq='yay -Ss'

aliases/utils.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Short utilities
4+
alias cc='xclip -selection clip'
5+
alias https='http --default-scheme=https'
6+
alias ntpup='sudo ntpdate time.cloudflare.com'
7+
alias tk='pkill'
8+
alias ports='sudo netstat -tulpn'

art/prompt/generate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ def main():
8080

8181
template_path = 'templates/' + args.template + '/' + args.template + '.template'
8282
try:
83-
template = open(template_path, 'r').read().decode('utf-8')
83+
template = open(template_path, 'r').read()
8484
except IOError:
8585
print ('Template <' + args.template + '> not found')
8686
exit(1)
8787

8888
variables_path = 'templates/' + args.template + '/styles/' + 'default.json'
89-
variables = json.loads(open(variables_path, 'r').read().decode('utf-8'))
89+
variables = json.loads(open(variables_path, 'r').read())
9090

9191
# Alt style besides 'default'
9292
if args.style != 'default':
9393
style_path = 'templates/' + args.template + '/styles/' + args.style + '.json'
9494
try:
95-
style = json.loads(open(style_path, 'r').read().decode('utf-8'))
95+
style = json.loads(open(style_path, 'r').read())
9696
except IOError:
9797
print ('Style <'+ args.style + '> not found')
9898
exit(1)

art/prompt/templates/fancy/fancy.template

+3-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ completely_dynamic_prompt() {
9090
##############
9191

9292
# Username
93-
{~ !show_battery_level ~}
9493
# Reset, set username background color
9594
PS1+="\[\e[0m\]{{ colors.user_bg }}"
96-
{~ /show_battery_level ~}
95+
9796
# Set username color for SSH connctions, overriden later if local
9897
PS1+="{{ colors.ssh_user_fg }}"
9998
# Show user icon only if not going through a SSH connection
@@ -353,8 +352,8 @@ set_prompts() {
353352
export PS4
354353
}
355354

356-
# Color theme, if it is just in this particular place
357-
# ToDo: make this more flexible
355+
# Color theme
356+
# ToDo: make this path more flexible
358357
[[ -s "$HOME/dotfiles/art/colors/{{ strings.palette }}.sh" ]] &&
359358
source "$HOME/dotfiles/art/colors/{{ strings.palette }}.sh"
360359

bundles/bundle-tools.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RESPONSE=""
44
pushd "$(dirname "${BASH_SOURCE[0]}")/.." &> /dev/null
5-
source "common/utils.sh"
5+
source "utils/common/functions.sh"
66
popd &> /dev/null
77

88
trap on_unload EXIT

bundles/minecraft/minecraft.sh

+29-28
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,41 @@ verify_requirements() {
1212
}
1313

1414
on_init() {
15-
if ! cmd_exists "java"; then
16-
send_cmd enqueue_packages "openjdk-7-jre"
17-
fi
15+
# if ! cmd_exists "java"; then
16+
# send_cmd enqueue_packages "openjdk-7-jre"
17+
# fi
18+
return
1819
}
1920

2021
after_installs() {
21-
local minecraft_path="$HOME/bin/minecraft"
22-
local minecraft_launcher="${minecraft_path}/minecraft.jar"
23-
local minecraft_icon="${minecraft_path}/minecraft.png"
24-
local minecraft_shortcut="$HOME/Desktop/minecraft.desktop"
22+
local minecraft_path="$HOME/bin/minecraft"
23+
local minecraft_launcher="${minecraft_path}/minecraft.jar"
24+
local minecraft_icon="${minecraft_path}/minecraft.png"
25+
local minecraft_shortcut="$HOME/Desktop/minecraft.desktop"
2526

26-
# Downloads Minecraft installer if missing
27-
if [ ! -f ${minecraft_launcher} ]; then
28-
mkdir -p "${minecraft_path}" &>/dev/null
29-
curl --silent -kfLo "${minecraft_launcher}" \
30-
"http://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"
31-
# Fail if download failed
32-
if [ ! $? ]; then
33-
exit 1
34-
fi
27+
# Downloads Minecraft installer if missing
28+
if [ ! -f ${minecraft_launcher} ]; then
29+
mkdir -p "${minecraft_path}" &>/dev/null
30+
curl --silent -kfLo "${minecraft_launcher}" \
31+
"http://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"
32+
# Fail if download failed
33+
if [ ! $? ]; then
34+
exit 1
3535
fi
36+
fi
3637

37-
# Make it executable
38-
chmod +x "${minecraft_launcher}"
38+
# Make it executable
39+
chmod +x "${minecraft_launcher}"
3940

40-
# Downloads Minecraft icon if missing
41-
if [ ! -f ${minecraft_icon} ]; then
42-
curl --silent -kfLo ${minecraft_icon} \
43-
"https://i.imgur.com/cNN2mo5.png"
44-
fi
41+
# Downloads Minecraft icon if missing
42+
if [ ! -f ${minecraft_icon} ]; then
43+
curl --silent -kfLo ${minecraft_icon} \
44+
"https://i.imgur.com/cNN2mo5.png"
45+
fi
4546

46-
# Create desktop launcher
47-
if [ -d "$HOME/Desktop" ]; then
48-
cat > ${minecraft_shortcut} <<EOF
47+
# Create desktop launcher
48+
if [ -d "$HOME/Desktop" ]; then
49+
cat > ${minecraft_shortcut} <<EOF
4950
[Desktop Entry]
5051
Encoding=UTF-8
5152
Version=1.0
@@ -58,8 +59,8 @@ Icon=${minecraft_icon}
5859
Categories=Game;
5960
Comment=Block building game
6061
EOF
61-
chmod +x "${minecraft_shortcut}"
62-
fi
62+
chmod +x "${minecraft_shortcut}"
63+
fi
6364
}
6465

6566
# The following line is necessary.

bundles/vim/vim/vimrc

+3-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ if has('autocmd')
387387
autocmd FileType ledger vnoremap <silent> <buffer> <Tab> :LedgerAlign<CR>
388388
autocmd FileType ledger inoremap <silent> <Tab> <C-r>=ledger#autocomplete_and_align()<CR>
389389
390-
autocmd FileType ledger inoremap <leader>l <C-R>=strftime('%m-%d')<CR> *
390+
autocmd FileType ledger inoremap <leader>l <C-R>=strftime('%m-%d')<CR> *
391391
endif
392392

393393
noremap <silent><buffer> <2-LeftMouse> :call ledger#transaction_state_toggle(line('.'), '*?!')<CR>
@@ -423,7 +423,8 @@ if has('autocmd')
423423

424424
augroup HiglightTODO
425425
autocmd!
426-
autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'TODO\|ToDo\|Todo\|FIXME', -1)
426+
autocmd WinEnter,BufEnter * if &filetype != "ledger"
427+
\ | :silent! call matchadd('Todo', 'TODO\|ToDo\|Todo\|FIXME', -1)
427428
augroup END
428429

429430
" Toggle relative line numbers depending on mode

0 commit comments

Comments
 (0)