Starting over my dotfiles
This commit is contained in:
commit
c5f5e8cf33
91 changed files with 8107 additions and 0 deletions
31
README.md
Normal file
31
README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# dotfiles
|
||||
Theese are my dotfiles...
|
||||
|
||||
## VIM Plugins
|
||||
- Add vundle plugin with `git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vi`
|
||||
- Start vim and install plugins with `PlugInstall`
|
||||
|
||||
## Tweaks
|
||||
Some things are not (yet) scripted.
|
||||
|
||||
### Firefox Preferences
|
||||
Add this to `$fierfox-profile/user.js`
|
||||
```
|
||||
user_pref("privacy.donottrackheader.enabled", true ); // Send Do-not-track
|
||||
user_pref("findbar.highlightAll", true ); // Highlight all partial results in search
|
||||
user_pref("browser.sessionstore.max_resumed_crashes", -1 ); // Do not show "Upps, we could not recover"
|
||||
user_pref("browser.fixup.fallback-to-https", false ); // Do not try https after http failed
|
||||
user_pref("extensions.pocket.enabled", false ); // Disable Pocket
|
||||
user_pref("browser.vpn_promo.enabled", false ); // Hide VPN adds
|
||||
user_pref("cookiebanners.service.mode", 2 );
|
||||
user_pref("cookiebanners.service.mode.privateBrowsing", 2 );
|
||||
user_pref("cookiebanners.ui.desktop.enabled", true );
|
||||
user_pref("signon.firefoxRelay.feature", "0" );
|
||||
user_pref("signon.includeOtherSubdomainsInLookup" false ); // Credentials only for the actual site
|
||||
```
|
||||
|
||||
### GTK FileCHooser sort order
|
||||
Execute:
|
||||
```
|
||||
gsettings set org.gtk.Settings.FileChooser sort-directories-first true
|
||||
```
|
1
dotfiles/.gitignore
vendored
Normal file
1
dotfiles/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
vim/dot-vim/bundle
|
2
dotfiles/.stowrc
Normal file
2
dotfiles/.stowrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
--target=~
|
||||
--dotfiles
|
24
dotfiles/alacritty/dot-config/alacritty/alacritty.toml
Normal file
24
dotfiles/alacritty/dot-config/alacritty/alacritty.toml
Normal file
|
@ -0,0 +1,24 @@
|
|||
|
||||
[cursor.style]
|
||||
shape = "Beam"
|
||||
|
||||
[cursor.vi_mode_style]
|
||||
shape = "Underline"
|
||||
|
||||
[font]
|
||||
size = 10
|
||||
|
||||
[font.bold]
|
||||
family = "EnvyCodeR Nerd Font Mono"
|
||||
style = "Bold"
|
||||
|
||||
[font.italic]
|
||||
family = "EnvyCodeR Nerd Font Mono"
|
||||
style = "Italic"
|
||||
|
||||
[font.normal]
|
||||
family = "EnvyCodeR Nerd Font Mono"
|
||||
style = "Regular"
|
||||
|
||||
[general]
|
||||
import = ["~/.local/alacritty_colors.toml"]
|
|
@ -0,0 +1,28 @@
|
|||
# Colors (Paper Theme)
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#F2EEDE'
|
||||
foreground = '#000000'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#000000'
|
||||
red = '#CC3E28'
|
||||
green = '#216609'
|
||||
yellow = '#B58900'
|
||||
blue = '#1E6FCC'
|
||||
magenta = '#5C21A5'
|
||||
cyan = '#158C86'
|
||||
white = '#AAAAAA'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#555555'
|
||||
red = '#CC3E28'
|
||||
green = '#216609'
|
||||
yellow = '#B58900'
|
||||
blue = '#1E6FCC'
|
||||
magenta = '#5C21A5'
|
||||
cyan = '#158C86'
|
||||
white = '#AAAAAA'
|
|
@ -0,0 +1,29 @@
|
|||
# Colors (Tokyo Night)
|
||||
# Source https//github.com/zatchheems/tokyo-night-alacritty-theme
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#1a1b26'
|
||||
foreground = '#a9b1d6'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#32344a'
|
||||
red = '#f7768e'
|
||||
green = '#9ece6a'
|
||||
yellow = '#e0af68'
|
||||
blue = '#7aa2f7'
|
||||
magenta = '#ad8ee6'
|
||||
cyan = '#449dab'
|
||||
white = '#787c99'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#444b6a'
|
||||
red = '#ff7a93'
|
||||
green = '#b9f27c'
|
||||
yellow = '#ff9e64'
|
||||
blue = '#7da6ff'
|
||||
magenta = '#bb9af7'
|
||||
cyan = '#0db9d7'
|
||||
white = '#acb0d0'
|
55
dotfiles/alacritty/dot-config/alacritty/color/baitong.toml
Normal file
55
dotfiles/alacritty/dot-config/alacritty/color/baitong.toml
Normal file
|
@ -0,0 +1,55 @@
|
|||
# Colors (Baitong)
|
||||
|
||||
[colors.primary]
|
||||
background = '#112a2a'
|
||||
foreground = '#33ff33'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#112a2a'
|
||||
cursor = '#ff00ff'
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
text = '#112a2a'
|
||||
cursor = '#ff00ff'
|
||||
|
||||
[colors.search]
|
||||
matches = { foreground = '#000000', background = '#1AE642' }
|
||||
focused_match = { foreground = '#000000', background = '#ff00ff' }
|
||||
|
||||
[colors.hints]
|
||||
start = { foreground = '#1d1f21', background = '#1AE642' }
|
||||
end = { foreground = '#1AE642', background = '#1d1f21' }
|
||||
|
||||
[colors.line_indicator]
|
||||
foreground = '#33ff33'
|
||||
background = '#1d1f21'
|
||||
|
||||
[colors.footer_bar]
|
||||
background = '#731d8b'
|
||||
foreground = '#ffffff'
|
||||
|
||||
[colors.selection]
|
||||
text = '#112a2a'
|
||||
background = '#1AE642'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#000000'
|
||||
red = '#f77272'
|
||||
green = '#33ff33'
|
||||
yellow = '#1AE642'
|
||||
blue = '#68FDFE'
|
||||
magenta = '#ff66ff'
|
||||
cyan = '#87CEFA'
|
||||
white = '#dbdbd9'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#ffffff'
|
||||
red = '#f77272'
|
||||
green = '#33ff33'
|
||||
yellow = '#1AE642'
|
||||
blue = '#68FDFE'
|
||||
magenta = '#ff66ff'
|
||||
cyan = '#68FDFE'
|
||||
white = '#dbdbd9'
|
|
@ -0,0 +1,33 @@
|
|||
# Cyber Punk Neon
|
||||
# Source https//github.com/Roboron3042/Cyberpunk-Neon
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#000b1e'
|
||||
foreground = '#0abdc6'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#000b1e'
|
||||
cursor = '#0abdc6'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#123e7c'
|
||||
red = '#ff0000'
|
||||
green = '#d300c4'
|
||||
yellow = '#f57800'
|
||||
blue = '#123e7c'
|
||||
magenta = '#711c91'
|
||||
cyan = '#0abdc6'
|
||||
white = '#d7d7d5'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#1c61c2'
|
||||
red = '#ff0000'
|
||||
green = '#d300c4'
|
||||
yellow = '#f57800'
|
||||
blue = '#00ff00'
|
||||
magenta = '#711c91'
|
||||
cyan = '#0abdc6'
|
||||
white = '#d7d7d5'
|
|
@ -0,0 +1,34 @@
|
|||
# Dark Pride
|
||||
# A dark trans pride colour inspired theme
|
||||
|
||||
# Primary colors
|
||||
[colors.primary]
|
||||
background = '#0d0d1b'
|
||||
foreground = '#ccccce'
|
||||
|
||||
# Colors used for 'custom_cursor_colors'
|
||||
[colors.cursor]
|
||||
text = '#bbbbbb'
|
||||
cursor = '#ff0017'
|
||||
|
||||
# Colors 0 through 7
|
||||
[colors.normal]
|
||||
black = '#282828'
|
||||
red = '#ca1444'
|
||||
green = '#789aba'
|
||||
yellow = '#b3879f'
|
||||
blue = '#95569b'
|
||||
magenta = '#cb6fa1'
|
||||
cyan = '#fb6e93'
|
||||
white = '#cf98c1'
|
||||
|
||||
# Colors 8 through 15
|
||||
[colors.bright]
|
||||
black = '#98218e'
|
||||
red = '#cb515d'
|
||||
green = '#5a87b1'
|
||||
yellow = '#9c61ab'
|
||||
blue = '#9a77b1'
|
||||
magenta = '#f2a297'
|
||||
cyan = '#f4436f'
|
||||
white = '#ebdbb2'
|
|
@ -0,0 +1,28 @@
|
|||
# Gnome (Gnome Terminal Default)
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#1e1e1e'
|
||||
foreground = '#ffffff'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#171421'
|
||||
red = '#c01c28'
|
||||
green = '#26a269'
|
||||
yellow = '#a2734c'
|
||||
blue = '#12488b'
|
||||
magenta = '#a347ba'
|
||||
cyan = '#2aa1b3'
|
||||
white = '#d0cfcc'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#5e5c64'
|
||||
red = '#f66151'
|
||||
green = '#33d17a'
|
||||
yellow = '#e9ad0c'
|
||||
blue = '#2a7bde'
|
||||
magenta = '#c061cb'
|
||||
cyan = '#33c7de'
|
||||
white = '#ffffff'
|
29
dotfiles/alacritty/dot-config/alacritty/color/palenight.toml
Normal file
29
dotfiles/alacritty/dot-config/alacritty/color/palenight.toml
Normal file
|
@ -0,0 +1,29 @@
|
|||
# iTerm2 Material Design - Palenight theme for Alacritty
|
||||
# Source https//github.com/JonathanSpeek/palenight-iterm2
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#292d3e'
|
||||
foreground = '#d0d0d0'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#292d3e'
|
||||
red = '#f07178'
|
||||
green = '#c3e88d'
|
||||
yellow = '#ffcb6b'
|
||||
blue = '#82aaff'
|
||||
magenta = '#c792ea'
|
||||
cyan = '#89ddff'
|
||||
white = '#d0d0d0'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#434758'
|
||||
red = '#ff8b92'
|
||||
green = '#ddffa7'
|
||||
yellow = '#ffe585'
|
||||
blue = '#9cc4ff'
|
||||
magenta = '#e1acff'
|
||||
cyan = '#a3f7ff'
|
||||
white = '#ffffff'
|
39
dotfiles/alacritty/dot-config/alacritty/color/rose_pine.toml
Normal file
39
dotfiles/alacritty/dot-config/alacritty/color/rose_pine.toml
Normal file
|
@ -0,0 +1,39 @@
|
|||
[colors.primary]
|
||||
background = '#191724'
|
||||
foreground = '#e0def4'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#e0def4'
|
||||
cursor = '#524f67'
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
text = '#e0def4'
|
||||
cursor = '#524f67'
|
||||
|
||||
[colors.selection]
|
||||
text = '#e0def4'
|
||||
background = '#403d52'
|
||||
|
||||
[colors.normal]
|
||||
black = '#26233a'
|
||||
red = '#eb6f92'
|
||||
green = '#31748f'
|
||||
yellow = '#f6c177'
|
||||
blue = '#9ccfd8'
|
||||
magenta = '#c4a7e7'
|
||||
cyan = '#ebbcba'
|
||||
white = '#e0def4'
|
||||
|
||||
[colors.bright]
|
||||
black = '#6e6a86'
|
||||
red = '#eb6f92'
|
||||
green = '#31748f'
|
||||
yellow = '#f6c177'
|
||||
blue = '#9ccfd8'
|
||||
magenta = '#c4a7e7'
|
||||
cyan = '#ebbcba'
|
||||
white = '#e0def4'
|
||||
|
||||
[colors.hints]
|
||||
start = {foreground = '#908caa', background = '#1f1d2e' }
|
||||
end = { foreground = '#6e6a86', background = '#1f1d2e' }
|
|
@ -0,0 +1,39 @@
|
|||
[colors.primary]
|
||||
background = '#faf4ed'
|
||||
foreground = '#575279'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#575279'
|
||||
cursor = '#cecacd'
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
text = '#575279'
|
||||
cursor = '#cecacd'
|
||||
|
||||
[colors.selection]
|
||||
text = '#575279'
|
||||
background = '#dfdad9'
|
||||
|
||||
[colors.normal]
|
||||
black = '#f2e9e1'
|
||||
red = '#b4637a'
|
||||
green = '#286983'
|
||||
yellow = '#ea9d34'
|
||||
blue = '#56949f'
|
||||
magenta = '#907aa9'
|
||||
cyan = '#d7827e'
|
||||
white = '#575279'
|
||||
|
||||
[colors.bright]
|
||||
black = '#9893a5'
|
||||
red = '#b4637a'
|
||||
green = '#286983'
|
||||
yellow = '#ea9d34'
|
||||
blue = '#56949f'
|
||||
magenta = '#907aa9'
|
||||
cyan = '#d7827e'
|
||||
white = '#575279'
|
||||
|
||||
[colors.hints]
|
||||
start = { foreground = '#797593', background = '#fffaf3' }
|
||||
end = { foreground = '#9893a5', background = '#fffaf3' }
|
|
@ -0,0 +1,38 @@
|
|||
[colors.primary]
|
||||
background = '#232136'
|
||||
foreground = '#e0def4'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#e0def4'
|
||||
cursor = '#56526e'
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
text = '#e0def4'
|
||||
cursor = '#56526e'
|
||||
|
||||
[colors.selection]
|
||||
text = '#e0def4'
|
||||
background = '#44415a'
|
||||
[colors.normal]
|
||||
black = '#393552'
|
||||
red = '#eb6f92'
|
||||
green = '#3e8fb0'
|
||||
yellow = '#f6c177'
|
||||
blue = '#9ccfd8'
|
||||
magenta = '#c4a7e7'
|
||||
cyan = '#ea9a97'
|
||||
white = '#e0def4'
|
||||
|
||||
[colors.bright]
|
||||
black = '#6e6a86'
|
||||
red = '#eb6f92'
|
||||
green = '#3e8fb0'
|
||||
yellow = '#f6c177'
|
||||
blue = '#9ccfd8'
|
||||
magenta = '#c4a7e7'
|
||||
cyan = '#ea9a97'
|
||||
white = '#e0def4'
|
||||
|
||||
[colors.hints]
|
||||
start = { foreground = '#908caa', background = '#2a273f' }
|
||||
end = { foreground = '#6e6a86', background = '#2a273f' }
|
37
dotfiles/alacritty/dot-config/alacritty/color/seashells.toml
Normal file
37
dotfiles/alacritty/dot-config/alacritty/color/seashells.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Colors (SeaShells)
|
||||
# Source https//raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/SeaShells.itermcolors
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#061923'
|
||||
foreground = '#e5c49e'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#061822'
|
||||
cursor = '#feaf3c'
|
||||
|
||||
[colors.selection]
|
||||
text = '#ffe9d7'
|
||||
background = '#265b75'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#1d485f'
|
||||
red = '#db662d'
|
||||
green = '#008eab'
|
||||
yellow = '#feaf3c'
|
||||
blue = '#255a62'
|
||||
magenta = '#77dbf4'
|
||||
cyan = '#5fb1c2'
|
||||
white = '#e5c49e'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#545d65'
|
||||
red = '#dd998a'
|
||||
green = '#739da8'
|
||||
yellow = '#fedaae'
|
||||
blue = '#0bc7e3'
|
||||
magenta = '#c6e8f1'
|
||||
cyan = '#97b9c0'
|
||||
white = '#ffe9d7'
|
27
dotfiles/alacritty/dot-config/alacritty/color/sourcerer.toml
Normal file
27
dotfiles/alacritty/dot-config/alacritty/color/sourcerer.toml
Normal file
|
@ -0,0 +1,27 @@
|
|||
[colors.bright]
|
||||
black = "#181818"
|
||||
blue = "#90b0d1"
|
||||
cyan = "#87ceeb"
|
||||
green = "#b1d631"
|
||||
magenta = "#8181a6"
|
||||
red = "#ff6a6a"
|
||||
white = "#c1cdc1"
|
||||
yellow = "#ff9800"
|
||||
|
||||
[colors.cursor]
|
||||
cursor = "#c2c2b0"
|
||||
text = "#c2c2b0"
|
||||
|
||||
[colors.normal]
|
||||
black = "#111111"
|
||||
blue = "#6688aa"
|
||||
cyan = "#528b8b"
|
||||
green = "#719611"
|
||||
magenta = "#8f6f8f"
|
||||
red = "#aa4450"
|
||||
white = "#d3d3d3"
|
||||
yellow = "#cc8800"
|
||||
|
||||
[colors.primary]
|
||||
background = "#222222"
|
||||
foreground = "#c2c2b0"
|
33
dotfiles/alacritty/dot-config/alacritty/color/spacegray.toml
Normal file
33
dotfiles/alacritty/dot-config/alacritty/color/spacegray.toml
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Spacegray, from Sublime Text
|
||||
# Source https://github.com/SublimeText/Spacegray
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#20242d'
|
||||
foreground = '#b3b8c3'
|
||||
|
||||
[colors.cursor]
|
||||
text = '#b3b8c3'
|
||||
cursor = '#b3b8c3'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#000000'
|
||||
red = '#b04b57'
|
||||
green = '#87b379'
|
||||
yellow = '#e5c179'
|
||||
blue = '#7d8fa4'
|
||||
magenta = '#a47996'
|
||||
cyan = '#85a7a5'
|
||||
white = '#b3b8c3'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#000000'
|
||||
red = '#b04b57'
|
||||
green = '#87b379'
|
||||
yellow = '#e5c179'
|
||||
blue = '#7d8fa4'
|
||||
magenta = '#a47996'
|
||||
cyan = '#85a7a5'
|
||||
white = '#ffffff'
|
|
@ -0,0 +1,23 @@
|
|||
[colors.primary]
|
||||
foreground = "#ffffff"
|
||||
background = "#262335"
|
||||
|
||||
[colors.normal]
|
||||
black = "#262335"
|
||||
red = "#fe4450"
|
||||
green = "#72f1b8"
|
||||
yellow = "#f3e70f"
|
||||
blue = "#03edf9"
|
||||
magenta = "#ff7edb"
|
||||
cyan = "#03edf9"
|
||||
white = "#ffffff"
|
||||
|
||||
[colors.bright]
|
||||
black = "#614d85"
|
||||
red = "#fe4450"
|
||||
green = "#72f1b8"
|
||||
yellow = "#fede5d"
|
||||
blue = "#03edf9"
|
||||
magenta = "#ff7edb"
|
||||
cyan = "#03edf9"
|
||||
white = "#ffffff"
|
|
@ -0,0 +1,30 @@
|
|||
[colors.primary]
|
||||
background = "#08080b"
|
||||
foreground = "#787c99"
|
||||
|
||||
[colors.cursor]
|
||||
cursor = "#787c99"
|
||||
|
||||
[colors.selection]
|
||||
text = "CellForeground"
|
||||
background = "#515c7e"
|
||||
|
||||
[colors.normal]
|
||||
black = "#363b54"
|
||||
red = "#f7768e"
|
||||
green = "#41a6b5"
|
||||
yellow = "#e0af68"
|
||||
blue = "#7aa2f7"
|
||||
magenta = "#bb9af7"
|
||||
cyan = "#7dcfff"
|
||||
white = "#787c99"
|
||||
|
||||
[colors.bright]
|
||||
black = "#363b54"
|
||||
red = "#f7768e"
|
||||
green = "#41a6b5"
|
||||
yellow = "#e0af68"
|
||||
blue = "#7aa2f7"
|
||||
magenta = "#bb9af7"
|
||||
cyan = "#7dcfff"
|
||||
white = "#787c99"
|
|
@ -0,0 +1,29 @@
|
|||
# Colors (Tokyo Night Storm variant)
|
||||
# Source https//github.com/zatchheems/tokyo-night-alacritty-theme
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = '#24283b'
|
||||
foreground = '#a9b1d6'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = '#32344a'
|
||||
red = '#f7768e'
|
||||
green = '#9ece6a'
|
||||
yellow = '#e0af68'
|
||||
blue = '#7aa2f7'
|
||||
magenta = '#ad8ee6'
|
||||
cyan = '#449dab'
|
||||
white = '#9699a8'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = '#444b6a'
|
||||
red = '#ff7a93'
|
||||
green = '#b9f27c'
|
||||
yellow = '#ff9e64'
|
||||
blue = '#7da6ff'
|
||||
magenta = '#bb9af7'
|
||||
cyan = '#0db9d7'
|
||||
white = '#acb0d0'
|
33
dotfiles/alacritty/dot-config/alacritty/color/ubuntu.toml
Normal file
33
dotfiles/alacritty/dot-config/alacritty/color/ubuntu.toml
Normal file
|
@ -0,0 +1,33 @@
|
|||
# 0x From the Ubuntu terminal color palette
|
||||
|
||||
# 0x Default colors
|
||||
[colors.primary]
|
||||
background = '#300a24'
|
||||
foreground = '#eeeeec'
|
||||
|
||||
# 0x Colors the cursor will use if `custom_cursor_colors` is true
|
||||
[colors.cursor]
|
||||
text = '#bbbbbb'
|
||||
cursor = '#b4d5ff'
|
||||
|
||||
# 0x Normal colors
|
||||
[colors.normal]
|
||||
black = '#2e3436'
|
||||
red = '#cc0000'
|
||||
green = '#4e9a06'
|
||||
yellow = '#c4a000'
|
||||
blue = '#3465a4'
|
||||
magenta = '#75507b'
|
||||
cyan = '#06989a'
|
||||
white = '#d3d7cf'
|
||||
|
||||
# 0x Bright colors
|
||||
[colors.bright]
|
||||
black = '#555753'
|
||||
red = '#ef2929'
|
||||
green = '#8ae234'
|
||||
yellow = '#fce94f'
|
||||
blue = '#729fcf'
|
||||
magenta = '#ad7fa8'
|
||||
cyan = '#34e2e2'
|
||||
white = '#eeeeec'
|
14
dotfiles/gnucash/dot-local/share/applications/gnucash.desktop
Executable file
14
dotfiles/gnucash/dot-local/share/applications/gnucash.desktop
Executable file
|
@ -0,0 +1,14 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
MimeType=application/x-gnucash;
|
||||
Name[de]=GnuCash
|
||||
Name=GnuCash
|
||||
GenericName[de]=Finanzmanagement
|
||||
GenericName=Finance Management
|
||||
Comment[de]=Verwaltung der Finanzen von Privatanwendern und Kleinbetrieben.
|
||||
Comment=Manage your finances, accounts, and investments
|
||||
Exec=env LC_MESSAGES=de_DE.UTF-8 gnucash %f
|
||||
Icon=gnucash-icon
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Categories=Office;Finance;
|
230
dotfiles/i3/dot-config/i3/config
Normal file
230
dotfiles/i3/dot-config/i3/config
Normal file
|
@ -0,0 +1,230 @@
|
|||
# i3 config file (v4)
|
||||
#
|
||||
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
|
||||
|
||||
set $mod Mod4
|
||||
set $alt Mod1
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
#font pango:B612 Mono 12
|
||||
font pango:Hack Nerd Font 10
|
||||
|
||||
# Green Colors
|
||||
## class border backgr. text indicator child_border
|
||||
client.focused #77994B #547628 #EEEEEE #41FF00
|
||||
client.focused_inactive #333333 #5F676A #EEEEEE #333333
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec i3-sensible-terminal
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+c kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
#bindsym $mod+d exec --no-startup-id "i3-dmenu-desktop -dmenu='dmenu -i -fn B612' --entry-type name"
|
||||
|
||||
## Rofi replaces dmenu...
|
||||
bindsym $mod+d exec --no-startup-id "rofi -show drun"
|
||||
bindsym $mod+Tab exec --no-startup-id "rofi -show window"
|
||||
bindsym $mod+s exec --no-startup-id "rofi -show ssh"
|
||||
|
||||
# Local Hotkeys
|
||||
bindsym $mod+x exec --no-startup-id "test -x ~/.local/bin/lhotkey-x && ~/.local/bin/lhotkey-x"
|
||||
bindsym $mod+y exec --no-startup-id "test -x ~/.local/bin/lhotkey-y && ~/.local/bin/lhotkey-y"
|
||||
bindsym $mod+F1 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F01 && ~/.local/bin/lhotkey-F01"
|
||||
bindsym $mod+F2 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F02 && ~/.local/bin/lhotkey-F02"
|
||||
bindsym $mod+F3 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F03 && ~/.local/bin/lhotkey-F03"
|
||||
bindsym $mod+F4 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F04 && ~/.local/bin/lhotkey-F04"
|
||||
bindsym $mod+F5 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F05 && ~/.local/bin/lhotkey-F05"
|
||||
bindsym $mod+F6 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F06 && ~/.local/bin/lhotkey-F06"
|
||||
bindsym $mod+F7 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F07 && ~/.local/bin/lhotkey-F07"
|
||||
bindsym $mod+F8 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F08 && ~/.local/bin/lhotkey-F08"
|
||||
bindsym $mod+F9 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F09 && ~/.local/bin/lhotkey-F09"
|
||||
bindsym $mod+F10 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F10 && ~/.local/bin/lhotkey-F10"
|
||||
bindsym $mod+F11 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F11 && ~/.local/bin/lhotkey-F11"
|
||||
bindsym $mod+F12 exec --no-startup-id "test -x ~/.local/bin/lhotkey-F12 && ~/.local/bin/lhotkey-F12"
|
||||
|
||||
# change focus
|
||||
bindsym $mod+h focus left
|
||||
bindsym $mod+j focus down
|
||||
bindsym $mod+k focus up
|
||||
bindsym $mod+l focus right
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+h move left
|
||||
bindsym $mod+Shift+j move down
|
||||
bindsym $mod+Shift+k move up
|
||||
bindsym $mod+Shift+l move right
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# move the whole workspace to an other display
|
||||
bindsym $mod+$alt+h move workspace to output left
|
||||
bindsym $mod+$alt+l move workspace to output right
|
||||
bindsym $mod+$alt+Left move workspace to output left
|
||||
bindsym $mod+$alt+Right move workspace to output right
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
bindsym $mod+$alt+e layout toggle split
|
||||
bindsym $mod+$alt+s layout stacking
|
||||
bindsym $mod+$alt+w layout tabbed
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container with PageUp/Down
|
||||
bindsym $mod+Prior focus parent
|
||||
bindsym $mod+Next focus child
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
bindsym $mod+0 workspace 10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace 1
|
||||
bindsym $mod+Shift+2 move container to workspace 2
|
||||
bindsym $mod+Shift+3 move container to workspace 3
|
||||
bindsym $mod+Shift+4 move container to workspace 4
|
||||
bindsym $mod+Shift+5 move container to workspace 5
|
||||
bindsym $mod+Shift+6 move container to workspace 6
|
||||
bindsym $mod+Shift+7 move container to workspace 7
|
||||
bindsym $mod+Shift+8 move container to workspace 8
|
||||
bindsym $mod+Shift+9 move container to workspace 9
|
||||
bindsym $mod+Shift+0 move container to workspace 10
|
||||
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
mode "resize" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
bindsym h resize shrink width 10 px or 10 ppt
|
||||
bindsym j resize grow height 10 px or 10 ppt
|
||||
bindsym k resize shrink height 10 px or 10 ppt
|
||||
bindsym l resize grow width 10 px or 10 ppt
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
bar {
|
||||
colors {
|
||||
focused_workspace #77994B #547628 #EEEEEE #41FF00
|
||||
}
|
||||
#font pango:Hack Nerd Font 10
|
||||
position top
|
||||
status_command i3status-rs ~/.config/i3/i3status-rs.conf
|
||||
}
|
||||
|
||||
# PW Audio controls
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
bindsym XF86AudioMute exec --no-startup-id "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
|
||||
# Sreen brightness controls
|
||||
bindsym XF86MonBrightnessUp exec light -A 5
|
||||
bindsym XF86MonBrightnessDown exec light -U 5
|
||||
|
||||
# Toggle WiFi
|
||||
# [ _$(nmcli radio wifi) == _enabled ] && nmcli radio wifi off || nmcli radio wifi on
|
||||
|
||||
# Screenlock
|
||||
bindsym $alt+Ctrl+l exec "~/.bin/screenlock.sh"
|
||||
bindsym XF86Sleep exec "~/.bin/screenlock.sh"
|
||||
exec --no-startup-id xautolock -time 15 -locker "~/.bin/screenlock.sh" &
|
||||
|
||||
# quick terminal
|
||||
bindsym $mod+$alt+Shift+F1 exec --no-startup-id $TERMINAL --class metask -e bash -o ignoreeof
|
||||
exec --no-startup-id $TERMINAL --class metask -e bash -o ignoreeof
|
||||
for_window [instance="metask"] floating enable;
|
||||
for_window [instance="metask"] move scratchpad; \
|
||||
[instance="metask"] scratchpad show; \
|
||||
move position 0px 22px; \
|
||||
resize shrink height 150px; \
|
||||
resize grow width 683px; \
|
||||
move scratchpad
|
||||
bindsym F1 [instance="metask"] scratchpad show
|
||||
|
||||
# Touchpad controls
|
||||
#bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
|
||||
|
||||
# Media player controls
|
||||
#bindsym XF86AudioPlay exec playerctl play
|
||||
#bindsym XF86AudioPause exec playerctl pause
|
||||
#bindsym XF86AudioNext exec playerctl next
|
||||
#bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
# Misc keybindings
|
||||
bindsym --release Print exec "scrot --select"
|
||||
bindsym $mod+c exec free42
|
||||
bindsym $mod+plus exec .bin/switchTermColours.sh
|
||||
bindsym $mod+XF86Calc exec free42
|
||||
bindsym $mod+b exec ~/.bin/startBrowser.sh
|
||||
bindsym $mod+$alt+b exec ~/.bin/startAltBrowser.sh
|
||||
bindsym $mod+n exec ~/.bin/startBrowserPrivat.sh
|
||||
bindsym $mod+$alt+n exec ~/.bin/startAltBrowserPrivat.sh
|
||||
bindsym $mod+m exec ~/.bin/dmenu_dir2menu.sh ~/.screenlayout/
|
||||
|
||||
# Clipboard
|
||||
bindsym $mod+q exec --no-startup-id "~/.bin/xcqr"
|
||||
bindsym $mod+v exec --no-startup-id "clipmenu"
|
||||
|
||||
|
||||
# Autostart
|
||||
exec --no-startup-id "blueman-applet"
|
||||
exec --no-startup-id "nm-applet"
|
||||
exec --no-startup-id "clipmenud"
|
||||
exec --no-startup-id "dunst -config ~/.config/i3/dunstrc"
|
||||
exec --no-startup-id "qpwgraph --minimized"
|
||||
exec --no-startup-id test -x ~/.local/bin/i3autostart.sh && ~/.local/bin/i3autostart.sh
|
||||
exec --no-startup-id gsettings set org.gtk.Settings.FileChooser sort-directories-first true
|
||||
|
||||
## Spirallayout for new windows
|
||||
exec_always --no-startup-id /usr/bin/autotiling
|
||||
|
||||
## Window Config
|
||||
for_window [class="Arandr"] floating enable
|
||||
for_window [class="Argon"] floating enable
|
||||
for_window [class="Blueman-manager"] floating enable
|
||||
for_window [class="Ghidra"] floating enable
|
||||
for_window [class="Plus42"] floating enable
|
||||
for_window [class="QjackCtl"] floating enable
|
||||
for_window [class="Qsynth"] floating enable
|
||||
for_window [class="VMPK"] floating enable
|
||||
for_window [class="Vlc"] floating enable
|
||||
for_window [class="X3270"] floating enable
|
||||
for_window [class="pavucontrol"] floating enable
|
||||
for_window [class="smplayer"] floating enable
|
48
dotfiles/i3/dot-config/i3/dunstrc
Normal file
48
dotfiles/i3/dot-config/i3/dunstrc
Normal file
|
@ -0,0 +1,48 @@
|
|||
[global]
|
||||
font = Hack Nerd Font 10
|
||||
allow_markup = yes
|
||||
format = "<b>%s</b>\n%b"
|
||||
sort = yes
|
||||
indicate_hidden = yes
|
||||
alignment = right
|
||||
bounce_freq = 0
|
||||
show_age_threshold = 60
|
||||
word_wrap = yes
|
||||
ignore_newline = no
|
||||
geometry = "200x5-6+30"
|
||||
transparency = 0
|
||||
idle_threshold = 120
|
||||
monitor = 0
|
||||
follow = mouse
|
||||
sticky_history = yes
|
||||
line_height = 0
|
||||
separator_height = 2
|
||||
padding = 8
|
||||
horizontal_padding = 8
|
||||
separator_color = "#585858"
|
||||
startup_notification = false
|
||||
|
||||
[frame]
|
||||
width = 1
|
||||
color = "#383838"
|
||||
|
||||
[shortcuts]
|
||||
close = ctrl+space
|
||||
close_all = ctrl+shift+space
|
||||
# history = ctrl+h
|
||||
context = ctrl+shift+period
|
||||
|
||||
[urgency_low]
|
||||
background = "#181818"
|
||||
foreground = "#E3C7AF"
|
||||
timeout = 5
|
||||
|
||||
[urgency_normal]
|
||||
background = "#181818"
|
||||
foreground = "#E3C7AF"
|
||||
timeout = 20
|
||||
|
||||
[urgency_critical]
|
||||
background = "#181818"
|
||||
foreground = "#FF2121"
|
||||
timeout = 0
|
80
dotfiles/i3/dot-config/i3/i3-status.conf
Normal file
80
dotfiles/i3/dot-config/i3/i3-status.conf
Normal file
|
@ -0,0 +1,80 @@
|
|||
# i3status configuration file.
|
||||
# see "man i3status" for documentation.
|
||||
|
||||
# It is important that this file is edited as UTF-8.
|
||||
# The following line should contain a sharp s:
|
||||
# ß
|
||||
# If the above line is not correctly displayed, fix your editor first!
|
||||
|
||||
general {
|
||||
colors = true
|
||||
interval = 2
|
||||
}
|
||||
|
||||
order += "disk /"
|
||||
order += "ipv6"
|
||||
order += "wireless _first_"
|
||||
order += "ethernet _first_"
|
||||
order += "cpu_temperature 0"
|
||||
order += "cpu_usage"
|
||||
order += "load"
|
||||
order += "volume master"
|
||||
order += "battery 0"
|
||||
order += "tztime local"
|
||||
|
||||
ipv6 {
|
||||
format_down = ""
|
||||
}
|
||||
|
||||
wireless _first_ {
|
||||
format_up = "⚵ %ip (%quality at %essid)"
|
||||
format_down = ""
|
||||
}
|
||||
|
||||
ethernet _first_ {
|
||||
## if you use %speed, i3status requires root privileges
|
||||
format_up = "♆ %ip (%speed)"
|
||||
format_down = ""
|
||||
}
|
||||
|
||||
battery 0 {
|
||||
format = "%status%percentage %remaining"
|
||||
format_down = ""
|
||||
status_chr = "⚡▴ "
|
||||
status_bat = "⚡▾ "
|
||||
status_full = "⚡ "
|
||||
low_threshold = 30
|
||||
threshold_type = time
|
||||
hide_seconds = true
|
||||
integer_battery_capacity = true
|
||||
}
|
||||
|
||||
tztime local {
|
||||
format = "KW%V %Y-%m-%d %H:%M"
|
||||
}
|
||||
|
||||
load {
|
||||
format = "📊 %1min %5min %15min"
|
||||
}
|
||||
|
||||
cpu_usage {
|
||||
format = "🚀 %usage"
|
||||
}
|
||||
|
||||
cpu_temperature 0 {
|
||||
format = "♨ %degrees °C"
|
||||
path = "~/.local/systemp"
|
||||
}
|
||||
|
||||
disk "/" {
|
||||
format = "/ %avail"
|
||||
prefix_type = custom
|
||||
}
|
||||
|
||||
volume master {
|
||||
format = "♪ %volume"
|
||||
format_muted = "♪ mute (%volume)"
|
||||
device = "default"
|
||||
mixer = "Master"
|
||||
mixer_idx = 0
|
||||
}
|
69
dotfiles/i3/dot-config/i3/i3status-rs.conf
Normal file
69
dotfiles/i3/dot-config/i3/i3status-rs.conf
Normal file
|
@ -0,0 +1,69 @@
|
|||
[theme]
|
||||
theme = "modern"
|
||||
|
||||
[icons]
|
||||
icons = "awesome6"
|
||||
|
||||
[[block]]
|
||||
block = "privacy"
|
||||
|
||||
[[block.driver]]
|
||||
name = "v4l"
|
||||
|
||||
[[block.driver]]
|
||||
name = "pipewire"
|
||||
exclude_input = ["openrgb"]
|
||||
display = "nickname"
|
||||
|
||||
|
||||
[[block]]
|
||||
block = "disk_space"
|
||||
info_type = "available"
|
||||
alert_unit = "GB"
|
||||
alert = 10.0
|
||||
warning = 15.0
|
||||
format = " $icon $available "
|
||||
format_alt = " $icon $available / $total "
|
||||
|
||||
[[block]]
|
||||
block = "net"
|
||||
format = " $icon $ip ({$signal_strength $ssid|Wired}) "
|
||||
|
||||
#[[block]]
|
||||
#block = "external_ip"
|
||||
#format = " $ip $country_code "
|
||||
#interval = 900
|
||||
|
||||
[[block]]
|
||||
block = "temperature"
|
||||
format = " $icon $max max "
|
||||
format_alt = " $icon $min min, $max max, $average avg "
|
||||
interval = 10
|
||||
chip = "*-isa-*"
|
||||
|
||||
[[block]]
|
||||
block = "cpu"
|
||||
interval = 1
|
||||
format = " $icon $barchart $utilization "
|
||||
format_alt = " $icon $frequency{ $boost|} "
|
||||
info_cpu = 30
|
||||
warning_cpu = 50
|
||||
critical_cpu = 90
|
||||
|
||||
[[block]]
|
||||
block = "load"
|
||||
format = " $icon $1m.eng(w:4) $5m.eng(w:4) $15m.eng(w:4) "
|
||||
interval = 2
|
||||
|
||||
[[block]]
|
||||
block = "sound"
|
||||
step_width = 3
|
||||
|
||||
[[block]]
|
||||
block = "battery"
|
||||
format = "$icon $percentage {$time |}"
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
interval = 60
|
||||
format = " $icon $timestamp.datetime(f:'KW%V %Y-%m-%d %H:%M', l:de_DE) "
|
64
dotfiles/my-binaries/dot-bin/256colors.pl
Executable file
64
dotfiles/my-binaries/dot-bin/256colors.pl
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/perl
|
||||
# Author: Todd Larason <jtl@molehill.org>
|
||||
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
|
||||
|
||||
# use the resources for colors 0-15 - usually more-or-less a
|
||||
# reproduction of the standard ANSI colors, but possibly more
|
||||
# pleasing shades
|
||||
|
||||
# colors 16-231 are a 6x6x6 color cube
|
||||
for ($red = 0; $red < 6; $red++) {
|
||||
for ($green = 0; $green < 6; $green++) {
|
||||
for ($blue = 0; $blue < 6; $blue++) {
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
16 + ($red * 36) + ($green * 6) + $blue,
|
||||
($red ? ($red * 40 + 55) : 0),
|
||||
($green ? ($green * 40 + 55) : 0),
|
||||
($blue ? ($blue * 40 + 55) : 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# colors 232-255 are a grayscale ramp, intentionally leaving out
|
||||
# black and white
|
||||
for ($gray = 0; $gray < 24; $gray++) {
|
||||
$level = ($gray * 10) + 8;
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
232 + $gray, $level, $level, $level);
|
||||
}
|
||||
|
||||
|
||||
# display the colors
|
||||
|
||||
# first the system ones:
|
||||
print "System colors:\n";
|
||||
for ($color = 0; $color < 8; $color++) {
|
||||
print "\x1b[48;5;${color}m ";
|
||||
}
|
||||
print "\x1b[0m\n";
|
||||
for ($color = 8; $color < 16; $color++) {
|
||||
print "\x1b[48;5;${color}m ";
|
||||
}
|
||||
print "\x1b[0m\n\n";
|
||||
|
||||
# now the color cube
|
||||
print "Color cube, 6x6x6:\n";
|
||||
for ($green = 0; $green < 6; $green++) {
|
||||
for ($red = 0; $red < 6; $red++) {
|
||||
for ($blue = 0; $blue < 6; $blue++) {
|
||||
$color = 16 + ($red * 36) + ($green * 6) + $blue;
|
||||
print "\x1b[48;5;${color}m ";
|
||||
}
|
||||
print "\x1b[0m ";
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
# now the grayscale ramp
|
||||
print "Grayscale ramp:\n";
|
||||
for ($color = 232; $color < 256; $color++) {
|
||||
print "\x1b[48;5;${color}m ";
|
||||
}
|
||||
print "\x1b[0m\n";w
|
||||
|
21
dotfiles/my-binaries/dot-bin/decryptNdump_pass
Executable file
21
dotfiles/my-binaries/dot-bin/decryptNdump_pass
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
## A script to decrypt and dump the passwordstore to
|
||||
## save it to a trusted volume
|
||||
|
||||
prefix=${PASSWORD_STORE_DIR:=~/.password-store}
|
||||
|
||||
## Set the IFS to account for spaces in filenames
|
||||
IFS=$(echo -en "\n\b")
|
||||
|
||||
for file in $(find $prefix -name '*.gpg')
|
||||
do
|
||||
nicename=$(echo $file \
|
||||
| cut --characters ${#prefix}- \
|
||||
| cut --characters 3- \
|
||||
| rev | cut --characters 5- | rev
|
||||
)
|
||||
echo
|
||||
echo "==> "$nicename
|
||||
gpg --quiet --decrypt $file
|
||||
done
|
12
dotfiles/my-binaries/dot-bin/dmenu_dir2menu.sh
Executable file
12
dotfiles/my-binaries/dot-bin/dmenu_dir2menu.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
directory=$1
|
||||
|
||||
## ARG1 needs to be a directory
|
||||
if [ ! -d $directory ]
|
||||
then
|
||||
echo Usage: $0 [Directory with menuitems]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$directory/$(ls --color=never -1 $directory | rofi -dmenu -p "Select screen layout")
|
55
dotfiles/my-binaries/dot-bin/fzpass
Executable file
55
dotfiles/my-binaries/dot-bin/fzpass
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
|
||||
## A wrapper for pass to use fzf to find passwords.
|
||||
|
||||
prefix=${PASSWORD_STORE_DIR:=~/.password-store}
|
||||
|
||||
## Get all the gpg files in all directories and subdirs...
|
||||
## remove the prefix, some 3 extra chars and the .gpg ending
|
||||
password_files=$( find $prefix -name '*.gpg' \
|
||||
| cut --characters ${#prefix}- \
|
||||
| cut --characters 3- \
|
||||
| rev | cut --characters 5- | rev
|
||||
)
|
||||
|
||||
## Some functions to call from inside the fzf menu
|
||||
fzpass_update () {
|
||||
echo "--Pulling..." 2>&1 >/dev/tty
|
||||
pass git pull 2>&1 >/dev/tty
|
||||
echo "--Pushing..." 2>&1 >/dev/tty
|
||||
pass git push 2>&1 >/dev/tty
|
||||
echo "--Any key to continue..." 2>&1 >/dev/tty
|
||||
read
|
||||
}
|
||||
export -f fzpass_update
|
||||
|
||||
|
||||
## Send the filelist to fzf,
|
||||
## disable the fzf mouse to use the primary selection
|
||||
password=$( printf '%s\n' "${password_files[@]}" \
|
||||
| fzf --bind='ctrl-s:toggle-preview' \
|
||||
--bind='ctrl-u:execute(fzpass_update)' \
|
||||
--bind='ctrl-r:execute(pass rm {})' \
|
||||
--bind='ctrl-e:execute(pass edit {} < /dev/tty > /dev/tty)' \
|
||||
--preview='pass show {}' \
|
||||
--preview-window="hidden" \
|
||||
--no-mouse \
|
||||
--header='
|
||||
Ret: Copy pass, show OTP; C-s: Show entry; C-e: Edit entry
|
||||
C-u: Update (pull, push); C-r: Remove'
|
||||
$@ \
|
||||
)
|
||||
|
||||
## Exit if nothing was selected
|
||||
test "_$password" = "_" && exit
|
||||
|
||||
|
||||
## Disable clipman
|
||||
command -v clipctl >/dev/null && clipctl disable
|
||||
|
||||
## Copy pass and show otp, exit silently if anything fails
|
||||
pass show -c "$password"
|
||||
pass otp "$password" 2>/dev/null || exit 0
|
||||
|
||||
## Re-Enable clipman
|
||||
command -v clipctl >/dev/null && clipctl enable
|
BIN
dotfiles/my-binaries/dot-bin/lock-keyring
Executable file
BIN
dotfiles/my-binaries/dot-bin/lock-keyring
Executable file
Binary file not shown.
16
dotfiles/my-binaries/dot-bin/lock-keyring.c
Normal file
16
dotfiles/my-binaries/dot-bin/lock-keyring.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include <stdio.h>
|
||||
#include <gnome-keyring.h>
|
||||
|
||||
// To be compiled with:
|
||||
// cc lock-keyring.c -o lock-keyring -Wall $(pkg-config gnome-keyring-1 --cflags --libs)
|
||||
|
||||
int main() {
|
||||
GnomeKeyringResult lock_result = gnome_keyring_lock_all_sync();
|
||||
if (lock_result == GNOME_KEYRING_RESULT_OK) {
|
||||
printf("Successfully locked\n");
|
||||
return 0;
|
||||
} else {
|
||||
printf("Error locking keyring: %d\n", lock_result);
|
||||
return 1;
|
||||
}
|
||||
}
|
25
dotfiles/my-binaries/dot-bin/reconnectfritzbox.sh
Executable file
25
dotfiles/my-binaries/dot-bin/reconnectfritzbox.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Reconnect a Fritz.Box with activated UPnP
|
||||
|
||||
oldIp=$(curl -s https://v4.ident.me)
|
||||
|
||||
curl "http://fritz.box:49000/igdupnp/control/WANIPConn1" \
|
||||
-H 'Content-Type: text/xml; charset="utf-8"' \
|
||||
-H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination' \
|
||||
-d '<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:Envelope
|
||||
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" >
|
||||
<s:Body>
|
||||
<u:ForceTermination xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" />
|
||||
</s:Body>
|
||||
</s:Envelope>' \
|
||||
-s
|
||||
|
||||
sleep 5
|
||||
|
||||
newIp=$(curl -s https://v4.ident.me)
|
||||
|
||||
|
||||
notify-send "Renew IP" "Old IP: $oldIp\nNew IP: $newIp"
|
19
dotfiles/my-binaries/dot-bin/sanitize_files.sh
Executable file
19
dotfiles/my-binaries/dot-bin/sanitize_files.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#! /bin/bash
|
||||
|
||||
sanitize() {
|
||||
shopt -s extglob;
|
||||
|
||||
filename=$(basename "$1")
|
||||
directory=$(dirname "$1")
|
||||
|
||||
#filename_clean="${filename//+([^[:alnum:]_-\.])/_}"
|
||||
filename_clean=$(echo -n $filename | tr --complement --squeeze-repeats "[:alnum:]./" "_")
|
||||
|
||||
if (test "$filename" != "$filename_clean")
|
||||
then
|
||||
mv -v --backup=numbered "$1" "$directory/$filename_clean"
|
||||
fi
|
||||
}
|
||||
|
||||
export -f sanitize
|
||||
find $1 -depth -exec bash -c 'sanitize "$0"' {} \;
|
16
dotfiles/my-binaries/dot-bin/screenlock.sh
Executable file
16
dotfiles/my-binaries/dot-bin/screenlock.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
## Take a screenshot and create a lockscreen
|
||||
rm -f /tmp/screen_locked.png
|
||||
scrot /tmp/screen_locked.png
|
||||
mogrify -scale 10% -scale 1000% /tmp/screen_locked.png
|
||||
#convert /tmp/screen_locked.png -swirl 360 -paint 1 /tmp/screen_locked.png
|
||||
|
||||
## Lock the gnome-keyring
|
||||
#test -x ~/.bin/lock-keyring && ~/.bin/lock-keyring
|
||||
|
||||
## Lock screen displaying this image.
|
||||
i3lock --show-failed-attempts --image=/tmp/screen_locked.png
|
||||
|
||||
## Turn the screen off after a delay.
|
||||
sleep 300; pgrep i3lock && xset dpms force off
|
22
dotfiles/my-binaries/dot-bin/server.py
Executable file
22
dotfiles/my-binaries/dot-bin/server.py
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import http.server as SimpleHTTPServer
|
||||
import socketserver as SocketServer
|
||||
import logging
|
||||
|
||||
PORT = 8000
|
||||
|
||||
class GetHandler(
|
||||
SimpleHTTPServer.SimpleHTTPRequestHandler
|
||||
):
|
||||
|
||||
def do_GET(self):
|
||||
logging.error(self.headers)
|
||||
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
|
||||
|
||||
|
||||
Handler = GetHandler
|
||||
httpd = SocketServer.TCPServer(("", PORT), Handler)
|
||||
|
||||
httpd.serve_forever()
|
||||
|
15
dotfiles/my-binaries/dot-bin/startAltBrowser.sh
Executable file
15
dotfiles/my-binaries/dot-bin/startAltBrowser.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
###############################################################################
|
||||
##
|
||||
# Starts the correct browser
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
test -x ~/.local/bin/startAltBrowser.sh && (~/.local/bin/startAltBrowser.sh $@) && exit 0
|
||||
test -x /usr/bin/firefox && (/usr/bin/firefox $@ &) && exit 0
|
||||
test -x /usr/bin/chromium && (/usr/bin/chromium --force-dark-mode $@ &) && exit 0
|
||||
|
||||
i3-nagbar -m "None of your favorite browsers were found :-("
|
||||
exit 1
|
18
dotfiles/my-binaries/dot-bin/startAltBrowserPrivat.sh
Executable file
18
dotfiles/my-binaries/dot-bin/startAltBrowserPrivat.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
###############################################################################
|
||||
##
|
||||
# Starts the correct browser in private-mode
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
export MOZ_USE_XINPUT2=1
|
||||
|
||||
|
||||
test -x ~/.local/bin/startAltBrowserPrivat.sh && (~/.local/bin/startAltBrowserPrivat.sh $@) && exit 0
|
||||
test -x /usr/bin/firefox && (/usr/bin/firefox --private-window $@ &) && exit 0
|
||||
test -x /usr/bin/chromium && (/usr/bin/chromium --force-dark-mode --incognito $@ &) && exit 0
|
||||
|
||||
i3-nagbar -m "None of your favorite browsers were found :-("
|
||||
exit 1
|
19
dotfiles/my-binaries/dot-bin/startBrowser.sh
Executable file
19
dotfiles/my-binaries/dot-bin/startBrowser.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
###############################################################################
|
||||
##
|
||||
# Starts the correct browser
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
export MOZ_USE_XINPUT2=1
|
||||
|
||||
|
||||
test -x ~/.local/bin/startBrowser.sh && (~/.local/bin/startBrowser.sh $@) && exit 0
|
||||
test -x /usr/bin/firefox && (/usr/bin/firefox $@ &) && exit 0
|
||||
test -x /usr/bin/chromium && (/usr/bin/chromium --force-dark-mode $@ &) && exit 0
|
||||
|
||||
i3-nagbar -m "None of your favorite browsers were found :-("
|
||||
exit 1
|
15
dotfiles/my-binaries/dot-bin/startBrowserPrivat.sh
Executable file
15
dotfiles/my-binaries/dot-bin/startBrowserPrivat.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
###############################################################################
|
||||
##
|
||||
# Starts the correct browser in private-mode
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
test -x ~/.local/bin/startBrowserPrivat.sh && (~/.local/bin/startBrowserPrivat.sh $@) && exit 0
|
||||
test -x /usr/bin/firefox && (/usr/bin/firefox --private-window $@ &) && exit 0
|
||||
test -x /usr/bin/chromium && (/usr/bin/chromium --force-dark-mode --incognito $@ &) && exit 0
|
||||
|
||||
i3-nagbar -m "None of your favorite browsers were found :-("
|
||||
exit 1
|
32
dotfiles/my-binaries/dot-bin/switchTermColours.sh
Executable file
32
dotfiles/my-binaries/dot-bin/switchTermColours.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
###############################################################################
|
||||
##
|
||||
# Switch alacritty colourscheme
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
theme=$(ls -1 ~/.config/alacritty/color | rofi -dmenu -p "Select alacritty theme")
|
||||
rc=$?
|
||||
|
||||
echo "Selected theme: ~/.config/alacritty/color/$theme"
|
||||
|
||||
## Exit if error in selection (e.g. ESC)
|
||||
if [ $rc -ne 0 ]
|
||||
then
|
||||
echo "Operation canceled."
|
||||
echo ""
|
||||
exit 125
|
||||
fi
|
||||
|
||||
## Exit if selection is no file from the colors directory
|
||||
if [ ! -f ~/.config/alacritty/color/$theme ]
|
||||
then
|
||||
echo "Selected theme not found."
|
||||
echo ""
|
||||
exit 2
|
||||
fi
|
||||
|
||||
#sed -i "{s+.*#MARK-color$+import = [\"color/$theme\"] #MARK-color+}" ~/.config/alacritty/alacritty.toml
|
||||
|
||||
ln -fs ~/.config/alacritty/color/$theme ~/.local/alacritty_colors.toml
|
67
dotfiles/my-binaries/dot-bin/tsaClient.sh
Executable file
67
dotfiles/my-binaries/dot-bin/tsaClient.sh
Executable file
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash
|
||||
#########################################################################
|
||||
## tsaClient.sh
|
||||
#
|
||||
# Clientscript for the FreeTSA Timestamping Service
|
||||
# This script generates a tgz archive containing a given file and the
|
||||
# timestamping information from freetsa.org including tsr, tsq, log and
|
||||
# the ca certificates.
|
||||
#
|
||||
# devops@elfring.ms - 2019-05-29
|
||||
#
|
||||
#
|
||||
|
||||
echo "Clientscript for the FreeTSA Timestamping Service"
|
||||
echo "https://www.freetsa.org"
|
||||
echo
|
||||
|
||||
fileToStamp=$1
|
||||
|
||||
if [ _$# != _1 ]
|
||||
then
|
||||
echo "Usage: $0 [file to timestamp]"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e $fileToStamp ]
|
||||
then
|
||||
echo "$fileToStamp does not exist."
|
||||
echo
|
||||
exit 2
|
||||
fi
|
||||
|
||||
{
|
||||
echo "Timestamping file $fileToStamp"
|
||||
echo
|
||||
|
||||
echo "-------> Create SHA512 checksum (informational)"
|
||||
echo "# sha512sum $fileToStamp"
|
||||
sha512sum $fileToStamp 2>&1 | sed 's/^/ /'
|
||||
echo
|
||||
|
||||
echo "-------> Create and display timestamp query (TSQ)"
|
||||
echo "# openssl ts -query -data $fileToStamp -no_nonce -sha512 -cert -out $fileToStamp.tsq"
|
||||
echo "# openssl ts -query -in $fileToStamp.tsq -text"
|
||||
openssl ts -query -data $fileToStamp -no_nonce -sha512 -cert -out $fileToStamp.tsq 2>&1 | sed 's/^/ /'
|
||||
openssl ts -query -in $fileToStamp.tsq -text 2>&1 | sed 's/^/ /'
|
||||
echo
|
||||
|
||||
echo "-------> Have the TSQ signed and display the reply (TSR)"
|
||||
echo "# curl --silent --header "Content-Type: application/timestamp-query" --data-binary "@$fileToStamp.tsq" https://freetsa.org/tsr --output $fileToStamp.tsr"
|
||||
echo "# openssl ts -reply -in $fileToStamp.tsq -text"
|
||||
curl --silent --header "Content-Type: application/timestamp-query" --data-binary "@$fileToStamp.tsq" https://freetsa.org/tsr --output $fileToStamp.tsr 2>&1 | sed 's/^/ /'
|
||||
openssl ts -reply -in $fileToStamp.tsr -text 2>&1 | sed 's/^/ /'
|
||||
echo
|
||||
|
||||
echo "-------> Verify TSR (informational)"
|
||||
echo "# curl --silent --output freetsa_cacert.pem https://freetsa.org/files/cacert.pem"
|
||||
echo "# openssl ts -verify -data $fileToStamp -in $fileToStamp.tsr -CAfile freetsa_cacert.pem"
|
||||
curl --silent --output freetsa_cacert.pem https://freetsa.org/files/cacert.pem 2>&1 | sed 's/^/ /'
|
||||
openssl ts -verify -data $fileToStamp -in $fileToStamp.tsr -CAfile freetsa_cacert.pem 2>&1 | sed 's/^/ /'
|
||||
|
||||
} | tee $fileToStamp.log
|
||||
|
||||
tar czf $fileToStamp.tsa.tgz $fileToStamp.tsq $fileToStamp.tsr $fileToStamp.log freetsa_cacert.pem $fileToStamp
|
||||
rm $fileToStamp.tsq $fileToStamp.tsr $fileToStamp.log freetsa_cacert.pem
|
||||
echo
|
17
dotfiles/my-binaries/dot-bin/wdavmaild
Executable file
17
dotfiles/my-binaries/dot-bin/wdavmaild
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
############################################################################
|
||||
##
|
||||
# wddavmaild
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
## Check for a tmux session with docker fo:wqr root is already running
|
||||
if tmux has-session -t wdavmaild
|
||||
then
|
||||
echo "A wdavmaild session is already running. Attaching."
|
||||
tmux attach -t wdavmaild
|
||||
else
|
||||
echo "Starting a new wdavmaild tmux-session."
|
||||
tmux new-session -d -s wdavmaild davmail ~/.local/etc/davmail.conf
|
||||
fi
|
26
dotfiles/my-binaries/dot-bin/wdockerd
Executable file
26
dotfiles/my-binaries/dot-bin/wdockerd
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
############################################################################
|
||||
##
|
||||
# wdockerd
|
||||
# Start dockerd inside a tmux session for use in WSL
|
||||
#
|
||||
#
|
||||
|
||||
## Ask for sudo credentials
|
||||
sudo --validate
|
||||
|
||||
if ! $(sudo --non-interactive /bin/true)
|
||||
then
|
||||
echo "We cannot become root with sudo. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Check for a tmux session with docker fo:wqr root is already running
|
||||
if $(sudo --non-interactive bash -c 'tmux has-session -t wdockerd')
|
||||
then
|
||||
echo "A wdockerd session is already running. Attaching."
|
||||
sudo --non-interactive tmux attach -t wdockerd
|
||||
else
|
||||
echo "Starting a new dockerd tmux-session."
|
||||
sudo --non-interactive tmux new-session -d -s wdockerd dockerd
|
||||
fi
|
10
dotfiles/my-binaries/dot-bin/xcqr
Executable file
10
dotfiles/my-binaries/dot-bin/xcqr
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
# Credit to Maddison Hellstrom (@b0o on Github)
|
||||
text=$(xclip -out -selection clipboard)
|
||||
notify-send --expire-time 3000 "Clipboard" "$text"
|
||||
qrencode --output - --size 1 "$text" \
|
||||
| feh --zoom max \
|
||||
--fullscreen \
|
||||
--force-aliasing \
|
||||
--image-bg white \
|
||||
-
|
57
dotfiles/pikaur/dot-config/pikaur.conf
Normal file
57
dotfiles/pikaur/dot-config/pikaur.conf
Normal file
|
@ -0,0 +1,57 @@
|
|||
[sync]
|
||||
alwaysshowpkgorigin = no
|
||||
develpkgsexpiration = 301
|
||||
upgradesorting = versiondiff
|
||||
showdownloadsize = yes
|
||||
ignoreoutofdateaurupgrades = no
|
||||
|
||||
[build]
|
||||
keepbuilddir = no
|
||||
keepdevbuilddir = yes
|
||||
skipfailedbuild = no
|
||||
keepbuilddeps = no
|
||||
ignorearch = no
|
||||
gpgdir =
|
||||
dynamicusers = root
|
||||
|
||||
[colors]
|
||||
version = 10
|
||||
versiondiffold = 11
|
||||
versiondiffnew = 9
|
||||
|
||||
[ui]
|
||||
requireenterconfirm = no
|
||||
printcommands = no
|
||||
aursearchsorting = hottest
|
||||
displaylastupdated = yes
|
||||
groupbyrepository = yes
|
||||
reversesearchsorting = no
|
||||
warnaboutpackageupdates =
|
||||
warnaboutnondefaultprivilegeescalationtool = yes
|
||||
|
||||
[misc]
|
||||
sudoloopinterval = 1
|
||||
pacmanpath = pacman
|
||||
debug = no
|
||||
privilegeescalationtool = sudo
|
||||
privilegeescalationtarget = pikaur
|
||||
userid = 0
|
||||
preserveenv = PKGDEST,VISUAL,EDITOR,http_proxy,https_proxy,ftp_proxy,HTTP_PROXY,HTTPS_PROXY,FTP_PROXY,ALL_PROXY
|
||||
cachepath = /home/je/.cache
|
||||
datapath = /home/je/.local/share
|
||||
|
||||
[review]
|
||||
noedit = yes
|
||||
donteditbydefault = yes
|
||||
nodiff = yes
|
||||
gitdiffargs = --ignore-space-change,--ignore-all-space
|
||||
diffpager = auto
|
||||
hidedifffiles = .SRCINFO
|
||||
|
||||
[network]
|
||||
aururl = https://aur.archlinux.org
|
||||
newsurl = https://archlinux.org/feeds/news/
|
||||
socks5proxy =
|
||||
aurhttpproxy =
|
||||
aurhttpsproxy =
|
||||
|
62
dotfiles/ranger/dot-config/commands.py
Normal file
62
dotfiles/ranger/dot-config/commands.py
Normal file
|
@ -0,0 +1,62 @@
|
|||
# This is a sample commands.py. You can add your own commands here.
|
||||
#
|
||||
# Please refer to commands_full.py for all the default commands and a complete
|
||||
# documentation. Do NOT add them all here, or you may end up with defunct
|
||||
# commands when upgrading ranger.
|
||||
|
||||
# A simple command for demonstration purposes follows.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
# You can import any python module as needed.
|
||||
import os
|
||||
|
||||
# You always need to import ranger.api.commands here to get the Command class:
|
||||
from ranger.api.commands import Command
|
||||
|
||||
|
||||
# Any class that is a subclass of "Command" will be integrated into ranger as a
|
||||
# command. Try typing ":my_edit<ENTER>" in ranger!
|
||||
class my_edit(Command):
|
||||
# The so-called doc-string of the class will be visible in the built-in
|
||||
# help that is accessible by typing "?c" inside ranger.
|
||||
""":my_edit <filename>
|
||||
|
||||
A sample command for demonstration purposes that opens a file in an editor.
|
||||
"""
|
||||
|
||||
# The execute method is called when you run this command in ranger.
|
||||
def execute(self):
|
||||
# self.arg(1) is the first (space-separated) argument to the function.
|
||||
# This way you can write ":my_edit somefilename<ENTER>".
|
||||
if self.arg(1):
|
||||
# self.rest(1) contains self.arg(1) and everything that follows
|
||||
target_filename = self.rest(1)
|
||||
else:
|
||||
# self.fm is a ranger.core.filemanager.FileManager object and gives
|
||||
# you access to internals of ranger.
|
||||
# self.fm.thisfile is a ranger.container.file.File object and is a
|
||||
# reference to the currently selected file.
|
||||
target_filename = self.fm.thisfile.path
|
||||
|
||||
# This is a generic function to print text in ranger.
|
||||
self.fm.notify("Let's edit the file " + target_filename + "!")
|
||||
|
||||
# Using bad=True in fm.notify allows you to print error messages:
|
||||
if not os.path.exists(target_filename):
|
||||
self.fm.notify("The given file does not exist!", bad=True)
|
||||
return
|
||||
|
||||
# This executes a function from ranger.core.acitons, a module with a
|
||||
# variety of subroutines that can help you construct commands.
|
||||
# Check out the source, or run "pydoc ranger.core.actions" for a list.
|
||||
self.fm.edit_file(target_filename)
|
||||
|
||||
# The tab method is called when you press tab, and should return a list of
|
||||
# suggestions that the user will tab through.
|
||||
# tabnum is 1 for <TAB> and -1 for <S-TAB> by default
|
||||
def tab(self, tabnum):
|
||||
# This is a generic tab-completion function that iterates through the
|
||||
# content of the current directory.
|
||||
return self._tab_directory_content()
|
1769
dotfiles/ranger/dot-config/commands_full.py
Normal file
1769
dotfiles/ranger/dot-config/commands_full.py
Normal file
File diff suppressed because it is too large
Load diff
656
dotfiles/ranger/dot-config/rc.conf
Normal file
656
dotfiles/ranger/dot-config/rc.conf
Normal file
|
@ -0,0 +1,656 @@
|
|||
# ===================================================================
|
||||
# This file contains the default startup commands for ranger.
|
||||
# To change them, it is recommended to create the file
|
||||
# ~/.config/ranger/rc.conf and add your custom commands there.
|
||||
#
|
||||
# If you copy this whole file there, you may want to set the environment
|
||||
# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
|
||||
#
|
||||
# The purpose of this file is mainly to define keybindings and settings.
|
||||
# For running more complex python code, please create a plugin in "plugins/" or
|
||||
# a command in "commands.py".
|
||||
#
|
||||
# Each line is a command that will be run before the user interface
|
||||
# is initialized. As a result, you can not use commands which rely
|
||||
# on the UI such as :delete or :mark.
|
||||
# ===================================================================
|
||||
|
||||
# ===================================================================
|
||||
# == Options
|
||||
# ===================================================================
|
||||
|
||||
# Which viewmode should be used? Possible values are:
|
||||
# miller: Use miller columns which show multiple levels of the hierarchy
|
||||
# multipane: Midnight-commander like multipane view showing all tabs next
|
||||
# to each other
|
||||
set viewmode miller
|
||||
#set viewmode multipane
|
||||
|
||||
# How many columns are there, and what are their relative widths?
|
||||
set column_ratios 1,3,4
|
||||
|
||||
# Which files should be hidden? (regular expression)
|
||||
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
|
||||
|
||||
# Show hidden files? You can toggle this by typing 'zh'
|
||||
set show_hidden false
|
||||
|
||||
# Ask for a confirmation when running the "delete" command?
|
||||
# Valid values are "always", "never", "multiple" (default)
|
||||
# With "multiple", ranger will ask only if you delete multiple files at once.
|
||||
set confirm_on_delete multiple
|
||||
|
||||
# Use non-default path for file preview script?
|
||||
# ranger ships with scope.sh, a script that calls external programs (see
|
||||
# README.md for dependencies) to preview images, archives, etc.
|
||||
set preview_script ~/.config/ranger/scope.sh
|
||||
|
||||
# Use the external preview script or display simple plain text or image previews?
|
||||
set use_preview_script true
|
||||
|
||||
# Automatically count files in the directory, even before entering them?
|
||||
set automatically_count_files true
|
||||
|
||||
# Open all images in this directory when running certain image viewers
|
||||
# like feh or sxiv? You can still open selected files by marking them.
|
||||
set open_all_images true
|
||||
|
||||
# Be aware of version control systems and display information.
|
||||
set vcs_aware false
|
||||
|
||||
# State of the four backends git, hg, bzr, svn. The possible states are
|
||||
# disabled, local (only show local info), enabled (show local and remote
|
||||
# information).
|
||||
set vcs_backend_git enabled
|
||||
set vcs_backend_hg disabled
|
||||
set vcs_backend_bzr disabled
|
||||
set vcs_backend_svn disabled
|
||||
|
||||
# Use one of the supported image preview protocols
|
||||
set preview_images true
|
||||
|
||||
# Set the preview image method. Supported methods:
|
||||
#
|
||||
# * w3m (default):
|
||||
# Preview images in full color with the external command "w3mimgpreview"?
|
||||
# This requires the console web browser "w3m" and a supported terminal.
|
||||
# It has been successfully tested with "xterm" and "urxvt" without tmux.
|
||||
#
|
||||
# * iterm2:
|
||||
# Preview images in full color using iTerm2 image previews
|
||||
# (http://iterm2.com/images.html). This requires using iTerm2 compiled
|
||||
# with image preview support.
|
||||
#
|
||||
# This feature relies on the dimensions of the terminal's font. By default, a
|
||||
# width of 8 and height of 11 are used. To use other values, set the options
|
||||
# iterm2_font_width and iterm2_font_height to the desired values.
|
||||
#
|
||||
# * urxvt:
|
||||
# Preview images in full color using urxvt image backgrounds. This
|
||||
# requires using urxvt compiled with pixbuf support.
|
||||
#
|
||||
# * urxvt-full:
|
||||
# The same as urxvt but utilizing not only the preview pane but the
|
||||
# whole terminal window.
|
||||
set preview_images_method w3m
|
||||
|
||||
# Default iTerm2 font size (see: preview_images_method: iterm2)
|
||||
set iterm2_font_width 8
|
||||
set iterm2_font_height 11
|
||||
|
||||
# Use a unicode "..." character to mark cut-off filenames?
|
||||
set unicode_ellipsis false
|
||||
|
||||
# Show dotfiles in the bookmark preview box?
|
||||
set show_hidden_bookmarks true
|
||||
|
||||
# Which colorscheme to use? These colorschemes are available by default:
|
||||
# default, jungle, snow, solarized
|
||||
set colorscheme solarized
|
||||
|
||||
# Preview files on the rightmost column?
|
||||
# And collapse (shrink) the last column if there is nothing to preview?
|
||||
set preview_files true
|
||||
set preview_directories true
|
||||
set collapse_preview true
|
||||
|
||||
# Save the console history on exit?
|
||||
set save_console_history true
|
||||
|
||||
# Draw the status bar on top of the browser window (default: bottom)
|
||||
set status_bar_on_top false
|
||||
|
||||
# Draw a progress bar in the status bar which displays the average state of all
|
||||
# currently running tasks which support progress bars?
|
||||
set draw_progress_bar_in_status_bar true
|
||||
|
||||
# Draw borders around columns?
|
||||
set draw_borders true
|
||||
|
||||
# Display the directory name in tabs?
|
||||
set dirname_in_tabs false
|
||||
|
||||
# Enable the mouse support?
|
||||
set mouse_enabled true
|
||||
|
||||
# Display the file size in the main column or status bar?
|
||||
set display_size_in_main_column true
|
||||
set display_size_in_status_bar true
|
||||
|
||||
# Display files tags in all columns or only in main column?
|
||||
set display_tags_in_all_columns true
|
||||
|
||||
# Set a title for the window?
|
||||
set update_title false
|
||||
|
||||
# Set the title to "ranger" in the tmux program?
|
||||
set update_tmux_title false
|
||||
|
||||
# Shorten the title if it gets long? The number defines how many
|
||||
# directories are displayed at once, 0 turns off this feature.
|
||||
set shorten_title 3
|
||||
|
||||
# Show hostname in titlebar?
|
||||
set hostname_in_titlebar true
|
||||
|
||||
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
|
||||
set tilde_in_titlebar false
|
||||
|
||||
# How many directory-changes or console-commands should be kept in history?
|
||||
set max_history_size 20
|
||||
set max_console_history_size 50
|
||||
|
||||
# Try to keep so much space between the top/bottom border when scrolling:
|
||||
set scroll_offset 8
|
||||
|
||||
# Flush the input after each key hit? (Noticeable when ranger lags)
|
||||
set flushinput true
|
||||
|
||||
# Padding on the right when there's no preview?
|
||||
# This allows you to click into the space to run the file.
|
||||
set padding_right true
|
||||
|
||||
# Save bookmarks (used with mX and `X) instantly?
|
||||
# This helps to synchronize bookmarks between multiple ranger
|
||||
# instances but leads to *slight* performance loss.
|
||||
# When false, bookmarks are saved when ranger is exited.
|
||||
set autosave_bookmarks true
|
||||
|
||||
# Save the "`" bookmark to disk. This can be used to switch to the last
|
||||
# directory by typing "``".
|
||||
set save_backtick_bookmark true
|
||||
|
||||
# You can display the "real" cumulative size of directories by using the
|
||||
# command :get_cumulative_size or typing "dc". The size is expensive to
|
||||
# calculate and will not be updated automatically. You can choose
|
||||
# to update it automatically though by turning on this option:
|
||||
set autoupdate_cumulative_size false
|
||||
|
||||
# Turning this on makes sense for screen readers:
|
||||
set show_cursor false
|
||||
|
||||
# One of: size, natural, basename, atime, ctime, mtime, type, random
|
||||
set sort natural
|
||||
|
||||
# Additional sorting options
|
||||
set sort_reverse false
|
||||
set sort_case_insensitive true
|
||||
set sort_directories_first true
|
||||
set sort_unicode false
|
||||
|
||||
# Enable this if key combinations with the Alt Key don't work for you.
|
||||
# (Especially on xterm)
|
||||
set xterm_alt_key false
|
||||
|
||||
# Whether to include bookmarks in cd command
|
||||
set cd_bookmarks true
|
||||
|
||||
# Changes case sensitivity for the cd command tab completion
|
||||
set cd_tab_case sensitive
|
||||
|
||||
# Use fuzzy tab completion with the "cd" command. For example,
|
||||
# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
|
||||
set cd_tab_fuzzy false
|
||||
|
||||
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
|
||||
# disable this feature.
|
||||
set preview_max_size 0
|
||||
|
||||
# Add the highlighted file to the path in the titlebar
|
||||
set show_selection_in_titlebar true
|
||||
|
||||
# The delay that ranger idly waits for user input, in milliseconds, with a
|
||||
# resolution of 100ms. Lower delay reduces lag between directory updates but
|
||||
# increases CPU load.
|
||||
set idle_delay 2000
|
||||
|
||||
# When the metadata manager module looks for metadata, should it only look for
|
||||
# a ".metadata.json" file in the current directory, or do a deep search and
|
||||
# check all directories above the current one as well?
|
||||
set metadata_deep_search false
|
||||
|
||||
# Clear all existing filters when leaving a directory
|
||||
set clear_filters_on_dir_change false
|
||||
|
||||
# Disable displaying line numbers in main column
|
||||
set line_numbers false
|
||||
|
||||
# Start line numbers from 1 instead of 0
|
||||
set one_indexed false
|
||||
|
||||
# Save tabs on exit
|
||||
set save_tabs_on_exit false
|
||||
|
||||
# Enable scroll wrapping - moving down while on the last item will wrap around to
|
||||
# the top and vice versa.
|
||||
set wrap_scroll false
|
||||
|
||||
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
|
||||
# directories, files and symlinks respectively.
|
||||
set global_inode_type_filter
|
||||
|
||||
# ===================================================================
|
||||
# == Local Options
|
||||
# ===================================================================
|
||||
# You can set local options that only affect a single directory.
|
||||
|
||||
# Examples:
|
||||
# setlocal path=~/downloads sort mtime
|
||||
|
||||
# ===================================================================
|
||||
# == Command Aliases in the Console
|
||||
# ===================================================================
|
||||
|
||||
alias e edit
|
||||
alias q quit
|
||||
alias q! quit!
|
||||
alias qa quitall
|
||||
alias qa! quitall!
|
||||
alias qall quitall
|
||||
alias qall! quitall!
|
||||
alias setl setlocal
|
||||
|
||||
alias filter scout -prt
|
||||
alias find scout -aeit
|
||||
alias mark scout -mr
|
||||
alias unmark scout -Mr
|
||||
alias search scout -rs
|
||||
alias search_inc scout -rts
|
||||
alias travel scout -aefklst
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the browser
|
||||
# ===================================================================
|
||||
|
||||
# Basic
|
||||
map Q quitall
|
||||
map q quit
|
||||
copymap q ZZ ZQ
|
||||
|
||||
map R reload_cwd
|
||||
map F set freeze_files!
|
||||
map <C-r> reset
|
||||
map <C-l> redraw_window
|
||||
map <C-c> abort
|
||||
map <esc> change_mode normal
|
||||
map ~ set viewmode!
|
||||
|
||||
map i display_file
|
||||
map ? help
|
||||
map W display_log
|
||||
map w taskview_open
|
||||
map S shell $SHELL
|
||||
|
||||
map : console
|
||||
map ; console
|
||||
map ! console shell%space
|
||||
map @ console -p6 shell %%s
|
||||
map # console shell -p%space
|
||||
map s console shell%space
|
||||
map r chain draw_possible_programs; console open_with%%space
|
||||
map f console find%space
|
||||
map cd console cd%space
|
||||
|
||||
# Change the line mode
|
||||
map Mf linemode filename
|
||||
map Mi linemode fileinfo
|
||||
map Mm linemode mtime
|
||||
map Mp linemode permissions
|
||||
map Ms linemode sizemtime
|
||||
map Mt linemode metatitle
|
||||
|
||||
# Tagging / Marking
|
||||
map t tag_toggle
|
||||
map ut tag_remove
|
||||
map "<any> tag_toggle tag=%any
|
||||
map <Space> mark_files toggle=True
|
||||
map v mark_files all=True toggle=True
|
||||
map uv mark_files all=True val=False
|
||||
map V toggle_visual_mode
|
||||
map uV toggle_visual_mode reverse=True
|
||||
|
||||
# For the nostalgics: Midnight Commander bindings
|
||||
map <F1> help
|
||||
map <F2> rename_append
|
||||
map <F3> display_file
|
||||
map <F4> edit
|
||||
map <F5> copy
|
||||
map <F6> cut
|
||||
map <F7> console mkdir%space
|
||||
map <F8> console delete
|
||||
map <F10> exit
|
||||
|
||||
# In case you work on a keyboard with dvorak layout
|
||||
map <UP> move up=1
|
||||
map <DOWN> move down=1
|
||||
map <LEFT> move left=1
|
||||
map <RIGHT> move right=1
|
||||
map <HOME> move to=0
|
||||
map <END> move to=-1
|
||||
map <PAGEDOWN> move down=1 pages=True
|
||||
map <PAGEUP> move up=1 pages=True
|
||||
map <CR> move right=1
|
||||
#map <DELETE> console delete
|
||||
map <INSERT> console touch%space
|
||||
|
||||
# VIM-like
|
||||
copymap <UP> k
|
||||
copymap <DOWN> j
|
||||
copymap <LEFT> h
|
||||
copymap <RIGHT> l
|
||||
copymap <HOME> gg
|
||||
copymap <END> G
|
||||
copymap <PAGEDOWN> <C-F>
|
||||
copymap <PAGEUP> <C-B>
|
||||
|
||||
map J move down=0.5 pages=True
|
||||
map K move up=0.5 pages=True
|
||||
copymap J <C-D>
|
||||
copymap K <C-U>
|
||||
|
||||
# Jumping around
|
||||
map H history_go -1
|
||||
map L history_go 1
|
||||
map ] move_parent 1
|
||||
map [ move_parent -1
|
||||
map } traverse
|
||||
map ) jump_non
|
||||
|
||||
map gh cd ~
|
||||
map ge cd /etc
|
||||
map gu cd /usr
|
||||
map gd cd /dev
|
||||
map gl cd -r .
|
||||
map gL cd -r %f
|
||||
map go cd /opt
|
||||
map gv cd /var
|
||||
map gm cd /media
|
||||
map gM cd /mnt
|
||||
map gs cd /srv
|
||||
map gp cd /tmp
|
||||
map gr cd /
|
||||
map gR eval fm.cd(ranger.RANGERDIR)
|
||||
map g/ cd /
|
||||
map g? cd /usr/share/doc/ranger
|
||||
|
||||
# External Programs
|
||||
map E edit
|
||||
map du shell -p du --max-depth=1 -h --apparent-size
|
||||
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
|
||||
map yp yank path
|
||||
map yd yank dir
|
||||
map yn yank name
|
||||
|
||||
# Filesystem Operations
|
||||
map = chmod
|
||||
|
||||
map cw console rename%space
|
||||
map a rename_append
|
||||
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
|
||||
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
|
||||
|
||||
map pp paste
|
||||
map po paste overwrite=True
|
||||
map pP paste append=True
|
||||
map pO paste overwrite=True append=True
|
||||
map pl paste_symlink relative=False
|
||||
map pL paste_symlink relative=True
|
||||
map phl paste_hardlink
|
||||
map pht paste_hardlinked_subtree
|
||||
|
||||
map dD console delete
|
||||
|
||||
map dd cut
|
||||
map ud uncut
|
||||
map da cut mode=add
|
||||
map dr cut mode=remove
|
||||
map dt cut mode=toggle
|
||||
|
||||
map yy copy
|
||||
map uy uncut
|
||||
map ya copy mode=add
|
||||
map yr copy mode=remove
|
||||
map yt copy mode=toggle
|
||||
|
||||
# Temporary workarounds
|
||||
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
|
||||
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
|
||||
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
|
||||
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
|
||||
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
|
||||
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
|
||||
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
|
||||
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
|
||||
|
||||
# Searching
|
||||
map / console search%space
|
||||
map n search_next
|
||||
map N search_next forward=False
|
||||
map ct search_next order=tag
|
||||
map cs search_next order=size
|
||||
map ci search_next order=mimetype
|
||||
map cc search_next order=ctime
|
||||
map cm search_next order=mtime
|
||||
map ca search_next order=atime
|
||||
|
||||
# Tabs
|
||||
map <C-n> tab_new
|
||||
map <C-w> tab_close
|
||||
map <TAB> tab_move 1
|
||||
map <S-TAB> tab_move -1
|
||||
map <A-Right> tab_move 1
|
||||
map <A-Left> tab_move -1
|
||||
map gt tab_move 1
|
||||
map gT tab_move -1
|
||||
map gn tab_new
|
||||
map gc tab_close
|
||||
map uq tab_restore
|
||||
map <a-1> tab_open 1
|
||||
map <a-2> tab_open 2
|
||||
map <a-3> tab_open 3
|
||||
map <a-4> tab_open 4
|
||||
map <a-5> tab_open 5
|
||||
map <a-6> tab_open 6
|
||||
map <a-7> tab_open 7
|
||||
map <a-8> tab_open 8
|
||||
map <a-9> tab_open 9
|
||||
|
||||
# Sorting
|
||||
map or set sort_reverse!
|
||||
map oz set sort=random
|
||||
map os chain set sort=size; set sort_reverse=False
|
||||
map ob chain set sort=basename; set sort_reverse=False
|
||||
map on chain set sort=natural; set sort_reverse=False
|
||||
map om chain set sort=mtime; set sort_reverse=False
|
||||
map oc chain set sort=ctime; set sort_reverse=False
|
||||
map oa chain set sort=atime; set sort_reverse=False
|
||||
map ot chain set sort=type; set sort_reverse=False
|
||||
map oe chain set sort=extension; set sort_reverse=False
|
||||
|
||||
map oS chain set sort=size; set sort_reverse=True
|
||||
map oB chain set sort=basename; set sort_reverse=True
|
||||
map oN chain set sort=natural; set sort_reverse=True
|
||||
map oM chain set sort=mtime; set sort_reverse=True
|
||||
map oC chain set sort=ctime; set sort_reverse=True
|
||||
map oA chain set sort=atime; set sort_reverse=True
|
||||
map oT chain set sort=type; set sort_reverse=True
|
||||
map oE chain set sort=extension; set sort_reverse=True
|
||||
|
||||
map dc get_cumulative_size
|
||||
|
||||
# Settings
|
||||
map zc set collapse_preview!
|
||||
map zd set sort_directories_first!
|
||||
map zh set show_hidden!
|
||||
map <C-h> set show_hidden!
|
||||
map zI set flushinput!
|
||||
map zi set preview_images!
|
||||
map zm set mouse_enabled!
|
||||
map zp set preview_files!
|
||||
map zP set preview_directories!
|
||||
map zs set sort_case_insensitive!
|
||||
map zu set autoupdate_cumulative_size!
|
||||
map zv set use_preview_script!
|
||||
map zf console filter%space
|
||||
copymap zf zz
|
||||
|
||||
# Bookmarks
|
||||
map `<any> enter_bookmark %any
|
||||
map '<any> enter_bookmark %any
|
||||
map m<any> set_bookmark %any
|
||||
map um<any> unset_bookmark %any
|
||||
|
||||
map m<bg> draw_bookmarks
|
||||
copymap m<bg> um<bg> `<bg> '<bg>
|
||||
|
||||
# Generate all the chmod bindings with some python help:
|
||||
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
|
||||
|
||||
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the console
|
||||
# ===================================================================
|
||||
# Note: Unmapped keys are passed directly to the console.
|
||||
|
||||
# Basic
|
||||
cmap <tab> eval fm.ui.console.tab()
|
||||
cmap <s-tab> eval fm.ui.console.tab(-1)
|
||||
cmap <ESC> eval fm.ui.console.close()
|
||||
cmap <CR> eval fm.ui.console.execute()
|
||||
cmap <C-l> redraw_window
|
||||
|
||||
copycmap <ESC> <C-c>
|
||||
copycmap <CR> <C-j>
|
||||
|
||||
# Move around
|
||||
cmap <up> eval fm.ui.console.history_move(-1)
|
||||
cmap <down> eval fm.ui.console.history_move(1)
|
||||
cmap <left> eval fm.ui.console.move(left=1)
|
||||
cmap <right> eval fm.ui.console.move(right=1)
|
||||
cmap <home> eval fm.ui.console.move(right=0, absolute=True)
|
||||
cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
|
||||
cmap <a-left> eval fm.ui.console.move_word(left=1)
|
||||
cmap <a-right> eval fm.ui.console.move_word(right=1)
|
||||
|
||||
# Line Editing
|
||||
cmap <backspace> eval fm.ui.console.delete(-1)
|
||||
cmap <delete> eval fm.ui.console.delete(0)
|
||||
cmap <C-w> eval fm.ui.console.delete_word()
|
||||
cmap <A-d> eval fm.ui.console.delete_word(backward=False)
|
||||
cmap <C-k> eval fm.ui.console.delete_rest(1)
|
||||
cmap <C-u> eval fm.ui.console.delete_rest(-1)
|
||||
cmap <C-y> eval fm.ui.console.paste()
|
||||
|
||||
# And of course the emacs way
|
||||
copycmap <up> <C-p>
|
||||
copycmap <down> <C-n>
|
||||
copycmap <left> <C-b>
|
||||
copycmap <right> <C-f>
|
||||
copycmap <home> <C-a>
|
||||
copycmap <end> <C-e>
|
||||
copycmap <delete> <C-d>
|
||||
copycmap <backspace> <C-h>
|
||||
|
||||
# Note: There are multiple ways to express backspaces. <backspace> (code 263)
|
||||
# and <backspace2> (code 127). To be sure, use both.
|
||||
copycmap <backspace> <backspace2>
|
||||
|
||||
# This special expression allows typing in numerals:
|
||||
cmap <allow_quantifiers> false
|
||||
|
||||
# ===================================================================
|
||||
# == Pager Keybindings
|
||||
# ===================================================================
|
||||
|
||||
# Movement
|
||||
pmap <down> pager_move down=1
|
||||
pmap <up> pager_move up=1
|
||||
pmap <left> pager_move left=4
|
||||
pmap <right> pager_move right=4
|
||||
pmap <home> pager_move to=0
|
||||
pmap <end> pager_move to=-1
|
||||
pmap <pagedown> pager_move down=1.0 pages=True
|
||||
pmap <pageup> pager_move up=1.0 pages=True
|
||||
pmap <C-d> pager_move down=0.5 pages=True
|
||||
pmap <C-u> pager_move up=0.5 pages=True
|
||||
|
||||
copypmap <UP> k <C-p>
|
||||
copypmap <DOWN> j <C-n> <CR>
|
||||
copypmap <LEFT> h
|
||||
copypmap <RIGHT> l
|
||||
copypmap <HOME> g
|
||||
copypmap <END> G
|
||||
copypmap <C-d> d
|
||||
copypmap <C-u> u
|
||||
copypmap <PAGEDOWN> n f <C-F> <Space>
|
||||
copypmap <PAGEUP> p b <C-B>
|
||||
|
||||
# Basic
|
||||
pmap <C-l> redraw_window
|
||||
pmap <ESC> pager_close
|
||||
copypmap <ESC> q Q i <F3>
|
||||
pmap E edit_file
|
||||
|
||||
# ===================================================================
|
||||
# == Taskview Keybindings
|
||||
# ===================================================================
|
||||
|
||||
# Movement
|
||||
tmap <up> taskview_move up=1
|
||||
tmap <down> taskview_move down=1
|
||||
tmap <home> taskview_move to=0
|
||||
tmap <end> taskview_move to=-1
|
||||
tmap <pagedown> taskview_move down=1.0 pages=True
|
||||
tmap <pageup> taskview_move up=1.0 pages=True
|
||||
tmap <C-d> taskview_move down=0.5 pages=True
|
||||
tmap <C-u> taskview_move up=0.5 pages=True
|
||||
|
||||
copytmap <UP> k <C-p>
|
||||
copytmap <DOWN> j <C-n> <CR>
|
||||
copytmap <HOME> g
|
||||
copytmap <END> G
|
||||
copytmap <C-u> u
|
||||
copytmap <PAGEDOWN> n f <C-F> <Space>
|
||||
copytmap <PAGEUP> p b <C-B>
|
||||
|
||||
# Changing priority and deleting tasks
|
||||
tmap J eval -q fm.ui.taskview.task_move(-1)
|
||||
tmap K eval -q fm.ui.taskview.task_move(0)
|
||||
tmap dd eval -q fm.ui.taskview.task_remove()
|
||||
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
|
||||
tmap <pageup> eval -q fm.ui.taskview.task_move(0)
|
||||
tmap <delete> eval -q fm.ui.taskview.task_remove()
|
||||
|
||||
# Basic
|
||||
tmap <C-l> redraw_window
|
||||
tmap <ESC> taskview_close
|
||||
copytmap <ESC> q Q w <C-c>
|
226
dotfiles/ranger/dot-config/rifle.conf
Normal file
226
dotfiles/ranger/dot-config/rifle.conf
Normal file
|
@ -0,0 +1,226 @@
|
|||
# vim: ft=cfg
|
||||
#
|
||||
# This is the configuration file of "rifle", ranger's file executor/opener.
|
||||
# Each line consists of conditions and a command. For each line the conditions
|
||||
# are checked and if they are met, the respective command is run.
|
||||
#
|
||||
# Syntax:
|
||||
# <condition1> , <condition2> , ... = command
|
||||
#
|
||||
# The command can contain these environment variables:
|
||||
# $1-$9 | The n-th selected file
|
||||
# $@ | All selected files
|
||||
#
|
||||
# If you use the special command "ask", rifle will ask you what program to run.
|
||||
#
|
||||
# Prefixing a condition with "!" will negate its result.
|
||||
# These conditions are currently supported:
|
||||
# match <regexp> | The regexp matches $1
|
||||
# ext <regexp> | The regexp matches the extension of $1
|
||||
# mime <regexp> | The regexp matches the mime type of $1
|
||||
# name <regexp> | The regexp matches the basename of $1
|
||||
# path <regexp> | The regexp matches the absolute path of $1
|
||||
# has <program> | The program is installed (i.e. located in $PATH)
|
||||
# env <variable> | The environment variable "variable" is non-empty
|
||||
# file | $1 is a file
|
||||
# directory | $1 is a directory
|
||||
# number <n> | change the number of this command to n
|
||||
# terminal | stdin, stderr and stdout are connected to a terminal
|
||||
# X | $DISPLAY is not empty (i.e. Xorg runs)
|
||||
#
|
||||
# There are also pseudo-conditions which have a "side effect":
|
||||
# flag <flags> | Change how the program is run. See below.
|
||||
# label <label> | Assign a label or name to the command so it can
|
||||
# | be started with :open_with <label> in ranger
|
||||
# | or `rifle -p <label>` in the standalone executable.
|
||||
# else | Always true.
|
||||
#
|
||||
# Flags are single characters which slightly transform the command:
|
||||
# f | Fork the program, make it run in the background.
|
||||
# | New command = setsid $command >& /dev/null &
|
||||
# r | Execute the command with root permissions
|
||||
# | New command = sudo $command
|
||||
# t | Run the program in a new terminal. If $TERMCMD is not defined,
|
||||
# | rifle will attempt to extract it from $TERM.
|
||||
# | New command = $TERMCMD -e $command
|
||||
# Note: The "New command" serves only as an illustration, the exact
|
||||
# implementation may differ.
|
||||
# Note: When using rifle in ranger, there is an additional flag "c" for
|
||||
# only running the current file even if you have marked multiple files.
|
||||
|
||||
#-------------------------------------------
|
||||
# Websites
|
||||
#-------------------------------------------
|
||||
# Rarely installed browsers get higher priority; It is assumed that if you
|
||||
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
|
||||
# other hand are often only installed as fallback browsers.
|
||||
ext x?html?, has surf, X, flag f = surf -- file://"$1"
|
||||
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
|
||||
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
|
||||
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
|
||||
ext x?html?, has dwb, X, flag f = dwb -- "$@"
|
||||
ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
|
||||
ext x?html?, has luakit, X, flag f = luakit -- "$@"
|
||||
ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
|
||||
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
|
||||
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
|
||||
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
|
||||
ext x?html?, has midori, X, flag f = midori -- "$@"
|
||||
ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
|
||||
ext x?html?, has chromium, X, flag f = chromium -- "$@"
|
||||
ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
|
||||
ext x?html?, has opera, X, flag f = opera -- "$@"
|
||||
ext x?html?, has firefox, X, flag f = firefox -- "$@"
|
||||
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
|
||||
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
|
||||
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
|
||||
ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
|
||||
ext x?html?, has elinks, terminal = elinks "$@"
|
||||
ext x?html?, has links2, terminal = links2 "$@"
|
||||
ext x?html?, has links, terminal = links "$@"
|
||||
ext x?html?, has lynx, terminal = lynx -- "$@"
|
||||
ext x?html?, has w3m, terminal = w3m "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Misc
|
||||
#-------------------------------------------
|
||||
# Define the "editor" for text files as first action
|
||||
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
|
||||
mime ^text, label pager = "$PAGER" -- "$@"
|
||||
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
|
||||
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
||||
|
||||
ext 1 = man "$1"
|
||||
ext s[wmf]c, has zsnes, X = zsnes "$1"
|
||||
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
|
||||
ext nes, has fceux, X = fceux "$1"
|
||||
ext exe = wine "$1"
|
||||
name ^[mM]akefile$ = make
|
||||
|
||||
#--------------------------------------------
|
||||
# Code
|
||||
#-------------------------------------------
|
||||
ext py = python -- "$1"
|
||||
ext pl = perl -- "$1"
|
||||
ext rb = ruby -- "$1"
|
||||
ext js = node -- "$1"
|
||||
ext sh = sh -- "$1"
|
||||
ext php = php -- "$1"
|
||||
|
||||
#--------------------------------------------
|
||||
# Audio without X
|
||||
#-------------------------------------------
|
||||
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
|
||||
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
|
||||
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
|
||||
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
|
||||
|
||||
#--------------------------------------------
|
||||
# Video/Audio with a GUI
|
||||
#-------------------------------------------
|
||||
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
|
||||
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
|
||||
mime ^video, has mpv, X, flag f = mpv -- "$@"
|
||||
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
|
||||
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
|
||||
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
|
||||
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
|
||||
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
|
||||
mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
|
||||
mime ^video|audio, has totem, X, flag f = totem -- "$@"
|
||||
mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
|
||||
|
||||
#--------------------------------------------
|
||||
# Video without X:
|
||||
#-------------------------------------------
|
||||
mime ^video, terminal, !X, has mpv = mpv -- "$@"
|
||||
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
|
||||
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Documents
|
||||
#-------------------------------------------
|
||||
ext pdf, has llpp, X, flag f = llpp "$@"
|
||||
ext pdf, has zathura, X, flag f = zathura -- "$@"
|
||||
ext pdf, has mupdf, X, flag f = mupdf "$@"
|
||||
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
|
||||
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
|
||||
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
|
||||
ext pdf, has evince, X, flag f = evince -- "$@"
|
||||
ext pdf, has atril, X, flag f = atril -- "$@"
|
||||
ext pdf, has okular, X, flag f = okular -- "$@"
|
||||
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
|
||||
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
|
||||
ext pdf, has open, X, flat f = open "$@"
|
||||
|
||||
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
|
||||
|
||||
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
|
||||
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
|
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
|
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
|
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
|
||||
|
||||
ext djvu, has zathura,X, flag f = zathura -- "$@"
|
||||
ext djvu, has evince, X, flag f = evince -- "$@"
|
||||
ext djvu, has atril, X, flag f = atril -- "$@"
|
||||
|
||||
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Image Viewing:
|
||||
#-------------------------------------------
|
||||
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
||||
mime ^image/svg, has display, X, flag f = display -- "$@"
|
||||
|
||||
mime ^image, has pqiv, X, flag f = pqiv -- "$@"
|
||||
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
|
||||
mime ^image, has feh, X, flag f = feh -- "$@"
|
||||
mime ^image, has mirage, X, flag f = mirage -- "$@"
|
||||
mime ^image, has ristretto, X, flag f = ristretto "$@"
|
||||
mime ^image, has eog, X, flag f = eog -- "$@"
|
||||
mime ^image, has eom, X, flag f = eom -- "$@"
|
||||
mime ^image, has nomacs, X, flag f = nomacs -- "$@"
|
||||
mime ^image, has geeqie, X, flag f = geeqie -- "$@"
|
||||
mime ^image, has gimp, X, flag f = gimp -- "$@"
|
||||
ext xcf, X, flag f = gimp -- "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Archives
|
||||
#-------------------------------------------
|
||||
|
||||
# avoid password prompt by providing empty password
|
||||
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
|
||||
# This requires atool
|
||||
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
|
||||
|
||||
# Listing and extracting archives without atool:
|
||||
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
|
||||
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
|
||||
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
|
||||
ext zip, has unzip = unzip -l "$1" | less
|
||||
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
|
||||
ext ace, has unace = unace l "$1" | less
|
||||
ext ace, has unace = for file in "$@"; do unace e "$file"; done
|
||||
ext rar, has unrar = unrar l "$1" | less
|
||||
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
|
||||
|
||||
#-------------------------------------------
|
||||
# Misc
|
||||
#-------------------------------------------
|
||||
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
|
||||
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
|
||||
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
|
||||
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
|
||||
|
||||
# Define the editor for non-text files + pager as last action
|
||||
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
|
||||
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
|
||||
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
||||
|
||||
# The very last action, so that it's never triggered accidentally, is to execute a program:
|
||||
mime application/x-executable = "$1"
|
178
dotfiles/ranger/dot-config/scope.sh
Executable file
178
dotfiles/ranger/dot-config/scope.sh
Executable file
|
@ -0,0 +1,178 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o noclobber -o noglob -o nounset -o pipefail
|
||||
IFS=$'\n'
|
||||
|
||||
# If the option `use_preview_script` is set to `true`,
|
||||
# then this script will be called and its output will be displayed in ranger.
|
||||
# ANSI color codes are supported.
|
||||
# STDIN is disabled, so interactive scripts won't work properly
|
||||
|
||||
# This script is considered a configuration file and must be updated manually.
|
||||
# It will be left untouched if you upgrade ranger.
|
||||
|
||||
# Meanings of exit codes:
|
||||
# code | meaning | action of ranger
|
||||
# -----+------------+-------------------------------------------
|
||||
# 0 | success | Display stdout as preview
|
||||
# 1 | no preview | Display no preview at all
|
||||
# 2 | plain text | Display the plain content of the file
|
||||
# 3 | fix width | Don't reload when width changes
|
||||
# 4 | fix height | Don't reload when height changes
|
||||
# 5 | fix both | Don't ever reload
|
||||
# 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
|
||||
# 7 | image | Display the file directly as an image
|
||||
|
||||
# Script arguments
|
||||
FILE_PATH="${1}" # Full path of the highlighted file
|
||||
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
|
||||
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
|
||||
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
|
||||
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
|
||||
|
||||
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||
FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Settings
|
||||
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
|
||||
HIGHLIGHT_TABWIDTH=8
|
||||
HIGHLIGHT_STYLE='pablo'
|
||||
PYGMENTIZE_STYLE='autumn'
|
||||
|
||||
|
||||
handle_extension() {
|
||||
case "${FILE_EXTENSION_LOWER}" in
|
||||
# Archive
|
||||
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
|
||||
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
|
||||
atool --list -- "${FILE_PATH}" && exit 5
|
||||
bsdtar --list --file "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
rar)
|
||||
# Avoid password prompt by providing empty password
|
||||
unrar lt -p- -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
7z)
|
||||
# Avoid password prompt by providing empty password
|
||||
7z l -p -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# PDF
|
||||
pdf)
|
||||
# Preview as text conversion
|
||||
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# BitTorrent
|
||||
torrent)
|
||||
transmission-show -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# OpenDocument
|
||||
odt|ods|odp|sxw)
|
||||
# Preview as text conversion
|
||||
odt2txt "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# HTML
|
||||
htm|html|xhtml)
|
||||
# Preview as text conversion
|
||||
w3m -dump "${FILE_PATH}" && exit 5
|
||||
lynx -dump -- "${FILE_PATH}" && exit 5
|
||||
elinks -dump "${FILE_PATH}" && exit 5
|
||||
;; # Continue with next handler on failure
|
||||
esac
|
||||
}
|
||||
|
||||
handle_image() {
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
# SVG
|
||||
# image/svg+xml)
|
||||
# convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# exit 1;;
|
||||
|
||||
# Image
|
||||
image/*)
|
||||
local orientation
|
||||
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
|
||||
# If orientation data is present and the image actually
|
||||
# needs rotating ("1" means no rotation)...
|
||||
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
|
||||
# ...auto-rotate the image according to the EXIF data.
|
||||
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
|
||||
fi
|
||||
|
||||
# `w3mimgdisplay` will be called for all images (unless overriden as above),
|
||||
# but might fail for unsupported types.
|
||||
exit 7;;
|
||||
|
||||
# Video
|
||||
# video/*)
|
||||
# # Thumbnail
|
||||
# ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||
# exit 1;;
|
||||
# PDF
|
||||
# application/pdf)
|
||||
# pdftoppm -f 1 -l 1 \
|
||||
# -scale-to-x 1920 \
|
||||
# -scale-to-y -1 \
|
||||
# -singlefile \
|
||||
# -jpeg -tiffcompression jpeg \
|
||||
# -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
||||
# && exit 6 || exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle_mime() {
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
# Text
|
||||
text/* | */xml)
|
||||
# Syntax highlight
|
||||
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||
local pygmentize_format='terminal256'
|
||||
local highlight_format='xterm256'
|
||||
else
|
||||
local pygmentize_format='terminal'
|
||||
local highlight_format='ansi'
|
||||
fi
|
||||
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
|
||||
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
|
||||
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
|
||||
exit 2;;
|
||||
|
||||
# Image
|
||||
image/*)
|
||||
# Preview as text conversion
|
||||
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# Video and audio
|
||||
video/* | audio/*)
|
||||
mediainfo "${FILE_PATH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle_fallback() {
|
||||
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
|
||||
handle_image "${MIMETYPE}"
|
||||
fi
|
||||
handle_extension
|
||||
handle_mime "${MIMETYPE}"
|
||||
handle_fallback
|
||||
|
||||
exit 1
|
128
dotfiles/shell/dot-aliases
Normal file
128
dotfiles/shell/dot-aliases
Normal file
|
@ -0,0 +1,128 @@
|
|||
#!/bin/bash
|
||||
|
||||
# debian specific aliases
|
||||
alias pbcopy='xclip -selection clipboard'
|
||||
alias pbpaste='xclip -selection clipboard -o'
|
||||
|
||||
# Easier navigation: .., ..., ...., ....., ~ and -
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias -- -="cd -"
|
||||
|
||||
# Shortcuts
|
||||
alias dl="cd ~/Downloads"
|
||||
alias g="git"
|
||||
alias h="history"
|
||||
|
||||
## Editor
|
||||
alias e='$EDITOR '
|
||||
alias E='sudo $EDITOR '
|
||||
|
||||
# Always use color output for `ls`
|
||||
# And sort directories before files
|
||||
alias ls="ls --color --group-directories-first"
|
||||
|
||||
# ls abbreviation
|
||||
alias l="ls -l"
|
||||
alias ll="ls -l"
|
||||
alias la="ls -la"
|
||||
alias ltr="ls -ltr"
|
||||
|
||||
# Always enable colored `grep` output
|
||||
alias grep='grep --color=auto '
|
||||
|
||||
# Enable colors for less
|
||||
alias less="less -R"
|
||||
|
||||
# Enable aliases to be sudo’ed
|
||||
alias sudo='sudo '
|
||||
|
||||
# Get week number
|
||||
alias week='date +%V'
|
||||
|
||||
# Stopwatch
|
||||
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
|
||||
|
||||
# IP addresses
|
||||
alias pubip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||
alias localip="ip a | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | grep -v '172.17.'"
|
||||
|
||||
# View HTTP traffic
|
||||
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
|
||||
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
|
||||
|
||||
# Canonical hex dump some systems have this symlinked
|
||||
command -v hd > /dev/null || alias hd="hexdump -C"
|
||||
|
||||
# OS X has no `md5sum`, so use `md5` as a fallback
|
||||
command -v md5sum > /dev/null || alias md5sum="md5"
|
||||
|
||||
# OS X has no `sha1sum`, so use `shasum` as a fallback
|
||||
command -v sha1sum > /dev/null || alias sha1sum="shasum"
|
||||
|
||||
# Trim new lines and copy to clipboard
|
||||
alias c="tr -d '\n' | xclip -selection clipboard"
|
||||
|
||||
# URL-encode strings
|
||||
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
|
||||
|
||||
# Intuitive map function
|
||||
# For example, to list all directories that contain a certain file:
|
||||
# find . -name .gitattributes | map dirname
|
||||
alias map="xargs -n1"
|
||||
|
||||
# One of @janmoesen’s ProTip™s
|
||||
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
|
||||
alias "$method"="lwp-request -m '$method'"
|
||||
done
|
||||
|
||||
# Kill all the tabs in Chrome to free up memory
|
||||
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
|
||||
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
|
||||
|
||||
# Lock the screen (when going AFK)
|
||||
alias afk="~/.bin/~/.bin/screenlock.sh"
|
||||
|
||||
# vhosts
|
||||
alias hosts='sudo vim /etc/hosts'
|
||||
|
||||
# copy working directory
|
||||
alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard'
|
||||
|
||||
# copy file interactive
|
||||
alias cp='cp -i'
|
||||
|
||||
# move file interactive
|
||||
alias mv='mv -i'
|
||||
|
||||
# untar
|
||||
alias untar='tar xvf'
|
||||
|
||||
# Pipe my public key to my clipboard.
|
||||
alias pubkey="more ~/.ssh/id.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'"
|
||||
|
||||
# Pipe my private key to my clipboard.
|
||||
alias privkey="more ~/.ssh/id | xclip -selection clipboard | echo '=> Private key copied to pasteboard.'"
|
||||
|
||||
# vi == vim
|
||||
alias vi='vim'
|
||||
|
||||
# vim w/ forced latin1
|
||||
alias l1vim='vim -c "e ++enc=latin1"'
|
||||
|
||||
# Temperatursensoren mit Pfad
|
||||
alias get_systemp="paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) <(ls -1 /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t"
|
||||
|
||||
# Spezialitäten für Arch Linux
|
||||
alias y_clean='pikaur -Rs $(pikaur -Qtdq)'
|
||||
alias y_update='pikaur -Syu'
|
||||
alias y_inst='pikaur -Sy'
|
||||
alias y_rem='pikaur -Rsn'
|
||||
|
||||
# Passwort erstellen
|
||||
alias mkpasswd='openssl rand -base64 40 | cut -c1-40'
|
||||
|
||||
# Copy latest Download into primary selection
|
||||
alias cld='cat $(ls --directory --format single-column -t --color=never ~/Downloads/* | head --lines 1) | xclip -in'
|
34
dotfiles/shell/dot-bash_profile
Normal file
34
dotfiles/shell/dot-bash_profile
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Case-insensitive globbing (used in pathname expansion)
|
||||
#shopt -s nocaseglob
|
||||
|
||||
# Append to the Bash history file, rather than overwriting it
|
||||
shopt -s histappend
|
||||
|
||||
# Autocorrect typos in path names when using `cd`
|
||||
shopt -s cdspell
|
||||
|
||||
# Enable some Bash 4 features when possible:
|
||||
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
|
||||
# * Recursive globbing, e.g. `echo **/*.txt`
|
||||
for option in globstar; do
|
||||
shopt -s "$option" 2> /dev/null
|
||||
done
|
||||
|
||||
# Add tab completion for SSH hostnames based on ~/.ssh/config
|
||||
# ignoring wildcards
|
||||
[[ -e "$HOME/.ssh/config" ]] && complete -o "default" \
|
||||
-o "nospace" \
|
||||
-W "$(grep "^Host" ~/.ssh/config | \
|
||||
grep -v "[?*]" | cut -d " " -f2 | \
|
||||
tr ' ' '\n')" scp sftp ssh
|
||||
|
||||
# Load the shell dotfiles, and then some:
|
||||
# * ~/.path can be used to extend `$PATH`.
|
||||
# * ~/.extra can be used for other settings you don’t want to commit.
|
||||
for file in ~/.{bash_prompt,aliases,functions,path,extra,exports}; do
|
||||
[[ -r "$file" ]] && [[ -f "$file" ]] && source "$file"
|
||||
done
|
||||
unset file
|
||||
|
||||
# print a fortune when the terminal opens
|
||||
which fortune > /dev/null && which lolcat > /dev/null && fortune -a -s | lolcat
|
120
dotfiles/shell/dot-bash_prompt
Normal file
120
dotfiles/shell/dot-bash_prompt
Normal file
|
@ -0,0 +1,120 @@
|
|||
# Shell prompt based on the Solarized Dark theme.
|
||||
# Screenshot: http://i.imgur.com/EkEtphC.png
|
||||
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
|
||||
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
|
||||
|
||||
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
|
||||
export TERM='gnome-256color';
|
||||
elif infocmp xterm-256color >/dev/null 2>&1; then
|
||||
export TERM='xterm-256color';
|
||||
fi;
|
||||
|
||||
prompt_git() {
|
||||
local s='';
|
||||
local branchName='';
|
||||
|
||||
# Check if the current directory is in a Git repository.
|
||||
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
|
||||
|
||||
# check if the current directory is in .git before running git checks
|
||||
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
|
||||
|
||||
# Ensure the index is up to date.
|
||||
git update-index --really-refresh -q &>/dev/null;
|
||||
|
||||
# Check for uncommitted changes in the index.
|
||||
if ! $(git diff --quiet --ignore-submodules --cached); then
|
||||
s+='+';
|
||||
fi;
|
||||
|
||||
# Check for unstaged changes.
|
||||
if ! $(git diff-files --quiet --ignore-submodules --); then
|
||||
s+='!';
|
||||
fi;
|
||||
|
||||
# Check for untracked files.
|
||||
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
|
||||
s+='?';
|
||||
fi;
|
||||
|
||||
# Check for stashed files.
|
||||
if $(git rev-parse --verify refs/stash &>/dev/null); then
|
||||
s+='$';
|
||||
fi;
|
||||
|
||||
fi;
|
||||
|
||||
# Get the short symbolic ref.
|
||||
# If HEAD isn’t a symbolic ref, get the short SHA for the latest commit
|
||||
# Otherwise, just give up.
|
||||
branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \
|
||||
git rev-parse --short HEAD 2> /dev/null || \
|
||||
echo '(unknown)')";
|
||||
|
||||
[ -n "${s}" ] && s=" [${s}]";
|
||||
|
||||
echo -e "${1}${branchName}${blue}${s}";
|
||||
else
|
||||
return;
|
||||
fi;
|
||||
}
|
||||
|
||||
if tput setaf 1 &> /dev/null; then
|
||||
tput sgr0; # reset colors
|
||||
bold=$(tput bold);
|
||||
reset=$(tput sgr0);
|
||||
# Solarized colors, taken from http://git.io/solarized-colors.
|
||||
black=$(tput setaf 0);
|
||||
blue=$(tput setaf 33);
|
||||
cyan=$(tput setaf 37);
|
||||
green=$(tput setaf 64);
|
||||
orange=$(tput setaf 166);
|
||||
purple=$(tput setaf 125);
|
||||
red=$(tput setaf 124);
|
||||
violet=$(tput setaf 61);
|
||||
white=$(tput setaf 15);
|
||||
yellow=$(tput setaf 136);
|
||||
else
|
||||
bold='';
|
||||
reset="\e[0m";
|
||||
black="\e[1;30m";
|
||||
blue="\e[1;34m";
|
||||
cyan="\e[1;36m";
|
||||
green="\e[1;32m";
|
||||
orange="\e[1;33m";
|
||||
purple="\e[1;35m";
|
||||
red="\e[1;31m";
|
||||
violet="\e[1;35m";
|
||||
white="\e[1;37m";
|
||||
yellow="\e[1;33m";
|
||||
fi;
|
||||
|
||||
# Highlight the user name when logged in as root.
|
||||
if [[ "${USER}" == "root" ]]; then
|
||||
userStyle="${red}";
|
||||
else
|
||||
userStyle="${blue}";
|
||||
fi;
|
||||
|
||||
# Highlight the hostname when connected via SSH.
|
||||
if [[ "${SSH_TTY}" ]]; then
|
||||
hostStyle="${bold}${purple}";
|
||||
else
|
||||
hostStyle="${cyan}";
|
||||
fi;
|
||||
|
||||
# Set the terminal title to the current working directory.
|
||||
PS1="\[${userStyle}\]\u"; # username
|
||||
PS1+="\[${reset}\] at ";
|
||||
PS1+="\[${bold}\]";
|
||||
PS1+="\[${hostStyle}\]\h"; # host
|
||||
PS1+="\[${reset}\] in ";
|
||||
PS1+="\[${bold}\]";
|
||||
PS1+="\[${green}\]\w"; # working directory
|
||||
PS1+="\$(prompt_git \"${reset} on ${bold}${violet}\")"; # Git repository details
|
||||
PS1+="\n";
|
||||
PS1+="\[${reset}\]$ "; # `$` (and reset color)
|
||||
export PS1;
|
||||
|
||||
PS2="\[${yellow}\]→ \[${reset}\]";
|
||||
export PS2;
|
98
dotfiles/shell/dot-bashrc
Normal file
98
dotfiles/shell/dot-bashrc
Normal file
|
@ -0,0 +1,98 @@
|
|||
#!/bin/bash -x
|
||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
alias dir='dir --color=auto'
|
||||
alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [[ -f /etc/bash_completion ]]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d /etc/bash_completion.d ]
|
||||
then
|
||||
for file in /etc/bash_completion.d/* ; do
|
||||
source "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -f $HOME/.bash_profile ]]; then
|
||||
source $HOME/.bash_profile
|
||||
fi
|
||||
|
||||
cd $HOME
|
51
dotfiles/shell/dot-exports
Normal file
51
dotfiles/shell/dot-exports
Normal file
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
# PATH
|
||||
which ruby >/dev/null 2>&1 && PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
|
||||
export PATH=~/.local/bin:~/.bin:$PATH
|
||||
|
||||
# Make vim the default editor
|
||||
export EDITOR=vim;
|
||||
export TERMINAL="alacritty";
|
||||
|
||||
export HISTSIZE=50000000;
|
||||
export HISTFILESIZE=$HISTSIZE;
|
||||
export HISTCONTROL=ignoredups;
|
||||
export HISTIGNORE=" *:ls:cd:pwd:exit:[bf]g:clear:reset:mplayer *";
|
||||
|
||||
# Deutsches System aber englische Messages und Sortierung
|
||||
# aber nur wenn die locale gesetzt werden kann
|
||||
if [ -x /usr/bin/locale ]
|
||||
then
|
||||
export LC_MESSAGES="C"
|
||||
export LC_COLLATE="C"
|
||||
export LANG="de_DE.UTF-8"
|
||||
export LC_CTYPE="de_DE.UTF-8"
|
||||
export LC_NUMERIC="de_DE.UTF-8"
|
||||
export LC_TIME="de_DE.UTF-8"
|
||||
export LC_MONETARY="de_DE.UTF-8"
|
||||
export LC_PAPER="de_DE.UTF-8"
|
||||
export LC_NAME="de_DE.UTF-8"
|
||||
export LC_ADDRESS="de_DE.UTF-8"
|
||||
export LC_TELEPHONE="de_DE.UTF-8"
|
||||
export LC_MEASUREMENT="de_DE.UTF-8"
|
||||
export LC_IDENTIFICATION="de_DE.UTF-8"
|
||||
unset LC_ALL
|
||||
fi
|
||||
|
||||
# Highlight section titles in manual pages
|
||||
export LESS_TERMCAP_md="${yellow}";
|
||||
|
||||
# Don’t clear the screen after quitting a manual page
|
||||
export MANPAGER="less -X";
|
||||
|
||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=/var/run/user/$(id -u)/bus;
|
||||
|
||||
export TODOTXT_DEFAULT_ACTION=ls
|
||||
|
||||
export CM_LAUNCHER=rofi
|
||||
|
||||
# hidpi for gtk apps
|
||||
#export GDK_SCALE=2
|
||||
#export GDK_DPI_SCALE=0.5
|
||||
#export QT_DEVICE_PIXEL_RATIO=2
|
211
dotfiles/shell/dot-functions
Normal file
211
dotfiles/shell/dot-functions
Normal file
|
@ -0,0 +1,211 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Trap RC != 0 and display
|
||||
EC() {
|
||||
echo -e '\e[1;31m'code $?'\e[m\n'
|
||||
}
|
||||
trap EC ERR
|
||||
|
||||
# Create a new directory and enter it
|
||||
mkd() {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
# Make a temporary directory and enter it
|
||||
tmpd() {
|
||||
if [ $# -eq 0 ]; then
|
||||
dir=`mktemp -d` && cd $dir
|
||||
else
|
||||
dir=`mktemp -d -t $1.XXXXXXXXXX` && cd $dir
|
||||
fi
|
||||
}
|
||||
|
||||
# cd and list
|
||||
cl() {
|
||||
local dir="$1"
|
||||
local dir="${dir:=$HOME}"
|
||||
if [[ -d "$dir" ]]; then
|
||||
cd "$dir" >/dev/null; ls -l
|
||||
else
|
||||
echo "bash: cl: $dir: Directory not found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Determine size of a file or total size of a directory
|
||||
fs() {
|
||||
if du -b /dev/null > /dev/null 2>&1; then
|
||||
local arg=-sbh
|
||||
else
|
||||
local arg=-sh
|
||||
fi
|
||||
if [[ -n "$@" ]]; then
|
||||
du $arg -- "$@"
|
||||
else
|
||||
du $arg .[^.]* *
|
||||
fi
|
||||
}
|
||||
|
||||
# Start an HTTP server from a directory, optionally specifying the port
|
||||
server() {
|
||||
local port="${1:-8000}"
|
||||
sleep 1 && open "http://localhost:${port}/" &
|
||||
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
|
||||
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
|
||||
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
|
||||
}
|
||||
|
||||
# Compare original and gzipped file size
|
||||
gz() {
|
||||
local origsize=$(wc -c < "$1")
|
||||
local gzipsize=$(gzip -c "$1" | wc -c)
|
||||
local ratio=$(echo "$gzipsize * 100 / $origsize" | bc -l)
|
||||
printf "orig: %d bytes\n" "$origsize"
|
||||
printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio"
|
||||
}
|
||||
|
||||
# Run `dig` and display the most useful info
|
||||
digga() {
|
||||
dig +nocmd "$1" any +multiline +noall +answer
|
||||
}
|
||||
|
||||
# Show all the names (CNs and SANs) listed in the SSL certificate
|
||||
# for a given domain
|
||||
getcertnames() {
|
||||
if [ -z "${1}" ]; then
|
||||
echo "ERROR: No domain specified."
|
||||
return 1
|
||||
fi
|
||||
|
||||
local domain="${1}"
|
||||
echo "Testing ${domain}…"
|
||||
echo ""; # newline
|
||||
|
||||
local tmp=$(echo -e "GET / HTTP/1.0\nEOT" \
|
||||
| openssl s_client -connect "${domain}:443" 2>&1)
|
||||
|
||||
if [[ "${tmp}" = *"-----BEGIN CERTIFICATE-----"* ]]; then
|
||||
local certText=$(echo "${tmp}" \
|
||||
| openssl x509 -text -certopt "no_header, no_serial, no_version, \
|
||||
no_signame, no_validity, no_issuer, no_pubkey, no_sigdump, no_aux")
|
||||
echo "Common Name:"
|
||||
echo ""; # newline
|
||||
echo "${certText}" | grep "Subject:" | sed -e "s/^.*CN=//"
|
||||
echo ""; # newline
|
||||
echo "Subject Alternative Name(s):"
|
||||
echo ""; # newline
|
||||
echo "${certText}" | grep -A 1 "Subject Alternative Name:" \
|
||||
| sed -e "2s/DNS://g" -e "s/ //g" | tr "," "\n" | tail -n +2
|
||||
return 0
|
||||
else
|
||||
echo "ERROR: Certificate not found."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# `o` with no arguments opens the current directory, otherwise opens the given
|
||||
# location
|
||||
o() {
|
||||
if [ $# -eq 0 ]; then
|
||||
xdg-open . > /dev/null 2>&1
|
||||
else
|
||||
xdg-open "$@" > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
# Get colors in manual pages
|
||||
man() {
|
||||
env \
|
||||
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||
LESS_TERMCAP_se=$(printf "\e[0m") \
|
||||
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
|
||||
LESS_TERMCAP_ue=$(printf "\e[0m") \
|
||||
LESS_TERMCAP_us=$(printf "\e[1;32m") \
|
||||
man "$@"
|
||||
}
|
||||
|
||||
# Use feh to nicely view images
|
||||
openimage() {
|
||||
local types='*.jpg *.JPG *.png *.PNG *.gif *.GIF *.jpeg *.JPEG'
|
||||
|
||||
cd $(dirname "$1")
|
||||
local file=$(basename "$1")
|
||||
|
||||
feh -q $types --auto-zoom \
|
||||
--sort filename --borderless \
|
||||
--scale-down --draw-filename \
|
||||
--image-bg black \
|
||||
--start-at "$file"
|
||||
}
|
||||
|
||||
# get the name of a x window
|
||||
xname(){
|
||||
local window_id=$1
|
||||
|
||||
if [[ -z $window_id ]]; then
|
||||
echo "Please specifiy a window id, you find this with 'xwininfo'"
|
||||
|
||||
return 1
|
||||
fi
|
||||
|
||||
local match_string='".*"'
|
||||
local match_int='[0-9][0-9]*'
|
||||
local match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference
|
||||
|
||||
# get the name
|
||||
xprop -id $window_id | \
|
||||
sed -nr \
|
||||
-e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \
|
||||
-e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \
|
||||
-e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \
|
||||
-e "/^_NET_WM_NAME\(UTF8_STRING\) = ($match_qstring)$/{s//title=\1/; h}" \
|
||||
-e '${g; p}'
|
||||
}
|
||||
|
||||
# Docker
|
||||
d_stop(){
|
||||
docker stop $(docker ps -q)
|
||||
}
|
||||
d_clean(){
|
||||
docker rm $(docker ps -q -f status=exited)
|
||||
docker rmi $(docker images -q -f dangling=true)
|
||||
docker volume rm $(docker volume ls -f dangling=true)
|
||||
}
|
||||
d_reset(){
|
||||
docker stop $(docker ps -q) 2>/dev/null
|
||||
docker rm -f $(docker ps -aq) 2>/dev/null
|
||||
docker rmi -f $(docker images -qa) 2>/dev/null
|
||||
docker volume rm $(docker volume ls -q) 2>/dev/null
|
||||
|
||||
}
|
||||
|
||||
## Dump SSL Cert from host
|
||||
## sslcheck example.com:25 -starttls smtp
|
||||
## sslcheck example.com:443
|
||||
sslcheck(){
|
||||
echo -n | openssl s_client -connect $* | tee /dev/tty | openssl x509 -text -noout
|
||||
}
|
||||
|
||||
## Kubernetes Goodies
|
||||
k(){
|
||||
kubectl $*
|
||||
}
|
||||
|
||||
k-sel(){
|
||||
kubeconfig=$(find ~/.kube/kubesel -type f | rev | cut -d "/" -f 1 | rev | sort | fzf --height=25%)
|
||||
export KUBECONFIG=~/.kube/kubesel/$kubeconfig
|
||||
echo
|
||||
kubectl config get-contexts
|
||||
}
|
||||
|
||||
k-ns(){
|
||||
kubectl config set-context \
|
||||
--current \
|
||||
--namespace=$(kubectl get namespace | grep Active \
|
||||
| cut -d " " -f1 \
|
||||
| fzf --height=25%
|
||||
)
|
||||
echo
|
||||
kubectl config get-contexts
|
||||
}
|
48
dotfiles/shell/dot-inputrc
Normal file
48
dotfiles/shell/dot-inputrc
Normal file
|
@ -0,0 +1,48 @@
|
|||
# Tab autocomplete regardless of filename case
|
||||
set completion-ignore-case off
|
||||
|
||||
# List all matches in case multiple possible completions are possible
|
||||
set show-all-if-ambiguous on
|
||||
|
||||
# Immediately add a trailing slash when autocompleting symlinks to directories
|
||||
set mark-symlinked-directories on
|
||||
|
||||
# Use the text that has already been typed as the prefix for searching through
|
||||
# commands (i.e. more intelligent Up/Down behavior)
|
||||
"\e[B": history-search-forward
|
||||
"\e[A": history-search-backward
|
||||
|
||||
# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
|
||||
set match-hidden-files off
|
||||
|
||||
# Show all autocomplete results at once
|
||||
set page-completions off
|
||||
|
||||
# If there are more than 200 possible completions for a word, ask to show them all
|
||||
set completion-query-items 200
|
||||
|
||||
# Show extra file information when completing, like `ls -F` does
|
||||
set visible-stats on
|
||||
|
||||
# Be more intelligent when autocompleting by also looking at the text after
|
||||
# the cursor. For example, when the current line is "cd ~/src/mozil", and
|
||||
# the cursor is on the "z", pressing Tab will not autocomplete it to "cd
|
||||
# ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the
|
||||
# Readline used by Bash 4.)
|
||||
set skip-completed-text on
|
||||
|
||||
# Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456'
|
||||
set input-meta on
|
||||
set output-meta on
|
||||
set convert-meta off
|
||||
|
||||
# Use Alt/Meta + Delete to delete the preceding word
|
||||
"\e[3;3~": kill-word
|
||||
|
||||
## enable Alt-arrows
|
||||
"\e[1;5D": backward-word ### Alt left
|
||||
"\e[1;5C": forward-word ### Alt right
|
||||
|
||||
## Support for Home & End Keys via SSH
|
||||
"\e[7~": beginning-of-line
|
||||
"\e[8~": end-of-line
|
172
dotfiles/vim/dot-vim/autoload/mocha.vim
Normal file
172
dotfiles/vim/dot-vim/autoload/mocha.vim
Normal file
|
@ -0,0 +1,172 @@
|
|||
" Vim color file
|
||||
" Maintainer: Daniel Schierbeck <daniel DOT schierbeck PONY gmail UNICORN com>
|
||||
|
||||
set background=dark
|
||||
if version > 580
|
||||
" no guarantees for version 5.8 and below, but this makes it stop
|
||||
" complaining
|
||||
hi clear
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
endif
|
||||
let g:colors_name="mocha"
|
||||
|
||||
hi Normal guifg=#ddddcc guibg=#1B1814 gui=none
|
||||
|
||||
" highlight groups
|
||||
hi Cursor guifg=black guibg=yellow gui=none
|
||||
hi ErrorMsg guifg=white guibg=red gui=none
|
||||
hi VertSplit guifg=gray40 guibg=gray40 gui=none
|
||||
hi Folded guifg=grey guibg=grey30 gui=none
|
||||
hi FoldColumn guifg=tan guibg=grey30 gui=none
|
||||
hi IncSearch guifg=#b0ffff guibg=#2050d0
|
||||
hi LineNr guifg=burlywood3 gui=none
|
||||
hi ModeMsg guifg=SkyBlue gui=none
|
||||
hi MoreMsg guifg=SeaGreen gui=none
|
||||
hi NonText guifg=cyan gui=none
|
||||
hi Question guifg=springgreen gui=none
|
||||
hi Search guifg=gray80 guibg=#445599 gui=none
|
||||
hi SpecialKey guifg=cyan gui=none
|
||||
hi StatusLine guifg=black guibg=#c2bfa5 gui=bold
|
||||
hi StatusLineNC guifg=white guibg=gray20 gui=none
|
||||
hi TabLine guibg=#564d43 guifg=#f7f7f1 gui=underline
|
||||
hi TabLineFill guibg=#564d43 guifg=#f7f7f1 gui=underline
|
||||
hi TabLineSel guibg=bg guifg=#f7f7f1 gui=bold
|
||||
hi Title guifg=white gui=none
|
||||
hi Visual guifg=white guibg=SkyBlue4 gui=none
|
||||
hi WarningMsg guifg=salmon gui=none
|
||||
hi Pmenu guifg=#000000 guibg=#a78869 gui=none
|
||||
hi PmenuSbar guifg=fg guibg=#B99F86 gui=none
|
||||
hi PmenuSel guifg=bg guibg=#c0aa94 gui=none
|
||||
hi PmenuThumb guifg=bg guibg=#f7f7f1 gui=none
|
||||
hi WildMenu guifg=gray guibg=gray17 gui=none
|
||||
hi MatchParen guifg=white guibg=skyblue4 gui=bold
|
||||
hi DiffAdd guifg=black guibg=wheat1
|
||||
hi DiffChange guifg=black guibg=skyblue1
|
||||
hi DiffText guifg=black guibg=hotpink1 gui=none
|
||||
hi DiffDelete guibg=gray45 guifg=black gui=none
|
||||
|
||||
|
||||
" Real diff
|
||||
hi DiffAdded guifg=#4b4
|
||||
hi DiffRemoved guifg=#f77
|
||||
|
||||
if has("spell")
|
||||
hi SpellBad guisp=#f07070 gui=undercurl
|
||||
hi SpellCap guisp=#7070f0 gui=undercurl
|
||||
hi SpellLocal guisp=#70f0f0 gui=undercurl
|
||||
hi SpellRare guisp=#f070f0 gui=undercurl
|
||||
endif
|
||||
|
||||
hi Comment guifg=#7F8A70 gui=none
|
||||
hi Number guifg=#A4C260
|
||||
hi Constant guifg=white gui=none
|
||||
hi Identifier guifg=white
|
||||
hi Function guifg=white gui=none
|
||||
hi Statement guifg=lightgoldenrod2 gui=none
|
||||
hi Delimiter guifg=#997744
|
||||
hi PreProc guifg=lightgoldenrod2 gui=none
|
||||
hi Special guifg=#CDA869 gui=none
|
||||
hi Type guifg=white gui=none
|
||||
hi Character guifg=#DDF2A4
|
||||
hi Boolean guifg=#AA88AA
|
||||
hi Ignore guifg=grey40 gui=none
|
||||
hi Todo guifg=lightgoldenrod2 guibg=grey30 gui=bold
|
||||
hi String guifg=#A4C260
|
||||
hi SignColumn guibg=#1B1814 gui=none
|
||||
hi ShowMarksHLl guifg=lightgoldenrod2 guibg=#151207
|
||||
|
||||
hi link Operator Special
|
||||
hi link Structure Special
|
||||
hi link StorageClass Special
|
||||
|
||||
" TODO
|
||||
hi Tag gui=underline
|
||||
|
||||
" color terminal definitions
|
||||
hi SpecialKey ctermfg=darkgreen
|
||||
hi NonText cterm=bold ctermfg=darkblue
|
||||
hi Directory ctermfg=darkcyan
|
||||
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
|
||||
hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
|
||||
hi Search cterm=NONE ctermfg=grey ctermbg=blue
|
||||
hi MoreMsg ctermfg=darkgreen
|
||||
hi ModeMsg cterm=NONE ctermfg=brown
|
||||
hi LineNr ctermfg=3
|
||||
hi Question ctermfg=green
|
||||
hi StatusLine cterm=bold,reverse
|
||||
hi StatusLineNC cterm=reverse
|
||||
hi VertSplit cterm=reverse
|
||||
hi Title ctermfg=5
|
||||
hi Visual cterm=reverse
|
||||
hi VisualNOS cterm=bold,underline
|
||||
hi WarningMsg ctermfg=1
|
||||
hi WildMenu ctermfg=0 ctermbg=3
|
||||
hi Folded ctermfg=darkgrey ctermbg=NONE
|
||||
hi FoldColumn ctermfg=darkgrey ctermbg=NONE
|
||||
hi DiffAdd ctermbg=4
|
||||
hi DiffChange ctermbg=5
|
||||
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
|
||||
hi DiffText cterm=bold ctermbg=1
|
||||
hi Comment ctermfg=darkcyan
|
||||
hi Constant ctermfg=brown
|
||||
hi Special ctermfg=5
|
||||
hi Identifier ctermfg=6
|
||||
hi Statement ctermfg=3
|
||||
hi PreProc ctermfg=5
|
||||
hi Type ctermfg=2
|
||||
hi Underlined cterm=underline ctermfg=5
|
||||
hi Ignore ctermfg=darkgrey
|
||||
hi Error cterm=bold ctermfg=7 ctermbg=1
|
||||
|
||||
|
||||
" Ruby
|
||||
"hi rubySymbol guifg=#DDF2A4
|
||||
hi link rubySymbol Character
|
||||
hi rubyConstant guifg=white
|
||||
|
||||
|
||||
" Rails
|
||||
hi link railsStringSpecial rubySymbol
|
||||
hi railsMethod guifg=lightgoldenrod2
|
||||
hi railsClass guifg=white
|
||||
|
||||
|
||||
" HTML
|
||||
hi htmlArg guifg=lightgoldenrod2
|
||||
hi htmlTag guifg=lightgoldenrod2
|
||||
hi htmlEndTag guifg=lightgoldenrod2
|
||||
|
||||
|
||||
" PHP
|
||||
hi phpStructure guifg=lightgoldenrod2
|
||||
hi phpStorageClass guifg=lightgoldenrod2
|
||||
hi phpStatement guifg=lightgoldenrod2
|
||||
hi link phpVarSelector Identifier
|
||||
hi link phpQuoteSingle Delimiter
|
||||
hi link phpQuoteDouble Delimiter
|
||||
|
||||
|
||||
" JavaScript
|
||||
hi javaScriptFunction guifg=lightgoldenrod2
|
||||
|
||||
|
||||
" Make
|
||||
hi link makeTarget Operator
|
||||
|
||||
|
||||
" Java
|
||||
hi link javaClassDecl Keyword
|
||||
hi link javaScopeDecl Keyword
|
||||
hi link javaBraces Special
|
||||
|
||||
|
||||
" Python
|
||||
hi link pythonOperator Keyword
|
||||
hi link pythonDecorator Delimiter
|
||||
|
||||
|
||||
" Common Lisp
|
||||
hi link lispAtom Character
|
||||
hi link lispKey Special
|
340
dotfiles/vim/dot-vim/vimrc
Executable file
340
dotfiles/vim/dot-vim/vimrc
Executable file
|
@ -0,0 +1,340 @@
|
|||
"
|
||||
" Install plugins
|
||||
"
|
||||
set nocompatible " be iMproved, required
|
||||
filetype off " required
|
||||
|
||||
|
||||
" set the runtime path to include Vundle and initialize
|
||||
" Install with git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
" let Vundle manage Vundle, required
|
||||
Plugin 'VundleVim/Vundle.vim'
|
||||
Plugin 'Raimondi/delimitMate' " Autoclose quotes, parenthesis, brackets, etc.
|
||||
Plugin 'Yggdroot/indentLine'
|
||||
Plugin 'airblade/vim-gitgutter' " Git-indicators on the left
|
||||
Plugin 'dhruvasagar/vim-table-mode' " Nice ascii tables
|
||||
Plugin 'itchyny/lightline.vim' " Status-line
|
||||
Plugin 'junegunn/vim-easy-align' " Align at any chars
|
||||
Plugin 'ntpeters/vim-better-whitespace' " Complain on evil eol whitespace
|
||||
Plugin 'preservim/nerdcommenter' " Comments...
|
||||
Plugin 'preservim/nerdtree' " Nerdtree...
|
||||
Plugin 'tpope/vim-fugitive' " git integration
|
||||
call vundle#end()
|
||||
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
syntax sync minlines=256
|
||||
|
||||
"
|
||||
" Settings
|
||||
"
|
||||
set autoindent
|
||||
set autoread " Automatically reread changed files without asking me anything
|
||||
set autowrite " Automatically save before :next, :make etc.
|
||||
set backspace=indent,eol,start " Makes backspace key more powerful.
|
||||
set complete=.,w,b,u,t
|
||||
set completeopt=longest,menuone
|
||||
set display+=lastline
|
||||
set encoding=utf-8 " Set default encoding to UTF-8
|
||||
set fileformats=unix,dos,mac " Prefer Unix over Windows over OS 9 formats
|
||||
set hidden
|
||||
set history=500
|
||||
set hlsearch
|
||||
set ignorecase
|
||||
set incsearch
|
||||
set laststatus=2
|
||||
set lazyredraw
|
||||
set nobackup " Don't create annoying backup files
|
||||
set nocursorcolumn
|
||||
set nocursorline
|
||||
set noerrorbells " No beeps
|
||||
set noshowmode " We show the mode with airlien or lightline
|
||||
set noswapfile " Don't use swapfile
|
||||
set nowritebackup
|
||||
set nrformats-=octal
|
||||
set number " Show line numbers
|
||||
set re=1
|
||||
set ruler " Show the cursor position all the time
|
||||
set scrolloff=7
|
||||
set showcmd " Show me what I'm typing
|
||||
set showmatch " Show matching brackets by flickering
|
||||
set sidescrolloff=7
|
||||
set smartcase
|
||||
set splitbelow " Split horizontal windows below to the current windows
|
||||
set splitright " Split vertical windows right to the current windows
|
||||
set synmaxcol=300
|
||||
set tabpagemax=50
|
||||
set ttyfast
|
||||
|
||||
" Make Vim to handle long lines nicely.
|
||||
set wrap
|
||||
set textwidth=79
|
||||
set formatoptions=qrn1
|
||||
|
||||
" Time out on key codes but not mappings.
|
||||
set notimeout
|
||||
set ttimeout
|
||||
set ttimeoutlen=10
|
||||
|
||||
if has('gui_running')
|
||||
"set transparency=3
|
||||
set regexpengine=1 " fix js regex syntax
|
||||
endif
|
||||
|
||||
" Better colorhandling
|
||||
if has('termguicolors')
|
||||
set termguicolors
|
||||
endif
|
||||
|
||||
let mapleader = ","
|
||||
|
||||
" dont save .netrwhist history
|
||||
let g:netrw_dirhistmax=0
|
||||
|
||||
" Allow saving of files as sudo when I forgot to start vim using sudo.
|
||||
cmap w!! w !sudo tee > /dev/null %
|
||||
|
||||
" open help vertically
|
||||
command! -nargs=* -complete=help Help vertical belowright help <args>
|
||||
|
||||
" Different Cursorshapes for the modes
|
||||
"let &t_SI = "\<Esc>[6 q"
|
||||
"let &t_SR = "\<Esc>[4 q"
|
||||
"let &t_EI = "\<Esc>[2 q"
|
||||
|
||||
" ==================== Remap Keys ====================
|
||||
" Remaps % to tab so navigate to matching brackets
|
||||
nnoremap <tab> %
|
||||
vnoremap <tab> %
|
||||
|
||||
" Visual mode pressing * or # searches for the current selection
|
||||
vnoremap <silent> * :call VisualSelection('f')<CR>
|
||||
vnoremap <silent> # :call VisualSelection('b')<CR>
|
||||
|
||||
" Center, kill hl
|
||||
nnoremap n nzzzv
|
||||
nnoremap N Nzzzv
|
||||
nnoremap <leader><space> :nohlsearch<CR>
|
||||
nnoremap <space> zz
|
||||
|
||||
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
|
||||
" so that you can undo CTRL-U after inserting a line break.
|
||||
inoremap <C-U> <C-G>u<C-U>
|
||||
|
||||
" Toggle line numbers and rulers
|
||||
nmap <leader>ll :set number!<cr>
|
||||
nmap <leader>lr :set relativenumber!<cr>
|
||||
nmap <leader>cc :set cursorcolumn!<cr>
|
||||
nmap <leader>cl :set cursorline!<cr>
|
||||
|
||||
" Better split switching with alt
|
||||
map <M-j> <C-W>j
|
||||
map <M-k> <C-W>k
|
||||
map <M-h> <C-W>h
|
||||
map <M-l> <C-W>l
|
||||
map <M-down> <C-W>j
|
||||
map <M-up> <C-W>k
|
||||
map <M-left> <C-W>h
|
||||
map <M-right> <C-W>l
|
||||
|
||||
" Move up and down on split lines
|
||||
map <Up> gk
|
||||
map <Down> gj
|
||||
map k gk
|
||||
map j gj
|
||||
|
||||
" Spell checking
|
||||
nnoremap <F6> :setlocal spell! spell?<CR>
|
||||
map <leader>ss :setlocal spell!<cr>
|
||||
map <leader>sn ]s
|
||||
map <leader>sp [s
|
||||
map <leader>sa zg
|
||||
map <leader>s? z=
|
||||
|
||||
" trim all whitespaces away
|
||||
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
|
||||
|
||||
" Do not show stupid q: window
|
||||
map q: :q
|
||||
|
||||
" Paste Mode
|
||||
set pastetoggle=<F2>
|
||||
nmap p :pu<CR>
|
||||
|
||||
" ==================== File Type settings ====================
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
set noexpandtab
|
||||
set shiftround
|
||||
set smarttab
|
||||
|
||||
au BufNewFile,BufRead *.vim setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.ino setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.txt setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.md setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.json setlocal et ts=2 sw=2 sts=2
|
||||
au BufNewFile,BufRead *.go setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.lua setlocal noet ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.py setlocal et ts=4 sw=4 sts=4
|
||||
au BufNewFile,BufRead *.yml,*.yaml setlocal et ts=2 sw=2 sts=2
|
||||
au BufNewFile,BufRead *.htm,*.html setlocal noet ts=4 sw=4 sts=4
|
||||
|
||||
au FileType dockerfile setlocal et ts=2 sw=2 sts=2
|
||||
au FileType nginx setlocal noet ts=4 sw=4 sts=4
|
||||
au FileType fstab,systemd set noet
|
||||
au FileType gitconfig,sh,toml set noet
|
||||
|
||||
" ==================== Wildmenu ====================
|
||||
set wildmenu
|
||||
set wildmode=list:full
|
||||
|
||||
set wildignore+=.hg,.git,.svn " Version control
|
||||
set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
|
||||
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
|
||||
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
|
||||
set wildignore+=*.spl " compiled spelling word lists
|
||||
set wildignore+=*.sw? " Vim swap files
|
||||
set wildignore+=*.DS_Store " OSX bullshit
|
||||
set wildignore+=*.luac " Lua byte code
|
||||
set wildignore+=migrations " Django migrations
|
||||
set wildignore+=go/pkg " Go static files
|
||||
set wildignore+=go/bin " Go bin files
|
||||
set wildignore+=go/bin-vagrant " Go bin-vagrant files
|
||||
set wildignore+=*.pyc " Python byte code
|
||||
set wildignore+=*.orig " Merge resolution files
|
||||
|
||||
|
||||
" ==================== PLUGIN: Fugitive ====================
|
||||
nnoremap <leader>ga :Git add %:p<CR><CR>
|
||||
nnoremap <leader>gs :Gstatus<CR>
|
||||
nnoremap <leader>gp :Gpush<CR>
|
||||
vnoremap <leader>gb :Gblame<CR>
|
||||
|
||||
" ==================== PLUGIN: Lightline ====================
|
||||
"
|
||||
let g:lightline = {
|
||||
\ 'active': {
|
||||
\ 'left': [ [ 'mode', 'paste'],
|
||||
\ [ 'fugitive', 'filename', 'modified', 'ctrlpmark' ],
|
||||
\ ],
|
||||
\ 'right': [ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||
\ },
|
||||
\ 'inactive': {
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'lineinfo': 'LightLineInfo',
|
||||
\ 'percent': 'LightLinePercent',
|
||||
\ 'modified': 'LightLineModified',
|
||||
\ 'filename': 'LightLineFilename',
|
||||
\ 'fileformat': 'LightLineFileformat',
|
||||
\ 'filetype': 'LightLineFiletype',
|
||||
\ 'fileencoding': 'LightLineFileencoding',
|
||||
\ 'mode': 'LightLineMode',
|
||||
\ 'fugitive': 'LightLineFugitive',
|
||||
\ 'ctrlpmark': 'CtrlPMark',
|
||||
\ },
|
||||
\ }
|
||||
|
||||
function! LightLineModified()
|
||||
if &filetype == "help"
|
||||
return ""
|
||||
elseif &modified
|
||||
return "+"
|
||||
elseif &modifiable
|
||||
return ""
|
||||
else
|
||||
return ""
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! LightLineFileformat()
|
||||
return winwidth(0) > 70 ? &fileformat : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineInfo()
|
||||
return winwidth(0) > 60 ? printf("%3d:%-2d", line('.'), col('.')) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLinePercent()
|
||||
return &ft =~? 'vimfiler' ? '' : (100 * line('.') / line('$')) . '%'
|
||||
endfunction
|
||||
|
||||
function! LightLineFugitive()
|
||||
return exists('*fugitive#head') ? fugitive#head() : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
let fname = expand('%:t')
|
||||
return fname == 'ControlP' ? 'CtrlP' :
|
||||
\ &ft == 'vimfiler' ? 'VimFiler' :
|
||||
\ winwidth(0) > 60 ? lightline#mode() : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFilename()
|
||||
let fname = expand('%:t')
|
||||
if mode() == 't'
|
||||
return ''
|
||||
endif
|
||||
|
||||
return fname == 'ControlP' ? g:lightline.ctrlp_item :
|
||||
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
|
||||
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
|
||||
\ ('' != fname ? fname : '[No Name]')
|
||||
endfunction
|
||||
|
||||
function! LightLineReadonly()
|
||||
return &ft !~? 'help' && &readonly ? 'RO' : ''
|
||||
endfunction
|
||||
|
||||
function! CtrlPMark()
|
||||
if expand('%:t') =~ 'ControlP'
|
||||
call lightline#link('iR'[g:lightline.ctrlp_regex])
|
||||
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
|
||||
\ , g:lightline.ctrlp_next], 0)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:ctrlp_status_func = {
|
||||
\ 'main': 'CtrlPStatusFunc_1',
|
||||
\ 'prog': 'CtrlPStatusFunc_2',
|
||||
\ }
|
||||
|
||||
" ==================== PLUGIN: NerdTree ====================
|
||||
" For toggling
|
||||
nmap <C-n> :NERDTreeToggle<CR>
|
||||
nmap <F7> :NERDTreeToggle<CR>
|
||||
noremap <Leader>n :NERDTreeToggle<cr>
|
||||
noremap <Leader>f :NERDTreeFind<cr>
|
||||
|
||||
let NERDTreeShowHidden=1
|
||||
|
||||
let NERDTreeIgnore=['\.vim$', '\~$', '\.git$', '.DS_Store']
|
||||
|
||||
" Close nerdtree and vim on close file
|
||||
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
|
||||
|
||||
" ==================== Base64 de- and encoding ====================
|
||||
let g:indentLine_enabled = 0
|
||||
let g:indentLine_char = '┊'
|
||||
nmap <leader>il :IndentLinesToggle<cr>
|
||||
|
||||
" ==================== Base64 de- and encoding ====================
|
||||
vnoremap <leader>b64d y:let @"=system('base64 -w 0 --decode', @")<cr>gvP
|
||||
vnoremap <leader>b64e y:let @"=system('base64 -w 0', @")<cr>gvP
|
||||
|
||||
" vim:ts=2:sw=2:et
|
27
dotfiles/xorg/dot-xprofile
Normal file
27
dotfiles/xorg/dot-xprofile
Normal file
|
@ -0,0 +1,27 @@
|
|||
## Start Keyring-Daemon
|
||||
#eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
|
||||
#export SSH_AUTH_SOCK
|
||||
|
||||
## Import exports
|
||||
source ~/.exports
|
||||
|
||||
## Setup resources
|
||||
test -f ~/.local/Xresources && xrdb -merge ~/.local/Xresources
|
||||
|
||||
## Setup Screen
|
||||
test -x ~/.screenlayout/.default && ~/.screenlayout/.default
|
||||
test -x ~/.fehbg && ~/.fehbg
|
||||
|
||||
## Setup Keyboard
|
||||
case $HOSTNAME in
|
||||
*"gpd"*)
|
||||
xmodmap -e 'keycode 49 = Multi_key' # Kanji-key
|
||||
xmodmap -e 'keycode 132 = grave asciitilde' # grave-key
|
||||
xmodmap -e 'keycode 29 = z Z z Z' # y-z
|
||||
xmodmap -e 'keycode 52 = y Y y Y' # z-y
|
||||
;;
|
||||
*)
|
||||
xmodmap -e 'keycode 135 = Multi_key' # remaps context-menu-key to Compose
|
||||
;;
|
||||
esac
|
||||
|
46
dotfiles/xorg/xprofile+gpdp2
Normal file
46
dotfiles/xorg/xprofile+gpdp2
Normal file
|
@ -0,0 +1,46 @@
|
|||
## Start Keyring-Daemon
|
||||
eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
|
||||
export SSH_AUTH_SOCK
|
||||
|
||||
## Import exports
|
||||
source ~/.exports
|
||||
|
||||
## Setup Keyboard
|
||||
xmodmap -e 'keycode 49 = Multi_key' # Kanji-key
|
||||
xmodmap -e 'keycode 132 = grave asciitilde' # grave-key
|
||||
xmodmap -e 'keycode 29 = z Z z Z' # y-z
|
||||
xmodmap -e 'keycode 52 = y Y y Y' # z-y
|
||||
|
||||
## Setup resources
|
||||
test -f ~/.local/Xresources && xrdb -merge ~/.local/Xresources
|
||||
|
||||
## Setup Screen
|
||||
test -x ~/.screenlayout/.default && ~/.screenlayout/.default
|
||||
test -x ~/.fehbg && ~/.fehbg
|
||||
|
||||
|
||||
|
||||
|
||||
## Start Keyring-Daemon
|
||||
eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
|
||||
export SSH_AUTH_SOCK
|
||||
## Start Keyring-Daemon
|
||||
#eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
|
||||
#export SSH_AUTH_SOCK
|
||||
|
||||
## Import exports
|
||||
source ~/.exports
|
||||
|
||||
## Setup Keyboard
|
||||
xmodmap -e 'keycode 135 = Multi_key' # remaps context-menu-key to Compose
|
||||
|
||||
## Setup resources
|
||||
test -f ~/.local/Xresources && xrdb -merge ~/.local/Xresources
|
||||
|
||||
## Setup Screen
|
||||
test -x ~/.screenlayout/.default && ~/.screenlayout/.default
|
||||
test -x ~/.fehbg && ~/.fehbg
|
||||
|
||||
## Add fonts
|
||||
xset fp+ /usr/share/fonts/3270
|
||||
|
220
system/arch/README.md
Normal file
220
system/arch/README.md
Normal file
|
@ -0,0 +1,220 @@
|
|||
# Arch Linux system Setup
|
||||
|
||||
How my systems are set up.
|
||||
|
||||
|
||||
## Preparation
|
||||
|
||||
- Download Arch Linux ISO image
|
||||
- Write it to an usb drive with
|
||||
```
|
||||
$ dd if=[ARCH-LINUX.iso] of=[/path/to/usbdrive]
|
||||
```
|
||||
- Boot the computer from this stick
|
||||
|
||||
## Prepare the disk
|
||||
We will partition the disk drive for UEFI boot.
|
||||
The root disk will be encrypted, /boot will reside inside the unencrypted EFI service partition.
|
||||
The diskdevice is /dev/sda.
|
||||
|
||||
### Partition the disk
|
||||
- Write some zeros to the disk to make sure there is no bootsector left.
|
||||
```
|
||||
$ dd if=/dev/zero of=/dev/sda
|
||||
```
|
||||
- Abort after a few seconds.
|
||||
- Create partitions and format them
|
||||
```
|
||||
$ gdisk /dev/sda
|
||||
| o [ENTER] to create a new empty GUID partition table (GPT)
|
||||
| y [ENTER] to confirm
|
||||
|
|
||||
| n [ENTER] add a new partition
|
||||
| [ENTER] to select default partition number of 1
|
||||
| [ENTER] to select default start at first sector
|
||||
| +512M [ENTER] make that size partition for booting
|
||||
| ef00 [ENTER] EFI partition type
|
||||
|
|
||||
| n [ENTER] add a new partition
|
||||
| [ENTER] to select default partition number of 2
|
||||
| [ENTER] to select default start at first sector
|
||||
| +60G [ENTER] allocate whatever size wanted for linux
|
||||
|
|
||||
| w [ENTER] Write changes
|
||||
| y [ENTER] confirm
|
||||
```
|
||||
|
||||
### Encrypt the root partition
|
||||
- Create and open the root partition
|
||||
```
|
||||
$ cryptsetup luksFormat -v -s 512 -h sha512 /dev/sda2
|
||||
$ cryptsetup open /dev/sda2 cryptroot
|
||||
```
|
||||
- Format with ext4
|
||||
```
|
||||
$ mkfs.ext4 /dev/mapper/cryptroot
|
||||
```
|
||||
- Mount the encrypted volume
|
||||
```
|
||||
$ mount /dev/mapper/cryptroot /mnt
|
||||
```
|
||||
|
||||
### Mount the /boot partition
|
||||
```
|
||||
$ mkfs.fat -F32 /dev/sda1
|
||||
$ mkdir /mnt/boot
|
||||
$ mount /dev/sda1 /mnt/boot
|
||||
```
|
||||
|
||||
## Install the base-system
|
||||
- Connect to wifi
|
||||
```
|
||||
$ systemctl start idw.service
|
||||
$ iwctl
|
||||
| [iwd]# station list
|
||||
| Devices in Station Mode *
|
||||
| --------------------------------------------------------------------------------
|
||||
| Name State Scanning
|
||||
| --------------------------------------------------------------------------------
|
||||
| wlan0 disconnected
|
||||
|
|
||||
| [iwd]# station wlan0 scan
|
||||
| [iwd]# station wlan0 get-networks
|
||||
| Available networks *
|
||||
| --------------------------------------------------------------------------------
|
||||
| Network name Security Signal
|
||||
| --------------------------------------------------------------------------------
|
||||
| MagentaWLAN-49XA psk ****
|
||||
| Vodafone-8154 psk ****
|
||||
| .....
|
||||
|
|
||||
| [iwd]# station wlan0 connect "SSID"
|
||||
| Type the network passphrase for SSID
|
||||
| Passphrase: ********
|
||||
|
|
||||
```
|
||||
- Select a nearby (possibly faster) mirror by editing /etc/pacman.d/mirrorlist
|
||||
- Install the base-system
|
||||
```
|
||||
$ pacstrap /mnt base \
|
||||
ansible \
|
||||
base-devel \
|
||||
dialog \
|
||||
git \
|
||||
intel-ucode \
|
||||
linux \
|
||||
linux-firmware \
|
||||
netctl \
|
||||
openssl-1.0 \
|
||||
stow \
|
||||
vim \
|
||||
wpa_supplicant \
|
||||
```
|
||||
- Generate fstab for the new system
|
||||
```
|
||||
$ genfstab -pU /mnt >> /mnt/etc/fstab
|
||||
```
|
||||
|
||||
## Configure the new system
|
||||
- Chroot into the new system
|
||||
```
|
||||
$ arch-chroot /mnt /bin/bash
|
||||
```
|
||||
- Set the hostname
|
||||
```
|
||||
$ echo MYHOSTNAME > /etc/hostname
|
||||
```
|
||||
- Edit /etc/vconsole.conf to set keyboard and font
|
||||
```
|
||||
$ vi /etc/vconsole.conf
|
||||
FONT=latarcyrheb-sun32
|
||||
KEYMAP=de
|
||||
```
|
||||
The FONT setting is optional. latarcyrheb-sun32 is useful for small hidpi devices like GPD Pocket.
|
||||
- Add encryption components to initramfs
|
||||
```
|
||||
$ vi /etc/mkinitcpio.conf
|
||||
...
|
||||
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt
|
||||
filesystems fsck)
|
||||
...
|
||||
$ mkinitcpio -P
|
||||
```
|
||||
- Install bootloader
|
||||
```
|
||||
$ bootctl install
|
||||
```
|
||||
- Configure the bootloader
|
||||
```
|
||||
$ vi /boot/loader/loader.conf
|
||||
default arch
|
||||
auto-firmware no
|
||||
timeout 0
|
||||
console-mode 2
|
||||
editor no
|
||||
```
|
||||
- Configure the bootloader entry
|
||||
```
|
||||
$ blkid | grep sda2 | cut -d \" -f 2 > /boot/loader/entries/arch.conf
|
||||
$ vi /boot/loader/arch.conf
|
||||
title Arch Linux
|
||||
linux /vmlinuz-linux
|
||||
initrd /intel-ucode.img
|
||||
initrd /initramfs-linux.img
|
||||
options cryptdevice=UUID=[DEVICE-UUID]:cryptroot root=/dev/mapper/cryptroot rw
|
||||
fbcon=rotate:1
|
||||
```
|
||||
DEVICE-UUID is the string we added with the first command.
|
||||
fbcon=rotate:1 rotates the display. This is ONLY NEEDED on device like GPD Pocket.
|
||||
|
||||
## More configuration
|
||||
- Perform basic systemconfiguration
|
||||
```
|
||||
$ git clone https://github.com/elfrinjo/syssetup
|
||||
$ cd syssetup/dotfiles
|
||||
$ stow */
|
||||
$ cd ../system/arch
|
||||
$ sudo ansible-playbook baseconfig.yaml
|
||||
```
|
||||
- Change the root password
|
||||
```
|
||||
$ passwd
|
||||
```
|
||||
- Create useraccount
|
||||
```
|
||||
$ useradd -m -G sudo [USERNAME]
|
||||
$ passwd [USERNAME]
|
||||
```
|
||||
- Exit the chroot
|
||||
```
|
||||
$ exit
|
||||
```
|
||||
- Shutdown the system
|
||||
```
|
||||
$ shutdown -h now
|
||||
```
|
||||
- Remove usb-drive
|
||||
- Start the computer
|
||||
- Enter drive encryption password
|
||||
- Logon as the newly created user
|
||||
- Connect to wifi
|
||||
```
|
||||
$ sudo wifi-menu
|
||||
```
|
||||
- Perform more system configuration
|
||||
```
|
||||
$ git clone https://github.com/elfrinjo/dotfiles
|
||||
$ cd syssetup/dotfiles
|
||||
$ stow */
|
||||
$ cd ../system/arch
|
||||
$ sudo ansible-playbook workstation.yaml
|
||||
```
|
||||
- At some point the Desktop will start. When this happens, just log on and continue inside a terminal
|
||||
- Update the system
|
||||
```
|
||||
$ pacman -Syu
|
||||
```
|
||||
- Reboot
|
||||
```
|
||||
$ reboot
|
||||
```
|
142
system/arch/baseconfig.yaml
Normal file
142
system/arch/baseconfig.yaml
Normal file
|
@ -0,0 +1,142 @@
|
|||
- name: "Base config for all arch hosts"
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
tasks:
|
||||
|
||||
- name: "Install base packages"
|
||||
package:
|
||||
name:
|
||||
- fortune-mod
|
||||
- git
|
||||
- make
|
||||
- openssh
|
||||
- pass
|
||||
- pass-otp
|
||||
- rsync
|
||||
- sudo
|
||||
- vim
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: "Remove unwanted packages"
|
||||
package:
|
||||
name:
|
||||
- puppet
|
||||
state: absent
|
||||
update_cache: false
|
||||
|
||||
- name: "Console settings"
|
||||
when: "'gpd' not in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/vconsole.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
KEYMAP=de-latin1-nodeadkeys
|
||||
|
||||
- name: "Console settings (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/vconsole.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
KEYMAP=de-latin1-nodeadkeys
|
||||
FONT=latarcyrheb-sun32
|
||||
|
||||
- name: "Localization: Set papersize"
|
||||
copy:
|
||||
dest: /etc/papersize
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
a4
|
||||
|
||||
- name: "Localization: Set timezone"
|
||||
file:
|
||||
dest: /etc/localtime
|
||||
src: /usr/share/zoneinfo/Europe/Berlin
|
||||
state: link
|
||||
|
||||
- name: "Localization: locale.conf"
|
||||
copy:
|
||||
dest: /etc/locale.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
LANG=de_DE.UTF-8
|
||||
LC_MESSAGES=en_US.UTF-8
|
||||
LC_COLLATE=C
|
||||
LC_CTYPE=de_DE.UTF-8
|
||||
LC_NUMERIC=de_DE.UTF-8
|
||||
LC_TIME=de_DE.UTF-8
|
||||
LC_MONETARY=de_DE.UTF-8
|
||||
LC_PAPER=de_DE.UTF-8
|
||||
LC_NAME=de_DE.UTF-8
|
||||
LC_ADDRESS=de_DE.UTF-8
|
||||
LC_TELEPHONE=de_DE.UTF-8
|
||||
LC_MEASUREMENT=de_DE.UTF-8
|
||||
LC_IDENTIFICATION=de_DE.UTF-8
|
||||
|
||||
- name: "Localization: locale.gen"
|
||||
register: locale_gen
|
||||
copy:
|
||||
dest: /etc/locale.gen
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
de_DE.UTF-8 UTF-8
|
||||
en_US.UTF-8 UTF-8
|
||||
|
||||
- name: "Localization: Regenerate locale"
|
||||
command: "/usr/bin/locale-gen"
|
||||
when: locale_gen.changed
|
||||
|
||||
- name: "Use systemd-timesyncd"
|
||||
service:
|
||||
name: systemd-timesyncd
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: "Sudo: config file"
|
||||
copy:
|
||||
dest: /etc/sudoers
|
||||
src: ./lib/etc/sudoers
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
|
||||
- name: "Sudo: Create groups"
|
||||
group:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
system: true
|
||||
with_items:
|
||||
- wheel
|
||||
- sudo
|
||||
|
||||
- name: "Pacman configuration"
|
||||
when: "'arm' not in ansible_machine"
|
||||
copy:
|
||||
dest: /etc/pacman.conf
|
||||
src: ./lib/etc/pacman.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Pacman configuration (ARM)"
|
||||
when: "'arm' in ansible_machine"
|
||||
copy:
|
||||
dest: /etc/pacman.conf
|
||||
src: ./lib/etc/pacman.conf.arm
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
1
system/arch/lib/etc/X11/Xresources.gpdp2
Normal file
1
system/arch/lib/etc/X11/Xresources.gpdp2
Normal file
|
@ -0,0 +1 @@
|
|||
Xft.dpi: 200
|
8
system/arch/lib/etc/X11/xorg.conf.d/00-keyboard.conf
Normal file
8
system/arch/lib/etc/X11/xorg.conf.d/00-keyboard.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
Section "InputClass"
|
||||
Identifier "system-keyboard"
|
||||
MatchIsKeyboard "on"
|
||||
Option "XkbLayout" "de"
|
||||
Option "XkbVariant" "nodeadkeys"
|
||||
Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
||||
EndSection
|
|
@ -0,0 +1,6 @@
|
|||
##### THIS IS MANAGED BY PUPPET #####
|
||||
Section "InputClass"
|
||||
Identifier "system-keyboard"
|
||||
MatchIsKeyboard "on"
|
||||
Option "XkbLayout" "us"
|
||||
EndSection
|
7
system/arch/lib/etc/X11/xorg.conf.d/20-intel.conf.gpdp2
Normal file
7
system/arch/lib/etc/X11/xorg.conf.d/20-intel.conf.gpdp2
Normal file
|
@ -0,0 +1,7 @@
|
|||
Section "Device"
|
||||
Identifier "Intel Graphics"
|
||||
Driver "intel"
|
||||
Option "AccelMethod" "sna"
|
||||
Option "TearFree" "true"
|
||||
Option "DRI" "3"
|
||||
EndSection
|
|
@ -0,0 +1,5 @@
|
|||
Section "Monitor"
|
||||
Identifier "eDP1"
|
||||
Option "Rotate" "right"
|
||||
DisplaySize 151 95
|
||||
EndSection
|
13
system/arch/lib/etc/X11/xorg.conf.d/50-touchpad.conf
Normal file
13
system/arch/lib/etc/X11/xorg.conf.d/50-touchpad.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
Section "InputClass"
|
||||
Identifier "libinput touchpad"
|
||||
MatchIsTouchpad "on"
|
||||
Driver "libinput"
|
||||
Option "Tapping" "on"
|
||||
Option "TappingDrag" "on"
|
||||
Option "TappingDragLock" "on"
|
||||
Option "DisableWhileTyping" "on"
|
||||
Option "NaturalScrolling" "true"
|
||||
Option "AccelSpeed" "1.1"
|
||||
#Option "ScrollMethod" "edge"
|
||||
EndSection
|
|
@ -0,0 +1,5 @@
|
|||
Section "InputClass"
|
||||
Identifier "calibration"
|
||||
MatchProduct "Goodix Capacitive TouchScreen"
|
||||
Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
|
||||
EndSection
|
400
system/arch/lib/etc/default/tlp
Normal file
400
system/arch/lib/etc/default/tlp
Normal file
|
@ -0,0 +1,400 @@
|
|||
##### THIS FILE IS MANAGED BY ANSIBLE #####
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# tlp - Parameters for power saving
|
||||
# See full explanation: https://linrunner.de/en/tlp/docs/tlp-configuration.html
|
||||
|
||||
# Notes:
|
||||
# - Some parameters are disabled, remove the leading '#' to enable # them;
|
||||
# shown values are suggestions not defaults
|
||||
# - Default *: intrinsic default that is effective when the parameter is missing
|
||||
# or disabled by a leading '#'; use PARAM="" to disable intrinsic defaults for
|
||||
# parameters with text string values
|
||||
# - Default <none>: do nothing or use kernel/hardware defaults
|
||||
|
||||
# Set to 0 to disable, 1 to enable TLP.
|
||||
# Default: 0
|
||||
TLP_ENABLE=1
|
||||
|
||||
# Operation mode when no power supply can be detected: AC, BAT.
|
||||
# Concerns some desktop and embedded hardware only.
|
||||
# Default: <none>
|
||||
TLP_DEFAULT_MODE=AC
|
||||
|
||||
# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
|
||||
# Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
|
||||
# Default: 0
|
||||
TLP_PERSISTENT_DEFAULT=0
|
||||
|
||||
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
|
||||
# Non-zero value enables, zero disables laptop mode.
|
||||
# Default: 0 (AC), 2 (BAT)
|
||||
DISK_IDLE_SECS_ON_AC=0
|
||||
DISK_IDLE_SECS_ON_BAT=2
|
||||
|
||||
# Dirty page values (timeouts in secs).
|
||||
# Default: 15 (AC + BAT)
|
||||
MAX_LOST_WORK_SECS_ON_AC=15
|
||||
MAX_LOST_WORK_SECS_ON_BAT=60
|
||||
|
||||
# Note: CPU parameters below are disabled by default, remove the leading #
|
||||
# to enable them, otherwise kernel defaults will be used.
|
||||
|
||||
# Select a CPU frequency scaling governor.
|
||||
# Intel Core i processor with intel_pstate driver:
|
||||
# powersave(*), performance.
|
||||
# Older hardware with acpi-cpufreq driver:
|
||||
# ondemand(*), powersave, performance, conservative, schedutil.
|
||||
# (*) is recommended.
|
||||
# Use tlp-stat -p to show the active driver and available governors.
|
||||
# Important:
|
||||
# powersave for intel_pstate and ondemand for acpi-cpufreq are power
|
||||
# efficient for *almost all* workloads and therefore kernel and most
|
||||
# distributions have chosen them as defaults. If you still want to change,
|
||||
# you should know what you're doing! You *must* disable your distribution's
|
||||
# governor settings or conflicts will occur.
|
||||
# Default: <none>
|
||||
#CPU_SCALING_GOVERNOR_ON_AC=powersave
|
||||
#CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
||||
|
||||
# Set the min/max frequency available for the scaling governor.
|
||||
# Possible values depend on your CPU. For available frequencies see
|
||||
# the output of tlp-stat -p.
|
||||
# Default: <none>
|
||||
#CPU_SCALING_MIN_FREQ_ON_AC=0
|
||||
#CPU_SCALING_MAX_FREQ_ON_AC=0
|
||||
#CPU_SCALING_MIN_FREQ_ON_BAT=0
|
||||
#CPU_SCALING_MAX_FREQ_ON_BAT=0
|
||||
|
||||
# Set energy performance hints (HWP) for Intel P-state governor:
|
||||
# performance, balance_performance, default, balance_power, power
|
||||
# Values are given in order of increasing power saving.
|
||||
# Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
|
||||
# Default: <none>
|
||||
CPU_HWP_ON_AC=balance_performance
|
||||
CPU_HWP_ON_BAT=balance_power
|
||||
|
||||
# Set Intel P-state performance: 0..100 (%).
|
||||
# Limit the max/min P-state to control the power dissipation of the CPU.
|
||||
# Values are stated as a percentage of the available performance.
|
||||
# Requires an Intel Core i processor with intel_pstate driver.
|
||||
# Default: <none>
|
||||
#CPU_MIN_PERF_ON_AC=0
|
||||
#CPU_MAX_PERF_ON_AC=100
|
||||
#CPU_MIN_PERF_ON_BAT=0
|
||||
#CPU_MAX_PERF_ON_BAT=30
|
||||
|
||||
# Set the CPU "turbo boost" feature: 0=disable, 1=allow
|
||||
# Requires an Intel Core i processor.
|
||||
# Important:
|
||||
# - This may conflict with your distribution's governor settings
|
||||
# - A value of 1 does *not* activate boosting, it just allows it
|
||||
# Default: <none>
|
||||
#CPU_BOOST_ON_AC=1
|
||||
#CPU_BOOST_ON_BAT=0
|
||||
|
||||
# Minimize number of used CPU cores/hyper-threads under light load conditions:
|
||||
# 0=disable, 1=enable.
|
||||
# Default: <none>
|
||||
SCHED_POWERSAVE_ON_AC=0
|
||||
SCHED_POWERSAVE_ON_BAT=1
|
||||
|
||||
# Kernel NMI Watchdog:
|
||||
# 0=disable (default, saves power), 1=enable (for kernel debugging only).
|
||||
# Default: <none>
|
||||
NMI_WATCHDOG=0
|
||||
|
||||
# Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
|
||||
# Frequency voltage pairs are written to:
|
||||
# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
|
||||
# CAUTION: only use this, if you thoroughly understand what you are doing!
|
||||
# Default: <none>.
|
||||
#PHC_CONTROLS="F:V F:V F:V F:V"
|
||||
|
||||
# Set CPU performance versus energy savings policy:
|
||||
# performance, balance-performance, default, balance-power, power.
|
||||
# Values are given in order of increasing power saving.
|
||||
# Requires kernel module msr and x86_energy_perf_policy from linux-tools.
|
||||
# Default: <none>
|
||||
ENERGY_PERF_POLICY_ON_AC=performance
|
||||
ENERGY_PERF_POLICY_ON_BAT=power
|
||||
|
||||
# Disk devices; separate multiple devices with spaces.
|
||||
# Devices can be specified by disk ID also (lookup with: tlp diskid).
|
||||
# Note: DISK parameters below are effective only when this option is configured.
|
||||
# Default: "nvme0n1 sda"
|
||||
DISK_DEVICES="nvme0n1 sda mmcblk0"
|
||||
|
||||
# Disk advanced power management level: 1..254, 255 (max saving, min, off).
|
||||
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
|
||||
# Separate values for multiple disks with spaces. Use the special value 'keep'
|
||||
# to keep the hardware default for the particular disk.
|
||||
# Default: <none>
|
||||
DISK_APM_LEVEL_ON_AC="254 254"
|
||||
DISK_APM_LEVEL_ON_BAT="128 128"
|
||||
|
||||
# Hard disk spin down timeout:
|
||||
# 0: spin down disabled
|
||||
# 1..240: timeouts from 5s to 20min (in units of 5s)
|
||||
# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
|
||||
# See 'man hdparm' for details.
|
||||
# Separate values for multiple disks with spaces. Use the special value 'keep'
|
||||
# to keep the hardware default for the particular disk.
|
||||
# Default: <none>
|
||||
#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
|
||||
#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
|
||||
|
||||
# Select I/O scheduler for the disk devices.
|
||||
# Multi queue (blk-mq) schedulers:
|
||||
# mq-deadline(*), none, kyber, bfq
|
||||
# Single queue schedulers:
|
||||
# deadline(*), cfq, bfq, noop
|
||||
# (*) recommended.
|
||||
# Separate values for multiple disks with spaces. Use the special value 'keep'
|
||||
# to keep the kernel default scheduler for the particular disk.
|
||||
# Notes:
|
||||
# - Multi queue (blk-mq) may need kernel boot option 'scsi_mod.use_blk_mq=1'
|
||||
# and 'modprobe mq-deadline-iosched|kyber|bfq' on kernels < 5.0
|
||||
# - Single queue schedulers are legacy now and were removed together with
|
||||
# the old block layer in kernel 5.0
|
||||
# Default: keep
|
||||
#DISK_IOSCHED="mq-deadline mq-deadline"
|
||||
|
||||
# AHCI link power management (ALPM) for disk devices:
|
||||
# min_power, med_power_with_dipm(*), medium_power, max_performance.
|
||||
# (*) Kernel >= 4.15 required, then recommended.
|
||||
# Multiple values separated with spaces are tried sequentially until success.
|
||||
# Default: <none>
|
||||
SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
|
||||
SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
|
||||
|
||||
# Exclude host devices from AHCI link power management.
|
||||
# Separate multiple hosts with spaces.
|
||||
# Default: <none>
|
||||
#SATA_LINKPWR_BLACKLIST="host1"
|
||||
|
||||
# Runtime Power Management for AHCI host and disks devices:
|
||||
# on=disable, auto=enable.
|
||||
# EXPERIMENTAL ** WARNING: auto may cause system lockups/data loss.
|
||||
# Default: <none>
|
||||
#AHCI_RUNTIME_PM_ON_AC=on
|
||||
#AHCI_RUNTIME_PM_ON_BAT=on
|
||||
|
||||
# Seconds of inactivity before disk is suspended.
|
||||
# Note: effective only when AHCI_RUNTIME_PM_ON_AC/BAT is activated.
|
||||
# Default: 15
|
||||
AHCI_RUNTIME_PM_TIMEOUT=15
|
||||
|
||||
# PCI Express Active State Power Management (PCIe ASPM):
|
||||
# default(*), performance, powersave.
|
||||
# (*) keeps BIOS ASPM defaults (recommended)
|
||||
# Default: <none>
|
||||
#PCIE_ASPM_ON_AC=default
|
||||
#PCIE_ASPM_ON_BAT=default
|
||||
|
||||
# Set the min/max/turbo frequency for the Intel GPU.
|
||||
# Possible values depend on your hardware. For available frequencies see
|
||||
# the output of tlp-stat -g.
|
||||
# Default: <none>
|
||||
#INTEL_GPU_MIN_FREQ_ON_AC=0
|
||||
#INTEL_GPU_MIN_FREQ_ON_BAT=0
|
||||
#INTEL_GPU_MAX_FREQ_ON_AC=0
|
||||
#INTEL_GPU_MAX_FREQ_ON_BAT=0
|
||||
#INTEL_GPU_BOOST_FREQ_ON_AC=0
|
||||
#INTEL_GPU_BOOST_FREQ_ON_BAT=0
|
||||
|
||||
# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
|
||||
# auto = mid on BAT, high on AC.
|
||||
# Default: default
|
||||
RADEON_POWER_PROFILE_ON_AC=default
|
||||
RADEON_POWER_PROFILE_ON_BAT=default
|
||||
|
||||
# Radeon dynamic power management method (DPM): battery, performance.
|
||||
# Default: <none>
|
||||
RADEON_DPM_STATE_ON_AC=performance
|
||||
RADEON_DPM_STATE_ON_BAT=battery
|
||||
|
||||
# Radeon DPM performance level: auto, low, high; auto is recommended.
|
||||
# Note: effective only when RADEON_DPM_STATE_ON_AC/BAT is activated.
|
||||
# Default: auto
|
||||
RADEON_DPM_PERF_LEVEL_ON_AC=auto
|
||||
RADEON_DPM_PERF_LEVEL_ON_BAT=auto
|
||||
|
||||
# WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
|
||||
# Default: <none>
|
||||
WIFI_PWR_ON_AC=off
|
||||
WIFI_PWR_ON_BAT=on
|
||||
|
||||
# Disable wake on LAN: Y/N.
|
||||
# Default: N
|
||||
WOL_DISABLE=Y
|
||||
|
||||
# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
|
||||
# A value of 0 disables, >=1 enables power saving (recommended: 1).
|
||||
# Default: <none>
|
||||
SOUND_POWER_SAVE_ON_AC=0
|
||||
SOUND_POWER_SAVE_ON_BAT=1
|
||||
|
||||
# Disable controller too (HDA only): Y/N.
|
||||
# Note: effective only when SOUND_POWER_SAVE_ON_AC/BAT is activated.
|
||||
# Default: Y
|
||||
SOUND_POWER_SAVE_CONTROLLER=Y
|
||||
|
||||
# Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
|
||||
# Drive can be powered on again by releasing (and reinserting) the eject lever
|
||||
# or by pressing the disc eject button on newer models.
|
||||
# Note: an UltraBay/MediaBay hard disk is never powered off.
|
||||
# Default: 0
|
||||
BAY_POWEROFF_ON_AC=0
|
||||
BAY_POWEROFF_ON_BAT=0
|
||||
# Optical drive device to power off
|
||||
# Default: sr0
|
||||
BAY_DEVICE="sr0"
|
||||
|
||||
# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
|
||||
# Default: <none>
|
||||
RUNTIME_PM_ON_AC=on
|
||||
RUNTIME_PM_ON_BAT=auto
|
||||
|
||||
# Exclude PCI(e) device adresses the following list from Runtime PM
|
||||
# (separate with spaces). Use lspci to get the adresses (1st column).
|
||||
# Default: <none>
|
||||
#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
|
||||
|
||||
# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
|
||||
# Default when unconfigured is "amdgpu nouveau nvidia radeon" which
|
||||
# prevents accidential power-on of dGPU in hybrid graphics setups.
|
||||
# Separate multiple drivers with spaces.
|
||||
# Default: "amdgpu mei_me nouveau nvidia pcieport radeon", use "" to disable
|
||||
# completely.
|
||||
#RUNTIME_PM_DRIVER_BLACKLIST="amdgpu mei_me nouveau nvidia pcieport radeon"
|
||||
|
||||
# Set to 0 to disable, 1 to enable USB autosuspend feature.
|
||||
# Default: 0
|
||||
USB_AUTOSUSPEND=1
|
||||
|
||||
# Exclude listed devices from USB autosuspend (separate with spaces).
|
||||
# Use lsusb to get the ids.
|
||||
# Note: input devices (usbhid) are excluded automatically
|
||||
# Default: <none>
|
||||
#USB_BLACKLIST="1111:2222 3333:4444"
|
||||
|
||||
# Bluetooth devices are excluded from USB autosuspend:
|
||||
# 0=do not exclude, 1=exclude.
|
||||
# Default: 0
|
||||
USB_BLACKLIST_BTUSB=0
|
||||
|
||||
# Phone devices are excluded from USB autosuspend:
|
||||
# 0=do not exclude, 1=exclude (enable charging).
|
||||
# Default: 0
|
||||
USB_BLACKLIST_PHONE=0
|
||||
|
||||
# Printers are excluded from USB autosuspend:
|
||||
# 0=do not exclude, 1=exclude.
|
||||
# Default: 1
|
||||
USB_BLACKLIST_PRINTER=1
|
||||
|
||||
# WWAN devices are excluded from USB autosuspend:
|
||||
# 0=do not exclude, 1=exclude.
|
||||
# Default: 0
|
||||
USB_BLACKLIST_WWAN=0
|
||||
|
||||
# Include listed devices into USB autosuspend even if already excluded
|
||||
# by the blacklists above (separate with spaces). Use lsusb to get the ids.
|
||||
# Default: <none>
|
||||
#USB_WHITELIST="1111:2222 3333:4444"
|
||||
|
||||
# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
|
||||
# (workaround for USB devices that cause shutdown problems).
|
||||
# Default: 0
|
||||
#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
|
||||
|
||||
# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
|
||||
# on system startup: 0=disable, 1=enable.
|
||||
# Note: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
|
||||
# are ignored when this is enabled.
|
||||
# Default: 0
|
||||
RESTORE_DEVICE_STATE_ON_STARTUP=0
|
||||
|
||||
# Radio devices to disable on startup: bluetooth, wifi, wwan.
|
||||
# Separate multiple devices with spaces.
|
||||
# Default: <none>
|
||||
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
|
||||
|
||||
# Radio devices to enable on startup: bluetooth, wifi, wwan.
|
||||
# Separate multiple devices with spaces.
|
||||
# Default: <none>
|
||||
#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
|
||||
|
||||
# Radio devices to disable on shutdown: bluetooth, wifi, wwan.
|
||||
# (workaround for devices that are blocking shutdown).
|
||||
# Default: <none>
|
||||
#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
|
||||
|
||||
# Radio devices to enable on shutdown: bluetooth, wifi, wwan.
|
||||
# (to prevent other operating systems from missing radios).
|
||||
# Default: <none>
|
||||
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
|
||||
|
||||
# Radio devices to enable on AC: bluetooth, wifi, wwan.
|
||||
# Default: <none>
|
||||
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
|
||||
|
||||
# Radio devices to disable on battery: bluetooth, wifi, wwan.
|
||||
# Default: <none>
|
||||
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
|
||||
|
||||
# Radio devices to disable on battery when not in use (not connected):
|
||||
# bluetooth, wifi, wwan.
|
||||
# Default: <none>
|
||||
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
|
||||
|
||||
# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
|
||||
# required). Charging starts when the remaining capacity falls below the
|
||||
# START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
|
||||
# Main / Internal battery (values in %)
|
||||
# Default: <none>
|
||||
#START_CHARGE_THRESH_BAT0=75
|
||||
#STOP_CHARGE_THRESH_BAT0=80
|
||||
# Ultrabay / Slice / Replaceable battery (values in %)
|
||||
# Default: <none>
|
||||
#START_CHARGE_THRESH_BAT1=75
|
||||
#STOP_CHARGE_THRESH_BAT1=80
|
||||
|
||||
# Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
|
||||
# Default: 0
|
||||
#RESTORE_THRESHOLDS_ON_BAT=1
|
||||
|
||||
# Battery feature drivers: 0=disable, 1=enable
|
||||
# Default: 1 (all)
|
||||
NATACPI_ENABLE=1
|
||||
TPACPI_ENABLE=1
|
||||
TPSMAPI_ENABLE=1
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# tlp-rdw - Parameters for the radio device wizard
|
||||
# Possible devices: bluetooth, wifi, wwan.
|
||||
|
||||
# Notes:
|
||||
# - Parameters are disabled by default, remove the leading # to enable them
|
||||
# - Separate multiple radio devices with spaces
|
||||
|
||||
# Default: <none> (for all parameters below)
|
||||
|
||||
# Radio devices to disable on connect.
|
||||
#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
|
||||
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
|
||||
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
|
||||
|
||||
# Radio devices to enable on disconnect.
|
||||
#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
|
||||
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
|
||||
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
|
||||
|
||||
# Radio devices to enable/disable when docked.
|
||||
#DEVICES_TO_ENABLE_ON_DOCK=""
|
||||
#DEVICES_TO_DISABLE_ON_DOCK=""
|
||||
|
||||
# Radio devices to enable/disable when undocked.
|
||||
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
|
||||
#DEVICES_TO_DISABLE_ON_UNDOCK=""
|
535
system/arch/lib/etc/libvirt/libvirtd.conf
Normal file
535
system/arch/lib/etc/libvirt/libvirtd.conf
Normal file
|
@ -0,0 +1,535 @@
|
|||
# Master libvirt daemon configuration file
|
||||
#
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Network connectivity controls
|
||||
#
|
||||
|
||||
# Flag listening for secure TLS connections on the public TCP/IP port.
|
||||
#
|
||||
# To enable listening sockets with the 'libvirtd' daemon it's also required to
|
||||
# pass the '--listen' flag on the commandline of the daemon.
|
||||
# This is not needed with 'virtproxyd'.
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# It is necessary to setup a CA and issue server certificates before
|
||||
# using this capability.
|
||||
#
|
||||
# This is enabled by default, uncomment this to disable it
|
||||
#listen_tls = 0
|
||||
|
||||
# Listen for unencrypted TCP connections on the public TCP/IP port.
|
||||
#
|
||||
# To enable listening sockets with the 'libvirtd' daemon it's also required to
|
||||
# pass the '--listen' flag on the commandline of the daemon.
|
||||
# This is not needed with 'virtproxyd'.
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# Using the TCP socket requires SASL authentication by default. Only
|
||||
# SASL mechanisms which support data encryption are allowed. This is
|
||||
# DIGEST_MD5 and GSSAPI (Kerberos5)
|
||||
#
|
||||
# This is disabled by default, uncomment this to enable it.
|
||||
#listen_tcp = 1
|
||||
|
||||
|
||||
|
||||
# Override the port for accepting secure TLS connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
#tls_port = "16514"
|
||||
|
||||
# Override the port for accepting insecure TCP connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
#tcp_port = "16509"
|
||||
|
||||
|
||||
# Override the default configuration which binds to all network
|
||||
# interfaces. This can be a numeric IPv4/6 address, or hostname
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# If the libvirtd service is started in parallel with network
|
||||
# startup (e.g. with systemd), binding to addresses other than
|
||||
# the wildcards (0.0.0.0/::) might not be available yet.
|
||||
#
|
||||
#listen_addr = "192.168.0.1"
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# UNIX socket access controls
|
||||
#
|
||||
|
||||
# Set the UNIX domain socket group ownership. This can be used to
|
||||
# allow a 'trusted' set of users access to management capabilities
|
||||
# without becoming root.
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# This is restricted to 'root' by default.
|
||||
unix_sock_group = "libvirt"
|
||||
|
||||
# Set the UNIX socket permissions for the R/O socket. This is used
|
||||
# for monitoring VM status only
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# Default allows any user. If setting group ownership, you may want to
|
||||
# restrict this too.
|
||||
unix_sock_ro_perms = "0770"
|
||||
|
||||
# Set the UNIX socket permissions for the R/W socket. This is used
|
||||
# for full management of VMs
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# Default allows only root. If PolicyKit is enabled on the socket,
|
||||
# the default will change to allow everyone (eg, 0777)
|
||||
#
|
||||
# If not using PolicyKit and setting group ownership for access
|
||||
# control, then you may want to relax this too.
|
||||
unix_sock_rw_perms = "0770"
|
||||
|
||||
# Set the UNIX socket permissions for the admin interface socket.
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
# Default allows only owner (root), do not change it unless you are
|
||||
# sure to whom you are exposing the access to.
|
||||
#unix_sock_admin_perms = "0700"
|
||||
|
||||
# Set the name of the directory in which sockets will be found/created.
|
||||
#
|
||||
# This setting is not required or honoured if using systemd socket
|
||||
# activation.
|
||||
#
|
||||
#unix_sock_dir = "/run/libvirt"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authentication.
|
||||
#
|
||||
# There are the following choices available:
|
||||
#
|
||||
# - none: do not perform auth checks. If you can connect to the
|
||||
# socket you are allowed. This is suitable if there are
|
||||
# restrictions on connecting to the socket (eg, UNIX
|
||||
# socket permissions), or if there is a lower layer in
|
||||
# the network providing auth (eg, TLS/x509 certificates)
|
||||
#
|
||||
# - sasl: use SASL infrastructure. The actual auth scheme is then
|
||||
# controlled from /etc/sasl2/libvirt.conf. For the TCP
|
||||
# socket only GSSAPI & DIGEST-MD5 mechanisms will be used.
|
||||
# For non-TCP or TLS sockets, any scheme is allowed.
|
||||
#
|
||||
# - polkit: use PolicyKit to authenticate. This is only suitable
|
||||
# for use on the UNIX sockets. The default policy will
|
||||
# require a user to supply their own password to gain
|
||||
# full read/write access (aka sudo like), while anyone
|
||||
# is allowed read/only access.
|
||||
#
|
||||
|
||||
# Set an authentication scheme for UNIX read-only sockets
|
||||
#
|
||||
# By default socket permissions allow anyone to connect
|
||||
#
|
||||
# If libvirt was compiled without support for 'polkit', then
|
||||
# no access control checks are done, but libvirt still only
|
||||
# allows execution of APIs which don't change state.
|
||||
#
|
||||
# If libvirt was compiled with support for 'polkit', then
|
||||
# the libvirt socket will perform a check with polkit after
|
||||
# connections. The default policy still allows any local
|
||||
# user access.
|
||||
#
|
||||
# To restrict monitoring of domains you may wish to either
|
||||
# enable 'sasl' here, or change the polkit policy definition.
|
||||
#auth_unix_ro = "polkit"
|
||||
|
||||
# Set an authentication scheme for UNIX read-write sockets.
|
||||
#
|
||||
# If libvirt was compiled without support for 'polkit', then
|
||||
# the systemd .socket files will use SocketMode=0600 by default
|
||||
# thus only allowing root user to connect, and 'auth_unix_rw'
|
||||
# will default to 'none'.
|
||||
#
|
||||
# If libvirt was compiled with support for 'polkit', then
|
||||
# the systemd .socket files will use SocketMode=0666 which
|
||||
# allows any user to connect and 'auth_unix_rw' will default
|
||||
# to 'polkit'. If you disable use of 'polkit' here, then it
|
||||
# is essential to change the systemd SocketMode parameter
|
||||
# back to 0600, to avoid an insecure configuration.
|
||||
#
|
||||
#auth_unix_rw = "polkit"
|
||||
|
||||
# Change the authentication scheme for TCP sockets.
|
||||
#
|
||||
# If you don't enable SASL, then all TCP traffic is cleartext.
|
||||
# Don't do this outside of a dev/test scenario. For real world
|
||||
# use, always enable SASL and use the GSSAPI or DIGEST-MD5
|
||||
# mechanism in /etc/sasl2/libvirt.conf
|
||||
#auth_tcp = "sasl"
|
||||
|
||||
# Change the authentication scheme for TLS sockets.
|
||||
#
|
||||
# TLS sockets already have encryption provided by the TLS
|
||||
# layer, and limited authentication is done by certificates
|
||||
#
|
||||
# It is possible to make use of any SASL authentication
|
||||
# mechanism as well, by using 'sasl' for this option
|
||||
#auth_tls = "none"
|
||||
|
||||
# Enforce a minimum SSF value for TCP sockets
|
||||
#
|
||||
# The default minimum is currently 56 (single-DES) which will
|
||||
# be raised to 112 in the future.
|
||||
#
|
||||
# This option can be used to set values higher than 112
|
||||
#tcp_min_ssf = 112
|
||||
|
||||
|
||||
# Change the API access control scheme
|
||||
#
|
||||
# By default an authenticated user is allowed access
|
||||
# to all APIs. Access drivers can place restrictions
|
||||
# on this. By default the 'nop' driver is enabled,
|
||||
# meaning no access control checks are done once a
|
||||
# client has authenticated with libvirtd
|
||||
#
|
||||
#access_drivers = [ "polkit" ]
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# TLS x509 certificate configuration
|
||||
#
|
||||
|
||||
# Use of TLS requires that x509 certificates be issued. The default locations
|
||||
# for the certificate files is as follows:
|
||||
#
|
||||
# /etc/pki/CA/cacert.pem - The CA master certificate
|
||||
# /etc/pki/libvirt/servercert.pem - The server certificate signed by cacert.pem
|
||||
# /etc/pki/libvirt/private/serverkey.pem - The server private key
|
||||
#
|
||||
# It is possible to override the default locations by altering the 'key_file',
|
||||
# 'cert_file', and 'ca_file' values and uncommenting them below.
|
||||
#
|
||||
# NB, overriding the default of one location requires uncommenting and
|
||||
# possibly additionally overriding the other settings.
|
||||
#
|
||||
|
||||
# Override the default server key file path
|
||||
#
|
||||
#key_file = "/etc/pki/libvirt/private/serverkey.pem"
|
||||
|
||||
# Override the default server certificate file path
|
||||
#
|
||||
#cert_file = "/etc/pki/libvirt/servercert.pem"
|
||||
|
||||
# Override the default CA certificate path
|
||||
#
|
||||
#ca_file = "/etc/pki/CA/cacert.pem"
|
||||
|
||||
# Specify a certificate revocation list.
|
||||
#
|
||||
# Defaults to not using a CRL, uncomment to enable it
|
||||
#crl_file = "/etc/pki/CA/crl.pem"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authorization controls
|
||||
#
|
||||
|
||||
|
||||
# Flag to disable verification of our own server certificates
|
||||
#
|
||||
# When libvirtd starts it performs some sanity checks against
|
||||
# its own certificates.
|
||||
#
|
||||
# Default is to always run sanity checks. Uncommenting this
|
||||
# will disable sanity checks which is not a good idea
|
||||
#tls_no_sanity_certificate = 1
|
||||
|
||||
# Flag to disable verification of client certificates
|
||||
#
|
||||
# Client certificate verification is the primary authentication mechanism.
|
||||
# Any client which does not present a certificate signed by the CA
|
||||
# will be rejected.
|
||||
#
|
||||
# Default is to always verify. Uncommenting this will disable
|
||||
# verification.
|
||||
#tls_no_verify_certificate = 1
|
||||
|
||||
|
||||
# An access control list of allowed x509 Distinguished Names
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# "C=GB,ST=London,L=London,O=Red Hat,CN=*"
|
||||
#
|
||||
# Any * matches any number of consecutive spaces, like a simplified glob(7).
|
||||
#
|
||||
# The format of the DN for a particular certificate can be queried
|
||||
# using:
|
||||
#
|
||||
# virt-pki-query-dn clientcert.pem
|
||||
#
|
||||
# NB If this is an empty list, no client can connect, so comment out
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no DN's are checked
|
||||
#tls_allowed_dn_list = ["DN1", "DN2"]
|
||||
|
||||
|
||||
# Override the compile time default TLS priority string. The
|
||||
# default is usually "NORMAL" unless overridden at build time.
|
||||
# Only set this is it is desired for libvirt to deviate from
|
||||
# the global default settings.
|
||||
#
|
||||
#tls_priority="NORMAL"
|
||||
|
||||
|
||||
# An access control list of allowed SASL usernames. The format for username
|
||||
# depends on the SASL authentication mechanism. Kerberos usernames
|
||||
# look like username@REALM
|
||||
#
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# "*@EXAMPLE.COM"
|
||||
#
|
||||
# See the g_pattern_match function for the format of the wildcards.
|
||||
#
|
||||
# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
|
||||
#
|
||||
# NB If this is an empty list, no client can connect, so comment out
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no Username's are checked
|
||||
#sasl_allowed_username_list = ["joe@EXAMPLE.COM", "fred@EXAMPLE.COM" ]
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Processing controls
|
||||
#
|
||||
|
||||
# The maximum number of concurrent client connections to allow
|
||||
# over all sockets combined.
|
||||
#max_clients = 5000
|
||||
|
||||
# The maximum length of queue of connections waiting to be
|
||||
# accepted by the daemon. Note, that some protocols supporting
|
||||
# retransmission may obey this so that a later reattempt at
|
||||
# connection succeeds.
|
||||
#max_queued_clients = 1000
|
||||
|
||||
# The maximum length of queue of accepted but not yet
|
||||
# authenticated clients. The default value is 20. Set this to
|
||||
# zero to turn this feature off.
|
||||
#max_anonymous_clients = 20
|
||||
|
||||
# The minimum limit sets the number of workers to start up
|
||||
# initially. If the number of active clients exceeds this,
|
||||
# then more threads are spawned, up to max_workers limit.
|
||||
# Typically you'd want max_workers to equal maximum number
|
||||
# of clients allowed
|
||||
#min_workers = 5
|
||||
#max_workers = 20
|
||||
|
||||
|
||||
# The number of priority workers. If all workers from above
|
||||
# pool are stuck, some calls marked as high priority
|
||||
# (notably domainDestroy) can be executed in this pool.
|
||||
#prio_workers = 5
|
||||
|
||||
# Limit on concurrent requests from a single client
|
||||
# connection. To avoid one client monopolizing the server
|
||||
# this should be a small fraction of the global max_workers
|
||||
# parameter.
|
||||
#max_client_requests = 5
|
||||
|
||||
# Same processing controls, but this time for the admin interface.
|
||||
# For description of each option, be so kind to scroll few lines
|
||||
# upwards.
|
||||
|
||||
#admin_min_workers = 1
|
||||
#admin_max_workers = 5
|
||||
#admin_max_clients = 5
|
||||
#admin_max_queued_clients = 5
|
||||
#admin_max_client_requests = 5
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Logging controls
|
||||
#
|
||||
|
||||
# Logging level: 4 errors, 3 warnings, 2 information, 1 debug
|
||||
# basically 1 will log everything possible
|
||||
#
|
||||
# WARNING: USE OF THIS IS STRONGLY DISCOURAGED.
|
||||
#
|
||||
# WARNING: It outputs too much information to practically read.
|
||||
# WARNING: The "log_filters" setting is recommended instead.
|
||||
#
|
||||
# WARNING: Journald applies rate limiting of messages and so libvirt
|
||||
# WARNING: will limit "log_level" to only allow values 3 or 4 if
|
||||
# WARNING: journald is the current output.
|
||||
#
|
||||
# WARNING: USE OF THIS IS STRONGLY DISCOURAGED.
|
||||
#log_level = 3
|
||||
|
||||
# Logging filters:
|
||||
# A filter allows to select a different logging level for a given category
|
||||
# of logs. The format for a filter is:
|
||||
#
|
||||
# level:match
|
||||
#
|
||||
# where 'match' is a string which is matched against the category
|
||||
# given in the VIR_LOG_INIT() at the top of each libvirt source
|
||||
# file, e.g., "remote", "qemu", or "util.json". The 'match' in the
|
||||
# filter matches using shell wildcard syntax (see 'man glob(7)').
|
||||
# The 'match' is always treated as a substring match. IOW a match
|
||||
# string 'foo' is equivalent to '*foo*'.
|
||||
#
|
||||
# 'level' is the minimal level where matching messages should
|
||||
# be logged:
|
||||
#
|
||||
# 1: DEBUG
|
||||
# 2: INFO
|
||||
# 3: WARNING
|
||||
# 4: ERROR
|
||||
#
|
||||
# Multiple filters can be defined in a single @log_filters, they just need
|
||||
# to be separated by spaces. Note that libvirt performs "first" match, i.e.
|
||||
# if there are concurrent filters, the first one that matches will be applied,
|
||||
# given the order in @log_filters.
|
||||
#
|
||||
# A typical need is to capture information from a hypervisor driver,
|
||||
# public API entrypoints and some of the utility code. Some utility
|
||||
# code is very verbose and is generally not desired. Taking the QEMU
|
||||
# hypervisor as an example, a suitable filter string for debugging
|
||||
# might be to turn off object, json & event logging, but enable the
|
||||
# rest of the util code:
|
||||
#
|
||||
#log_filters="1:qemu 1:libvirt 4:object 4:json 4:event 1:util"
|
||||
|
||||
# Logging outputs:
|
||||
# An output is one of the places to save logging information
|
||||
# The format for an output can be:
|
||||
# level:stderr
|
||||
# output goes to stderr
|
||||
# level:syslog:name
|
||||
# use syslog for the output and use the given name as the ident
|
||||
# level:file:file_path
|
||||
# output to a file, with the given filepath
|
||||
# level:journald
|
||||
# output to journald logging system
|
||||
# In all cases 'level' is the minimal priority, acting as a filter
|
||||
# 1: DEBUG
|
||||
# 2: INFO
|
||||
# 3: WARNING
|
||||
# 4: ERROR
|
||||
#
|
||||
# Multiple outputs can be defined, they just need to be separated by spaces.
|
||||
# e.g. to log all warnings and errors to syslog under the libvirtd ident:
|
||||
#log_outputs="3:syslog:libvirtd"
|
||||
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# Auditing
|
||||
#
|
||||
# This setting allows usage of the auditing subsystem to be altered:
|
||||
#
|
||||
# audit_level == 0 -> disable all auditing
|
||||
# audit_level == 1 -> enable auditing, only if enabled on host (default)
|
||||
# audit_level == 2 -> enable auditing, and exit if disabled on host
|
||||
#
|
||||
#audit_level = 2
|
||||
#
|
||||
# If set to 1, then audit messages will also be sent
|
||||
# via libvirt logging infrastructure. Defaults to 0
|
||||
#
|
||||
#audit_logging = 1
|
||||
|
||||
###################################################################
|
||||
# UUID of the host:
|
||||
# Host UUID is read from one of the sources specified in host_uuid_source.
|
||||
#
|
||||
# - 'smbios': fetch the UUID from 'dmidecode -s system-uuid'
|
||||
# - 'machine-id': fetch the UUID from /etc/machine-id
|
||||
#
|
||||
# The host_uuid_source default is 'smbios'. If 'dmidecode' does not provide
|
||||
# a valid UUID a temporary UUID will be generated.
|
||||
#
|
||||
# Another option is to specify host UUID in host_uuid.
|
||||
#
|
||||
# Keep the format of the example UUID below. UUID must not have all digits
|
||||
# be the same.
|
||||
|
||||
# NB This default all-zeros UUID will not work. Replace
|
||||
# it with the output of the 'uuidgen' command and then
|
||||
# uncomment this entry
|
||||
#host_uuid = "00000000-0000-0000-0000-000000000000"
|
||||
#host_uuid_source = "smbios"
|
||||
|
||||
###################################################################
|
||||
# Keepalive protocol:
|
||||
# This allows libvirtd to detect broken client connections or even
|
||||
# dead clients. A keepalive message is sent to a client after
|
||||
# keepalive_interval seconds of inactivity to check if the client is
|
||||
# still responding; keepalive_count is a maximum number of keepalive
|
||||
# messages that are allowed to be sent to the client without getting
|
||||
# any response before the connection is considered broken. In other
|
||||
# words, the connection is automatically closed approximately after
|
||||
# keepalive_interval * (keepalive_count + 1) seconds since the last
|
||||
# message received from the client. If keepalive_interval is set to
|
||||
# -1, libvirtd will never send keepalive requests; however clients
|
||||
# can still send them and the daemon will send responses. When
|
||||
# keepalive_count is set to 0, connections will be automatically
|
||||
# closed after keepalive_interval seconds of inactivity without
|
||||
# sending any keepalive messages.
|
||||
#
|
||||
#keepalive_interval = 5
|
||||
#keepalive_count = 5
|
||||
|
||||
#
|
||||
# These configuration options are no longer used. There is no way to
|
||||
# restrict such clients from connecting since they first need to
|
||||
# connect in order to ask for keepalive.
|
||||
#
|
||||
#keepalive_required = 1
|
||||
#admin_keepalive_required = 1
|
||||
|
||||
# Keepalive settings for the admin interface
|
||||
#admin_keepalive_interval = 5
|
||||
#admin_keepalive_count = 5
|
||||
|
||||
###################################################################
|
||||
# Open vSwitch:
|
||||
# This allows to specify a timeout for openvswitch calls made by
|
||||
# libvirt. The ovs-vsctl utility is used for the configuration and
|
||||
# its timeout option is set by default to 5 seconds to avoid
|
||||
# potential infinite waits blocking libvirt.
|
||||
#
|
||||
#ovs_timeout = 5
|
10
system/arch/lib/etc/lightdm/lightdm-gtk-greeter.conf
Normal file
10
system/arch/lib/etc/lightdm/lightdm-gtk-greeter.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
[greeter]
|
||||
indicators = ~host;~spacer;~clock;~spacer;~session;~spacer;~power
|
||||
theme-name = Adwaita
|
||||
position = 7%,start 50%,center
|
||||
icon-theme-name = Adwaita
|
||||
#background = /usr/share/backgrounds/gnome/Road.jpg
|
||||
hide-user-image = true
|
||||
|
164
system/arch/lib/etc/lightdm/lightdm.conf
Normal file
164
system/arch/lib/etc/lightdm/lightdm.conf
Normal file
|
@ -0,0 +1,164 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
##
|
||||
# General configuration
|
||||
#
|
||||
# start-default-seat = True to always start one seat if none are defined in the configuration
|
||||
# greeter-user = User to run greeter as
|
||||
# minimum-display-number = Minimum display number to use for X servers
|
||||
# minimum-vt = First VT to run displays on
|
||||
# lock-memory = True to prevent memory from being paged to disk
|
||||
# user-authority-in-system-dir = True if session authority should be in the system location
|
||||
# guest-account-script = Script to be run to setup guest account
|
||||
# logind-check-graphical = True to on start seats that are marked as graphical by logind
|
||||
# log-directory = Directory to log information to
|
||||
# run-directory = Directory to put running state in
|
||||
# cache-directory = Directory to cache to
|
||||
# sessions-directory = Directory to find sessions
|
||||
# remote-sessions-directory = Directory to find remote sessions
|
||||
# greeters-directory = Directory to find greeters
|
||||
# backup-logs = True to move add a .old suffix to old log files when opening new ones
|
||||
#
|
||||
[LightDM]
|
||||
#start-default-seat=true
|
||||
#greeter-user=lightdm
|
||||
#minimum-display-number=0
|
||||
#minimum-vt=7 # Setting this to a value < 7 implies security issues, see FS#46799
|
||||
#lock-memory=true
|
||||
#user-authority-in-system-dir=false
|
||||
#guest-account-script=guest-account
|
||||
#logind-check-graphical=false
|
||||
#log-directory=/var/log/lightdm
|
||||
run-directory=/run/lightdm
|
||||
#cache-directory=/var/cache/lightdm
|
||||
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions
|
||||
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
|
||||
#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters
|
||||
#backup-logs=true
|
||||
|
||||
#
|
||||
# Seat configuration
|
||||
#
|
||||
# Seat configuration is matched against the seat name glob in the section, for example:
|
||||
# [Seat:*] matches all seats and is applied first.
|
||||
# [Seat:seat0] matches the seat named "seat0".
|
||||
# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client".
|
||||
#
|
||||
# type = Seat type (xlocal, xremote, unity)
|
||||
# pam-service = PAM service to use for login
|
||||
# pam-autologin-service = PAM service to use for autologin
|
||||
# pam-greeter-service = PAM service to use for greeters
|
||||
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
|
||||
# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option)
|
||||
# xserver-config = Config file to pass to X server
|
||||
# xserver-layout = Layout to pass to X server
|
||||
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
|
||||
# xserver-share = True if the X server is shared for both greeter and session
|
||||
# xserver-hostname = Hostname of X server (only for type=xremote)
|
||||
# xserver-display-number = Display number of X server (only for type=xremote)
|
||||
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
|
||||
# xdmcp-port = XDMCP UDP/IP port to communicate on
|
||||
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
|
||||
# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
|
||||
# unity-compositor-timeout = Number of seconds to wait for compositor to start
|
||||
# greeter-session = Session to load for greeter
|
||||
# greeter-hide-users = True to hide the user list
|
||||
# greeter-allow-guest = True if the greeter should show a guest login option
|
||||
# greeter-show-manual-login = True if the greeter should offer a manual login option
|
||||
# greeter-show-remote-login = True if the greeter should offer a remote login option
|
||||
# user-session = Session to load for users
|
||||
# allow-user-switching = True if allowed to switch users
|
||||
# allow-guest = True if guest login is allowed
|
||||
# guest-session = Session to load for guests (overrides user-session)
|
||||
# session-wrapper = Wrapper script to run session with
|
||||
# greeter-wrapper = Wrapper script to run greeter with
|
||||
# guest-wrapper = Wrapper script to run guest sessions with
|
||||
# display-setup-script = Script to run when starting a greeter session (runs as root)
|
||||
# display-stopped-script = Script to run after stopping the display server (runs as root)
|
||||
# greeter-setup-script = Script to run when starting a greeter (runs as root)
|
||||
# session-setup-script = Script to run when starting a user session (runs as root)
|
||||
# session-cleanup-script = Script to run when quitting a user session (runs as root)
|
||||
# autologin-guest = True to log in as guest by default
|
||||
# autologin-user = User to log in with by default (overrides autologin-guest)
|
||||
# autologin-user-timeout = Number of seconds to wait before loading default user
|
||||
# autologin-session = Session to load for automatic login (overrides user-session)
|
||||
# autologin-in-background = True if autologin session should not be immediately activated
|
||||
# exit-on-failure = True if the daemon should exit if this seat fails
|
||||
#
|
||||
[Seat:*]
|
||||
#type=xlocal
|
||||
pam-service=lightdm
|
||||
pam-autologin-service=lightdm-autologin
|
||||
#pam-greeter-service=lightdm-greeter
|
||||
#xserver-command=X
|
||||
#xmir-command=Xmir
|
||||
#xserver-config=
|
||||
#xserver-layout=
|
||||
#xserver-allow-tcp=false
|
||||
#xserver-share=true
|
||||
#xserver-hostname=
|
||||
#xserver-display-number=
|
||||
#xdmcp-manager=
|
||||
#xdmcp-port=177
|
||||
#xdmcp-key=
|
||||
#unity-compositor-command=unity-system-compositor
|
||||
#unity-compositor-timeout=60
|
||||
#greeter-session=example-gtk-gnome
|
||||
#greeter-hide-users=false
|
||||
#greeter-allow-guest=true
|
||||
#greeter-show-manual-login=false
|
||||
#greeter-show-remote-login=true
|
||||
#user-session=default
|
||||
#allow-user-switching=true
|
||||
#allow-guest=true
|
||||
#guest-session=
|
||||
session-wrapper=/etc/lightdm/Xsession
|
||||
#greeter-wrapper=
|
||||
#guest-wrapper=
|
||||
#display-setup-script=
|
||||
#display-stopped-script=
|
||||
#greeter-setup-script=
|
||||
#session-setup-script=
|
||||
#session-cleanup-script=
|
||||
#autologin-guest=false
|
||||
autologin-user=je
|
||||
autologin-user-timeout=0
|
||||
#autologin-in-background=false
|
||||
#autologin-session=
|
||||
#exit-on-failure=false
|
||||
#
|
||||
# XDMCP Server configuration
|
||||
#
|
||||
# enabled = True if XDMCP connections should be allowed
|
||||
# port = UDP/IP port to listen for connections on
|
||||
# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present)
|
||||
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
|
||||
#
|
||||
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively
|
||||
# it can be a word and the first 7 characters are used as the key.
|
||||
#
|
||||
[XDMCPServer]
|
||||
#enabled=false
|
||||
#port=177
|
||||
#listen-address=
|
||||
#key=
|
||||
|
||||
#
|
||||
# VNC Server configuration
|
||||
#
|
||||
# enabled = True if VNC connections should be allowed
|
||||
# command = Command to run Xvnc server with
|
||||
# port = TCP/IP port to listen for connections on
|
||||
# listen-address = Host/address to listen for VNC connections (use all addresses if not present)
|
||||
# width = Width of display to use
|
||||
# height = Height of display to use
|
||||
# depth = Color depth of display to use
|
||||
#
|
||||
[VNCServer]
|
||||
#enabled=false
|
||||
#command=Xvnc
|
||||
#port=5900
|
||||
#listen-address=
|
||||
#width=1024
|
||||
#height=768
|
||||
#depth=8
|
102
system/arch/lib/etc/pacman.conf
Normal file
102
system/arch/lib/etc/pacman.conf
Normal file
|
@ -0,0 +1,102 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
[options]
|
||||
# The following paths are commented out with their default values listed.
|
||||
# If you wish to use different paths, uncomment and update the paths.
|
||||
#RootDir = /
|
||||
#DBPath = /var/lib/pacman/
|
||||
#CacheDir = /var/cache/pacman/pkg/
|
||||
#LogFile = /var/log/pacman.log
|
||||
#GPGDir = /etc/pacman.d/gnupg/
|
||||
#HookDir = /etc/pacman.d/hooks/
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/curl -C - -f %u > %o
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
#CleanMethod = KeepInstalled
|
||||
#UseDelta = 0.7
|
||||
Architecture = auto
|
||||
|
||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||
#IgnorePkg = ttf-inconsolata
|
||||
#IgnoreGroup =
|
||||
|
||||
#NoUpgrade =
|
||||
#NoExtract =
|
||||
|
||||
# Misc options
|
||||
#UseSyslog
|
||||
#Color
|
||||
#TotalDownload
|
||||
CheckSpace
|
||||
#VerbosePkgLists
|
||||
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
|
||||
# NOTE: You must run `pacman-key --init` before first using pacman; the local
|
||||
# keyring can then be populated with the keys of all official Arch Linux
|
||||
# packagers with `pacman-key --populate archlinux`.
|
||||
|
||||
#
|
||||
# REPOSITORIES
|
||||
# - can be defined here or included from another file
|
||||
# - pacman will search repositories in the order defined here
|
||||
# - local/custom mirrors can be added here or in separate files
|
||||
# - repositories listed first will take precedence when packages
|
||||
# have identical names, regardless of version number
|
||||
# - URLs will have $repo replaced by the name of the current repo
|
||||
# - URLs will have $arch replaced by the name of the architecture
|
||||
#
|
||||
# Repository entries are of the format:
|
||||
# [repo-name]
|
||||
# Server = ServerName
|
||||
# Include = IncludePath
|
||||
#
|
||||
# The header [repo-name] is crucial - it must be present and
|
||||
# uncommented to enable the repo.
|
||||
#
|
||||
|
||||
# The testing repositories are disabled by default. To enable, uncomment the
|
||||
# repo name header and Include lines. You can add preferred servers immediately
|
||||
# after the header, and they will be used before the default mirrors.
|
||||
|
||||
#[testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[community-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[community]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# If you want to run 32 bit applications on your x86_64 system,
|
||||
# enable the multilib repositories as required here.
|
||||
|
||||
#[multilib-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# An example of a custom package repository. See the pacman manpage for
|
||||
# tips on creating your own repositories.
|
||||
#[custom]
|
||||
#SigLevel = Optional TrustAll
|
||||
#Server = file:///home/custompkgs
|
102
system/arch/lib/etc/pacman.conf.arm
Normal file
102
system/arch/lib/etc/pacman.conf.arm
Normal file
|
@ -0,0 +1,102 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
[options]
|
||||
# The following paths are commented out with their default values listed.
|
||||
# If you wish to use different paths, uncomment and update the paths.
|
||||
#RootDir = /
|
||||
#DBPath = /var/lib/pacman/
|
||||
#CacheDir = /var/cache/pacman/pkg/
|
||||
#LogFile = /var/log/pacman.log
|
||||
#GPGDir = /etc/pacman.d/gnupg/
|
||||
#HookDir = /etc/pacman.d/hooks/
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/curl -C - -f %u > %o
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
#CleanMethod = KeepInstalled
|
||||
#UseDelta = 0.7
|
||||
Architecture = auto
|
||||
|
||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||
#IgnorePkg = ttf-inconsolata
|
||||
#IgnoreGroup =
|
||||
|
||||
#NoUpgrade =
|
||||
#NoExtract =
|
||||
|
||||
# Misc options
|
||||
#UseSyslog
|
||||
#Color
|
||||
#TotalDownload
|
||||
CheckSpace
|
||||
#VerbosePkgLists
|
||||
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
|
||||
# NOTE: You must run `pacman-key --init` before first using pacman; the local
|
||||
# keyring can then be populated with the keys of all official Arch Linux
|
||||
# packagers with `pacman-key --populate archlinux`.
|
||||
|
||||
#
|
||||
# REPOSITORIES
|
||||
# - can be defined here or included from another file
|
||||
# - pacman will search repositories in the order defined here
|
||||
# - local/custom mirrors can be added here or in separate files
|
||||
# - repositories listed first will take precedence when packages
|
||||
# have identical names, regardless of version number
|
||||
# - URLs will have $repo replaced by the name of the current repo
|
||||
# - URLs will have $arch replaced by the name of the architecture
|
||||
#
|
||||
# Repository entries are of the format:
|
||||
# [repo-name]
|
||||
# Server = ServerName
|
||||
# Include = IncludePath
|
||||
#
|
||||
# The header [repo-name] is crucial - it must be present and
|
||||
# uncommented to enable the repo.
|
||||
#
|
||||
|
||||
# The testing repositories are disabled by default. To enable, uncomment the
|
||||
# repo name header and Include lines. You can add preferred servers immediately
|
||||
# after the header, and they will be used before the default mirrors.
|
||||
|
||||
#[testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[community-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[community]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# If you want to run 32 bit applications on your x86_64 system,
|
||||
# enable the multilib repositories as required here.
|
||||
|
||||
#[multilib-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[multilib]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# An example of a custom package repository. See the pacman manpage for
|
||||
# tips on creating your own repositories.
|
||||
#[custom]
|
||||
#SigLevel = Optional TrustAll
|
||||
#Server = file:///home/custompkgs
|
10
system/arch/lib/etc/pam.d/login
Normal file
10
system/arch/lib/etc/pam.d/login
Normal file
|
@ -0,0 +1,10 @@
|
|||
#%PAM-1.0
|
||||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
auth required pam_securetty.so
|
||||
auth requisite pam_nologin.so
|
||||
auth include system-local-login
|
||||
auth optional pam_gnome_keyring.so
|
||||
account include system-local-login
|
||||
session include system-local-login
|
||||
session optional pam_gnome_keyring.so auto_start
|
7
system/arch/lib/etc/pam.d/passwd
Normal file
7
system/arch/lib/etc/pam.d/passwd
Normal file
|
@ -0,0 +1,7 @@
|
|||
#%PAM-1.0
|
||||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
#
|
||||
#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
|
||||
#password required pam_unix.so sha512 shadow use_authtok
|
||||
password required pam_unix.so sha512 shadow nullok
|
||||
password optional pam_gnome_keyring.so
|
2
system/arch/lib/etc/ssh/sshd_config.d/sec.conf
Normal file
2
system/arch/lib/etc/ssh/sshd_config.d/sec.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
ChallengeResponseAuthentication no
|
||||
PermitRootLogin no
|
3
system/arch/lib/etc/ssh/sshd_config.d/userkeys.conf
Normal file
3
system/arch/lib/etc/ssh/sshd_config.d/userkeys.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
PubkeyAuthentication yes
|
||||
AuthorizedKeysCommand /etc/ssh/userkeys.sh
|
||||
AuthorizedKeysCommandUser nobody
|
3
system/arch/lib/etc/ssh/sshd_config.d/x11.conf
Normal file
3
system/arch/lib/etc/ssh/sshd_config.d/x11.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
X11Forwarding yes
|
||||
X11DisplayOffset 10
|
||||
X11UseLocalhost no
|
3
system/arch/lib/etc/ssh/userkeys.sh
Normal file
3
system/arch/lib/etc/ssh/userkeys.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
curl --silent --fail https://code.elfring.ms/$1.keys 2>&1
|
||||
|
106
system/arch/lib/etc/sudoers
Normal file
106
system/arch/lib/etc/sudoers
Normal file
|
@ -0,0 +1,106 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
### sudoers file.
|
||||
##
|
||||
## This file MUST be edited with the 'visudo' command as root.
|
||||
## Failure to use 'visudo' may result in syntax or file permission errors
|
||||
## that prevent sudo from running.
|
||||
##
|
||||
## See the sudoers man page for the details on how to write a sudoers file.
|
||||
##
|
||||
|
||||
##
|
||||
## Host alias specification
|
||||
##
|
||||
## Groups of machines. These may include host names (optionally with wildcards),
|
||||
## IP addresses, network numbers or netgroups.
|
||||
# Host_Alias WEBSERVERS = www1, www2, www3
|
||||
|
||||
##
|
||||
## User alias specification
|
||||
##
|
||||
## Groups of users. These may consist of user names, uids, Unix groups,
|
||||
## or netgroups.
|
||||
# User_Alias ADMINS = millert, dowdy, mikef
|
||||
|
||||
##
|
||||
## Cmnd alias specification
|
||||
##
|
||||
## Groups of commands. Often used to group related commands together.
|
||||
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
|
||||
# /usr/bin/pkill, /usr/bin/top
|
||||
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
|
||||
|
||||
##
|
||||
## Defaults specification
|
||||
##
|
||||
## You may wish to keep some of the following environment variables
|
||||
## when running commands via sudo.
|
||||
##
|
||||
## Locale settings
|
||||
#Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
|
||||
##
|
||||
## Run X applications through sudo; HOME is used to find the
|
||||
## .Xauthority file. Note that other programs use HOME to find
|
||||
## configuration files and this may lead to privilege escalation!
|
||||
# Defaults env_keep += "HOME"
|
||||
##
|
||||
## X11 resource path settings
|
||||
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
|
||||
##
|
||||
## Desktop path settings
|
||||
# Defaults env_keep += "QTDIR KDEDIR"
|
||||
##
|
||||
## Allow sudo-run commands to inherit the callers' ConsoleKit session
|
||||
# Defaults env_keep += "XDG_SESSION_COOKIE"
|
||||
##
|
||||
## Uncomment to enable special input methods. Care should be taken as
|
||||
## this may allow users to subvert the command being run via sudo.
|
||||
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
|
||||
##
|
||||
## Uncomment to use a hard-coded PATH instead of the user's to find commands
|
||||
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
##
|
||||
## Uncomment to send mail if the user does not enter the correct password.
|
||||
# Defaults mail_badpass
|
||||
##
|
||||
## Uncomment to enable logging of a command's output, except for
|
||||
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
|
||||
# Defaults log_output
|
||||
# Defaults!/usr/bin/sudoreplay !log_output
|
||||
# Defaults!/usr/local/bin/sudoreplay !log_output
|
||||
# Defaults!REBOOT !log_output
|
||||
|
||||
## Unlock sudo on all ttys
|
||||
Defaults !tty_tickets
|
||||
|
||||
## Longer unlock timeout
|
||||
Defaults timestamp_timeout=120
|
||||
|
||||
## Keep SSH Session info in sudo
|
||||
Defaults env_keep += "SSH_TTY SSH_CONNECTION SSH_CLIENT"
|
||||
|
||||
|
||||
##
|
||||
## Runas alias specification
|
||||
##
|
||||
|
||||
##
|
||||
## User privilege specification
|
||||
##
|
||||
root ALL=(ALL) ALL
|
||||
|
||||
## Allow members of group wheel to execute any command w/o entering a password
|
||||
%wheel ALL=(ALL) NOPASSWD: ALL
|
||||
|
||||
## Allow members of group sudo to execute any command
|
||||
%sudo ALL=(ALL) ALL
|
||||
|
||||
## Uncomment to allow any user to run sudo if they know the password
|
||||
## of the user they are running the command as (root by default).
|
||||
# Defaults targetpw # Ask for the password of the target user
|
||||
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
|
||||
|
||||
## Read drop-in files from /etc/sudoers.d
|
||||
## (the '#' here does not indicate a comment)
|
||||
#includedir /etc/sudoers.d
|
39
system/arch/lib/etc/systemd/logind.conf
Normal file
39
system/arch/lib/etc/systemd/logind.conf
Normal file
|
@ -0,0 +1,39 @@
|
|||
##### THIS IS MANAGED BY ANSIBLE #####
|
||||
|
||||
## This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Entries in this file show the compile time defaults.
|
||||
# You can change settings by editing this file.
|
||||
# Defaults can be restored by simply deleting this file.
|
||||
#
|
||||
# See logind.conf(5) for details.
|
||||
|
||||
[Login]
|
||||
#NAutoVTs=6
|
||||
#ReserveVT=6
|
||||
#KillUserProcesses=no
|
||||
#KillOnlyUsers=
|
||||
#KillExcludeUsers=root
|
||||
#InhibitDelayMaxSec=5
|
||||
HandlePowerKey=poweroff
|
||||
HandleSuspendKey=ignore
|
||||
#HandleHibernateKey=hibernate
|
||||
HandleLidSwitch=suspend
|
||||
#HandleLidSwitchDocked=ignore
|
||||
#PowerKeyIgnoreInhibited=no
|
||||
#SuspendKeyIgnoreInhibited=no
|
||||
#HibernateKeyIgnoreInhibited=no
|
||||
#LidSwitchIgnoreInhibited=yes
|
||||
#HoldoffTimeoutSec=30s
|
||||
#IdleAction=ignore
|
||||
#IdleActionSec=30min
|
||||
#RuntimeDirectorySize=10%
|
||||
#RemoveIPC=yes
|
||||
#InhibitorsMax=8192
|
||||
#SessionsMax=8192
|
||||
#UserTasksMax=33%
|
11
system/arch/lib/installFromAur.sh
Executable file
11
system/arch/lib/installFromAur.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
package=$1
|
||||
|
||||
cd /tmp
|
||||
/usr/bin/curl --silent --remote-name https://aur.archlinux.org/cgit/aur.git/snapshot/$package.tar.gz
|
||||
/usr/bin/tar --extract --gzip --file $package.tar.gz
|
||||
cd $package
|
||||
/usr/bin/makepkg --install --syncdeps --noconfirm
|
||||
cd /tmp
|
||||
/usr/bin/sudo /usr/bin/rm --recursive --force $package.tar.gz $package
|
53
system/arch/server.yaml
Normal file
53
system/arch/server.yaml
Normal file
|
@ -0,0 +1,53 @@
|
|||
- name: "Server Setup"
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
tasks:
|
||||
|
||||
- name: "Install base packages"
|
||||
package:
|
||||
name:
|
||||
- openssh
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: "Run SSH Server"
|
||||
service:
|
||||
name: sshd
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: "Sudo: config file"
|
||||
copy:
|
||||
dest: /etc/sudoers
|
||||
src: ./lib/etc/sudoers
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
|
||||
- name: "Sudo: Create groups"
|
||||
group:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
system: true
|
||||
with_items:
|
||||
- wheel
|
||||
- sudo
|
||||
|
||||
- name: "Pacman configuration"
|
||||
when: "'arm' not in ansible_machine"
|
||||
copy:
|
||||
dest: /etc/pacman.conf
|
||||
src: ./lib/etc/pacman.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Pacman configuration (ARM)"
|
||||
when: "'arm' in ansible_machine"
|
||||
copy:
|
||||
dest: /etc/pacman.conf
|
||||
src: ./lib/etc/pacman.conf.arm
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
326
system/arch/workstation.yaml
Normal file
326
system/arch/workstation.yaml
Normal file
|
@ -0,0 +1,326 @@
|
|||
- name: "Configuration for all workstations"
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
tasks:
|
||||
|
||||
- name: "Install workstation packages"
|
||||
package:
|
||||
name:
|
||||
- acpi
|
||||
- alacritty
|
||||
- arandr
|
||||
- aspell
|
||||
- aspell-de
|
||||
- aspell-en
|
||||
- autorandr
|
||||
- bash
|
||||
- bash-completion
|
||||
- binutils
|
||||
- blueman
|
||||
- bluez-utils
|
||||
- clipmenu
|
||||
- coreutils
|
||||
- cryptsetup
|
||||
- curl
|
||||
- device-mapper
|
||||
- dialog
|
||||
- diffutils
|
||||
- dmenu
|
||||
- dos2unix
|
||||
- dosfstools
|
||||
- dunst
|
||||
- e2fsprogs
|
||||
- feh
|
||||
- file
|
||||
- filesystem
|
||||
- findutils
|
||||
- firefox
|
||||
- firefox-i18n-de
|
||||
- gnu-netcat
|
||||
- grep
|
||||
- gzip
|
||||
- i3-wm
|
||||
- i3lock
|
||||
- i3status
|
||||
- i3status-rust
|
||||
- imagemagick
|
||||
- inetutils
|
||||
- ispell
|
||||
- less
|
||||
- libreoffice-fresh
|
||||
- licenses
|
||||
- light
|
||||
- lightdm
|
||||
- lightdm-gtk-greeter
|
||||
- lightdm-gtk-greeter-settings
|
||||
- linux
|
||||
- linux-headers
|
||||
- lm_sensors
|
||||
- lshw
|
||||
- lvm2
|
||||
- man-db
|
||||
- man-pages
|
||||
- mc
|
||||
- mplayer
|
||||
- nano
|
||||
- network-manager-applet
|
||||
- networkmanager
|
||||
- nmap
|
||||
- nmon
|
||||
- nomacs
|
||||
- pcmanfm-gtk3
|
||||
- perl
|
||||
- perl-date-manip
|
||||
- powerline-fonts
|
||||
- rofi
|
||||
- qrencode
|
||||
- screenfetch
|
||||
- scrot
|
||||
- sed
|
||||
- strace
|
||||
- texinfo
|
||||
- texlive-bibtexextra
|
||||
- texlive-core
|
||||
- texlive-fontsextra
|
||||
- texlive-formatsextra
|
||||
- texlive-games
|
||||
- texlive-humanities
|
||||
- texlive-latexextra
|
||||
- texlive-music
|
||||
- texlive-pictures
|
||||
- texlive-pstricks
|
||||
- texlive-publishers
|
||||
- texlive-science
|
||||
- tree
|
||||
- ttf-3270-nerd
|
||||
- ttf-cousine-nerd
|
||||
- ttf-envycoder-nerd
|
||||
- ttf-font-awesome
|
||||
- ttf-hack-nerd
|
||||
- ttf-inconsolata-nerd
|
||||
- unzip
|
||||
- usbutils
|
||||
- w3m
|
||||
- wget
|
||||
- wpa_supplicant
|
||||
- xautolock
|
||||
- xclip
|
||||
- xdot
|
||||
- xf86-input-libinput
|
||||
- xorg-apps
|
||||
- xorg-xclipboard
|
||||
- xorg-server
|
||||
- zathura
|
||||
- zathura-pdf-mupdf
|
||||
state: present
|
||||
update_cache: True
|
||||
|
||||
- name: "Remove unwanted packages"
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
state: absent
|
||||
update_cache: True
|
||||
with_items:
|
||||
- xf86-input-synaptics
|
||||
|
||||
- name: "Install Audio System"
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
update_cache: False
|
||||
with_items:
|
||||
- alsa-utils
|
||||
- libpulse
|
||||
- pipewire
|
||||
- pipewire-audio
|
||||
- pipewire-alsa
|
||||
- pipewire-jack
|
||||
- pipewire-pulse
|
||||
- qpwgraph
|
||||
- pavucontrol # Replace with pwvucontrol
|
||||
- wireplumber
|
||||
|
||||
- name: "Systemd: Disable reboot on ctrl+alt+del"
|
||||
systemd:
|
||||
name: ctrl-alt-del.target
|
||||
masked: yes
|
||||
|
||||
- name: "Systemd: logind.conf"
|
||||
copy:
|
||||
dest: /etc/systemd/logind.conf
|
||||
src: ./lib/etc/systemd/logind.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Lightdm: greeter config"
|
||||
copy:
|
||||
dest: /etc/lightdm/lightdm-gtk-greeter.conf
|
||||
src: ./lib/etc/lightdm/lightdm-gtk-greeter.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Lightdm: config"
|
||||
copy:
|
||||
dest: /etc/lightdm/lightdm.conf
|
||||
src: ./lib/etc/lightdm/lightdm.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Pam: Login"
|
||||
copy:
|
||||
dest: /etc/pam.d/login
|
||||
src: ./lib/etc/pam.d/login
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Pam: Passwd"
|
||||
copy:
|
||||
dest: /etc/pam.d/passwd
|
||||
src: ./lib/etc/pam.d/passwd
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "Service: No netctl"
|
||||
service:
|
||||
name: netctl.service
|
||||
state: stopped
|
||||
enabled: no
|
||||
|
||||
- name: "Service: NetworkManager"
|
||||
service:
|
||||
name: NetworkManager.service
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: "Service: lightdm"
|
||||
service:
|
||||
name: lightdm.service
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
## X11
|
||||
- name: "X11: Keyboard"
|
||||
when: "'gpd' not in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Touchpad"
|
||||
when: "'gpd' not in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/50-touchpad.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/50-touchpad.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Keyboard (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/00-keyboard.conf.gpdp2
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Intel Graphics (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/20-intel.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/20-intel.conf.gpdp2
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Monitor (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/30-display.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/30-display.conf.gpdp2
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Touchscreen (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/xorg.conf.d/99-touchscreen.conf
|
||||
src: ./lib/etc/X11/xorg.conf.d/99-touchscreen.conf.gpdp2
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "X11: Xresources (GPD Pocket 2)"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/X11/Xresources
|
||||
src: ./lib/etc/X11/Xresources.gpdp2
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
|
||||
## Notbook Specials
|
||||
- name: "Install Notebook packages"
|
||||
when: ansible_facts['form_factor'] == "Notebook"
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
update_cache: True
|
||||
with_items:
|
||||
- tlp
|
||||
|
||||
- name: "TLP: config"
|
||||
when: ansible_facts['form_factor'] == "Notebook"
|
||||
copy:
|
||||
dest: /etc/default/tlp
|
||||
src: ./lib/etc/default/tlp
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: "TLP: Service"
|
||||
when: ansible_facts['form_factor'] == "Notebook"
|
||||
service:
|
||||
name: tlp
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
## GPD Pocket Specials
|
||||
- name: "GPD fan module"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/modules-load.d/gpd-pocket-fan.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
gpd-pocket-fan
|
||||
|
||||
- name: "GPD fan module config"
|
||||
when: "'gpd' in ansible_hostname"
|
||||
copy:
|
||||
dest: /etc/modprobe.d/gpd-pocket-fan.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
options gpd-pocket-fan temp_limits=40000,40001,40002
|
||||
|
||||
- name: "Set Xbacklight permissions by udev"
|
||||
copy:
|
||||
dest: /etc/udev/rules.d/90-backlight.rules
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
SUBSYSTEM=="backlight", ACTION=="add", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
|
35
system/arch/workstation_aur.yaml
Normal file
35
system/arch/workstation_aur.yaml
Normal file
|
@ -0,0 +1,35 @@
|
|||
- name: "Install AUR helper and packages"
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Create build user
|
||||
user:
|
||||
name: aur_builder
|
||||
group: wheel
|
||||
create_home: no
|
||||
home: /tmp
|
||||
|
||||
- name: Install build tools
|
||||
package:
|
||||
name:
|
||||
- base-devel
|
||||
state: present
|
||||
update_cache: True
|
||||
|
||||
- name: "Gather package facts"
|
||||
package_facts:
|
||||
manager: "auto"
|
||||
|
||||
- name: Install PIKAUR
|
||||
when: "'pikaur' not in ansible_facts['packages']"
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
script: ./lib/installFromAur.sh pikaur
|
||||
|
||||
- name: Install ansible-aur-git
|
||||
when: "'ansible-aur-git' not in ansible_facts['packages']"
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
script: ./lib/installFromAur.sh ansible-aur-git
|
18
system/arch/workstation_aurSoftware.yaml
Normal file
18
system/arch/workstation_aurSoftware.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
- name: "Install AUR helper and packages"
|
||||
hosts: localhost
|
||||
connection: local
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Install AUR packages
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
aur:
|
||||
name:
|
||||
- autotiling
|
||||
- insync
|
||||
- c-lolcat
|
||||
- plus42
|
||||
|
||||
|
||||
|
16
system/wsl/README.md
Normal file
16
system/wsl/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# WSL Setup
|
||||
```
|
||||
sudo apt-get install ca-certificates \
|
||||
curl \
|
||||
aptitude \
|
||||
aspell \
|
||||
aspell-de \
|
||||
fzf \
|
||||
git \
|
||||
keychain \
|
||||
mc \
|
||||
pass \
|
||||
xclip \
|
||||
x11-xkb-utils \
|
||||
zathura
|
||||
```
|
Loading…
Reference in a new issue