]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Merge branch 'master' of https://git.friedersdorff.com/max/saltfiles
authorMaximilian Friedersdorff <max@friedersdorff.com>
Fri, 8 Nov 2019 22:58:34 +0000 (22:58 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Fri, 8 Nov 2019 22:58:34 +0000 (22:58 +0000)
21 files changed:
states/aliases/files/aliases
states/bash/arch.sls [new file with mode: 0644]
states/bash/gentoo.sls [new file with mode: 0644]
states/bash/init.sls
states/conky/files/conkyrc
states/firefox/arch.sls
states/git/init.sls
states/pass/arch.sls
states/qutebrowser/files/config.py
states/setup-arch.sls
states/setup.sls
states/sway/arch.sls
states/sway/files/barium
states/sway/files/config.jinja
states/sway/files/rhenium [new file with mode: 0644]
states/termite/files/config
states/utils/arch.sls [new file with mode: 0644]
states/utils/files/onchanges.bash [new file with mode: 0644]
states/utils/init.sls [new file with mode: 0644]
states/vim/arch.sls
states/vim/files/vimrc

index cafa719fba6a8bff5d7ab7c7a0e12d2414cd8503..413e41ed25d7e05f6862d3b3eb1a30f10efda110 100644 (file)
@@ -46,3 +46,8 @@ function ssh_in() {
       \"$@\"
     ssh -O exit -S \"$control_file\" \"$1\"" 
 }
+
+function search() {
+        quoted=$(python -c "import urllib.parse, sys; print(urllib.parse.quote_plus(' '.join(sys.argv[1:])))" "${@}")
+        w3m "https://duckduckgo.com/?q=${quoted}"
+}
diff --git a/states/bash/arch.sls b/states/bash/arch.sls
new file mode 100644 (file)
index 0000000..a5451b5
--- /dev/null
@@ -0,0 +1,3 @@
+bash installed:
+  pkg.installed:
+    - name: bash
diff --git a/states/bash/gentoo.sls b/states/bash/gentoo.sls
new file mode 100644 (file)
index 0000000..55ca520
--- /dev/null
@@ -0,0 +1,4 @@
+bash installed:
+  pkg.installed:
+    - name: app-shells/bash
+    - refresh: False
index 9d7c2ebefc3eb784f154aa9742371c075c49cf53..9729404669e706685f736f307756474510be32b6 100644 (file)
@@ -1,9 +1,5 @@
-bash installed:
-  pkg.installed:
-    - name: app-shells/bash
-    - refresh: False
-
 include: 
+  - bash.{{ grains['os'] | lower }}
   - user.max
   - aliases
   - dircolors
index b5791c16afb2b334dc2bec9ee336ca75a86f7a71..0dc0d102dcdafcc989d85a869d9960bee5de616f 100644 (file)
@@ -6,6 +6,8 @@
        {% set ifdev = 'wlp2s0' %}
 {% elif grains['host'] == 'barium' %}
        {% set ifdev = 'enp3s0f1' %}
+{% elif grains['host'] == 'rhenium' %}
+       {% set ifdev = 'wlp2s0' %}
 {% else %}
        {% set ifdev = 'eth0' %}
 {% endif %}
@@ -57,7 +59,7 @@ conky.text = [[
                "\#ff0000"
          ${endif} 
   },
-{% if grains['host'] == 'platinum' %}
+{% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' or grains['host'] == 'barium' %}
        {
          "full_text": "BAT ${battery_short} ${battery_time}", 
          "color": 
index 8074266954c8783a9de156836e8e41e819d4fc35..e39119294c218fc80e948ef68f9223e08568fa37 100644 (file)
@@ -1,3 +1,4 @@
 install firefox:
   pkg.installed:
-    - name: firefox
+    - pkgs:
+      - firefox
index 9fc3c9c1fd7a3856768e29c0cb11e30b980644a9..9f64fd2209f8b48d48eaaace155dcd21ec05f846 100644 (file)
@@ -20,8 +20,7 @@ include:
   'alias.hist': 'log --graph --full-history --all --pretty=format:\'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset\' --date=short',
   'alias.struct': 'log --graph --full-history --all --pretty=format:\'%ad %s %Creset %C(yellow)%d%Creset\' --date=short --simplify-by-decoration',
   'alias.co': 'checkout',
-  'alias.ci': 'commit -S',
-  'alias.commit': 'commit -S',
+  'alias.ci': 'commit',
   'alias.st': 'status',
   'alias.vh': 'verify-commit HEAD',
   'alias.vc': 'verify-commit',
@@ -29,8 +28,8 @@ include:
   'alias.tag': 'tag -s',
   'alias.t': 'tag -s',
   'alias.alias': '!req=$\'\\033[0;31m=\\033[0m\'; git config --get-regexp ^alias\. | sed -e s/^alias\.// -e "s/\ /\t$req\ /"',
-  'alias.r': 'rebase -S',
-  'alias.m': 'merge -S',
+  'alias.r': 'rebase',
+  'alias.m': 'merge',
   'alias.pa': '!git remote | xargs -L1 git push --all',
 }
 %}
index 26dce049032f0809c6c687e7a7eb54e0c12fd577..820f05a457708fb8640a26dfd16f0cf0b42e5eec 100644 (file)
@@ -1,5 +1,8 @@
 install pass:
   pkg.installed:
     - pkgs:
-      - pass
+      - pass-git
       - pass-otp
+      - browserpass-firefox
+      - browserpass-chromium
+      - ccid
index 0a96ca3711ee4952128f6aa18838d55b6d5bc48a..4c739ceb07a8bfbc2a41c6f0609e8490eea523c0 100644 (file)
@@ -3,7 +3,7 @@ config.load_autoconfig()
 c.auto_save.session = True
 c.content.cookies.accept = 'no-3rdparty'
 c.content.images = True
-c.editor.command = ['urxvt', '-e', 'vim', '{file}']
+c.editor.command = ['termite', '-e', 'vim {file}']
 c.tabs.position = 'left'
 c.url.auto_search = 'dns'
 c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?q={}'}
@@ -35,3 +35,6 @@ config.bind(',zol', 'spawn --userscript qute-pass --dmenu-invocation bemenu --ot
 
 # wayland
 c.window.hide_decoration = True
+
+# Spell checking
+c.spellcheck.languages = ["en-GB", "de-DE", "en-US"]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3df286b29f3f2ba6aefc2e5d4d4290e75d92ac95 100644 (file)
@@ -0,0 +1,7 @@
+install pulseaudio:
+  pkg.installed:
+    - pkgs:
+      - pavucontrol
+      - paprefs
+      - pamixer
+      - pulseaudio
index 4c3b2f2d761214172974d62bf429c2d965c2c2bc..137cda94a18a02f0eeebbf60940049490deeb379 100644 (file)
@@ -4,3 +4,4 @@ include:
   - pass
   - firefox
   - glocker
+  - utils
index e8d2445ac2fccbdf0d7f388ff1c25d5030a94dc8..b46cd25321f3847cea786f69ef6223a9f91677cf 100644 (file)
@@ -4,3 +4,4 @@ install sway:
       - sway 
       - swaylock
       - swayidle
+      - bemenu
index e1c8786a3b9dd4490c49e7cfd8afce21191912d8..39da4a7aa05fe2eb76031785c537def53b508ddf 100644 (file)
@@ -69,7 +69,8 @@ workspace 3 output DP-1
 
 font pango:Liberation Mono 10
 
-input type:keyboard {
+# The built in keyboard of barium
+input 1:1:AT_Translated_Set_2_keyboard {
   xkb_layout gb 
   xkb_variant colemak
   xkb_options ctrl:nocaps
index 536627f0a02e01ad5d5e6617c4623f69778de8ab..5dac6c7d320094034835f00da6deb3272d3100a8 100644 (file)
@@ -50,6 +50,9 @@ set $ws8 "8"
 set $ws9 "9"
 set $ws10 "10"
 
+set $music "Music"
+set $chat "Chat"
+
 mode "$ratpoison" {
 # All/most commands in this mode should revert to the default mode on comleption.
 # We are emulating ratpoison (kinda) here
@@ -68,6 +71,9 @@ mode "$ratpoison" {
     bindsym 8 exec 'swaymsg mode "default"; swaymsg workspace $ws8'
     bindsym 9 exec 'swaymsg mode "default"; swaymsg workspace $ws9'
     bindsym 0 exec 'swaymsg mode "default"; swaymsg workspace $ws10'
+    bindsym m exec 'swaymsg mode "default"; swaymsg workspace $music'
+    bindsym a exec 'swaymsg mode "default"; swaymsg workspace $chat'
+
 
     bindsym Shift+1 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws1'
     bindsym Shift+2 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws2'
@@ -79,6 +85,8 @@ mode "$ratpoison" {
     bindsym Shift+8 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws8'
     bindsym Shift+9 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws9'
     bindsym Shift+0 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws10'
+    bindsym Shift+m exec 'swaymsg mode "default"; swaymsg move container to workspace $music'
+    bindsym Shift+a exec 'swaymsg mode "default"; swaymsg move container to workspace $chat'
 
 # Moving focus
 #    bindsym Tab focus right mode "default"
@@ -182,12 +190,26 @@ focus_on_window_activation urgent
 for_window [class="^rdesktop"] move workspace number 9; floating disable
 for_window [class="Pinentry"] floating enable
 
+{% set lockcmd = "swaylock -i {DP-1,eDP-1,HDMI-A-1}:~/Pictures/lockscreen_1080_1.png" %}
+
 exec swayidle \
-  timeout 300 "lock.nosmartcard" \
+timeout 300 "{{lockcmd}}" \
   timeout 600 'swaymsg "output * dpms off"' \
-    resume 'swaymsg "output * dpms on" \
-  before-sleep "lock.nosmartcard"
+    resume 'swaymsg "output * dpms on"' \
+    before-sleep "{{lockcmd}}"
+
+# This keyboard has this layout on all machines:
+input 1241:36:HOLDCHIP_USB_Keyboard {
+  xkb_layout us
+  xkb_variant colemak
+  xkb_options ctrl:nocaps
+}
 
+input 16700:8455:DELL_Dell_USB_Entry_Keyboard {
+  xkb_layout gb
+  xkb_variant colemak
+  xkb_options ctrl:nocaps
+}
 # host specific section
 {%- do salt.log.error('sway/files/' + host) -%}
 {% include 'sway/files/' + host %}
diff --git a/states/sway/files/rhenium b/states/sway/files/rhenium
new file mode 100644 (file)
index 0000000..c8291cf
--- /dev/null
@@ -0,0 +1,39 @@
+# Start i3bar to display a workspace bar (plus the system information i3status
+# finds out, if available)
+bar {
+  id bar_left
+  status_command conky-i3bar
+  position top
+  font pango:Liberation Mono 12
+  colors {
+    background $black_super
+    focused_background $black
+    focused_workspace $black_super $yellow_super $black
+    active_workspace $black_super $blue_super $black
+    inactive_workspace $black_super $black_super $white_super
+    urgent_workspace $black $red_super $white
+  }
+}
+
+font pango:Liberation Mono 10
+
+output eDP-1 {
+       scale 2
+       position 0 0
+       background ~/Pictures/background_1800.png center
+}
+
+output HDMI-A-2 {
+       scale 1
+       position 3200 0
+       background ~/Pictures/background_1440.png fill
+}
+
+input * {
+  xkb_layout gb
+  xkb_variant colemak
+  xkb_options ctrl:nocaps
+}
+
+# Disable tap-to-click on touchpad to prevent jerkyness
+input type:touch tap disable
index bab31a3526564bd0b5656a478c1118c597ffa367..7d99708203023ae0c13d4811ebb94df359ff41f1 100644 (file)
@@ -6,7 +6,7 @@
        {% set font_size = 11 %}
 {% endif %}
 
-{% if grains['host'] in ['barium', 'dubnium'] %}
+{% if grains['host'] in ['barium', 'dubnium', 'rhenium'] %}
        {% set font_family = 'Source Code Pro' %}
 {% else %}
        {% set font_family = 'Source Code Pro for Powerline' %}
diff --git a/states/utils/arch.sls b/states/utils/arch.sls
new file mode 100644 (file)
index 0000000..0a0225a
--- /dev/null
@@ -0,0 +1,3 @@
+install inotify tools:
+  pkg.installed:
+    - name: inotify-tools
diff --git a/states/utils/files/onchanges.bash b/states/utils/files/onchanges.bash
new file mode 100644 (file)
index 0000000..d7c6bb9
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# Watch current directory (recursively) for file changes, and execute
+# a command when a file or directory is created, modified or deleted.
+#
+# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
+#
+# Requires Linux, bash and inotifywait (from inotify-tools package).
+#
+# To avoid executing the command multiple times when a sequence of
+# events happen, the script waits one second after the change - if
+# more changes happen, the timeout is extended by a second again.
+#
+# Installation:
+#     chmod a+rx onchange.sh
+#     sudo cp onchange.sh /usr/local/bin
+#
+# Example use - rsync local changes to the remote server:
+#    
+#    onchange.sh rsync -avt . host:/remote/dir
+#
+# Released to Public Domain. Use it as you like.
+#
+
+EVENTS="CREATE,CLOSE_WRITE,DELETE,MODIFY,MOVED_FROM,MOVED_TO"
+
+if [ -z "$1" ]; then
+    echo "Usage: $0 cmd ..."
+    exit -1;
+fi
+
+inotifywait -e "$EVENTS" -m -r --format '%:e %f' . | (
+    WAITING="";
+    while true; do
+        LINE="";
+        read -t 1 LINE;
+        if test -z "$LINE"; then
+            if test ! -z "$WAITING"; then
+                    echo "CHANGE";
+                    WAITING="";
+            fi;
+        else
+            WAITING=1;
+        fi;
+    done) | (
+    while true; do
+        read TMP;
+        echo $@
+        eval $@
+    done
+)
diff --git a/states/utils/init.sls b/states/utils/init.sls
new file mode 100644 (file)
index 0000000..16cfe94
--- /dev/null
@@ -0,0 +1,11 @@
+include:
+  - utils.{{ grains['os'] | lower }}
+
+install on changes:
+  file.managed:
+    - name: {{ grains['homedir'] }}/.local/bin/onchanges
+    - source: salt://utils/files/onchanges.bash
+    - mode: 750
+    - owner: {{ grains['user'] }}
+    - group: {{ grains['user'] }}
+
index c7806180aee5f613f159de843c7b033ea255451c..63657cb6b956a8051bdce1aaa2bcc80416763a65 100644 (file)
@@ -3,3 +3,7 @@ install vim:
     - pkgs:
       - vim
       - vim-molokai
+      - powerline
+      - powerline-fonts
+      - vim_bridge-git
+      - ctags
index 5980b6453bacbca1feaadffd4c8ce7a862da015e..1fc97881cbbe1d8dc1e9ff8174d80021c241d656 100644 (file)
@@ -14,7 +14,6 @@ Plugin 'jelera/vim-javascript-syntax'
 Plugin 'noahfrederick/vim-noctu'
 Plugin 'pangloss/vim-javascript'
 Plugin 'Yggdroot/indentLine'
-Plugin 'Raimondi/delimitMate'
 Plugin 'scrooloose/syntastic'
 Plugin 'ternjs/tern_for_vim'
 Plugin 'docunext/closetag.vim'
@@ -39,6 +38,9 @@ Plugin 'nvie/vim-rst-tables'
 Plugin 'lepture/vim-jinja'
 Plugin 'aklt/plantuml-syntax'
 Plugin 'psf/black'
+Plugin 'vim-python/python-syntax'
+Plugin 'luochen1990/rainbow'
+Plugin 'majutsushi/tagbar'
 
 " All of your Plugins must be added before the following line
 call vundle#end()            " required
@@ -118,6 +120,8 @@ let g:netrw_silent = 1
 
 " Set folding
 set foldmethod=syntax
+nnoremap <space> za
+vnoremap <space> zf
 
 " Better saving behaviour for go
 let g:go_fmt_experimental = 1
@@ -130,3 +134,28 @@ let g:rst_prefer_python_version = 2
 
 " Set linelength for python
 let g:black_linelength = 80
+
+" Python syntax highlighting
+let g:python_highlight_builtins = 1
+let g:python_highlight_builtin_objs = 1
+let g:python_highlight_builtin_types = 1
+let g:python_highlight_builtin_funcs = 1
+let g:python_highlight_builtin_kwarg = 1
+let g:python_highlight_exceptions = 1
+let g:python_highlight_string_formatting = 1
+let g:python_highlight_string_format = 1
+let g:python_highlight_string_templates = 1
+let g:python_highlight_class_vars = 1
+let g:python_highlight_operators = 1
+
+" Python indent
+autocmd FileType python setlocal foldmethod=indent foldnestmax=2
+
+" Paren highlighting
+hi MatchParen cterm=underline ctermbg=none ctermfg=none
+
+" Rainbow parens
+let g:rainbow_active = 1
+
+" Activate tagbar with F8
+nmap <F8> :TagbarToggle<CR>