]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Merge branch 'master' of git.friedersdorff.com:max/saltfiles
authorMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 17 Nov 2019 22:10:48 +0000 (22:10 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 17 Nov 2019 22:10:48 +0000 (22:10 +0000)
13 files changed:
states/aliases/files/aliases
states/conky/files/conkyrc
states/git/init.sls
states/qutebrowser/files/config.py
states/setup.sls
states/sway/files/barium
states/sway/files/config.jinja
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}"
+}
index 41d213f74b5ce0ca9cd66fbe4a333c1cf8016457..83c03a9969fb91d99d172b822d04e63d89093ee7 100644 (file)
@@ -6,6 +6,8 @@
        {% set ifdev = 'wlp2s0' %}
 {% elif grains['host'] == 'barium' %}
        {% set ifdev = 'enp3s0f1' %}
+{% elif grains['host'] == 'dubnium' %}
+       {% set ifdev = 'enp4s0' %}
 {% elif grains['host'] == 'rhenium' %}
        {% set ifdev = 'wlp2s0' %}
 {% else %}
@@ -59,7 +61,7 @@ conky.text = [[
                "\#ff0000"
          ${endif} 
   },
-{% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' %}
+{% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' or grains['host'] == 'barium' %}
        {
          "full_text": "BAT ${battery_short} ${battery_time}", 
          "color": 
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 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 4c3b2f2d761214172974d62bf429c2d965c2c2bc..137cda94a18a02f0eeebbf60940049490deeb379 100644 (file)
@@ -4,3 +4,4 @@ include:
   - pass
   - firefox
   - glocker
+  - utils
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 a7efde350776dd4cef6e82b4d3d4e2fbfdb09e8a..4b7931ee2fd5a26c1ec6dd496ec3f531101d9b92 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"
@@ -183,12 +191,30 @@ 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
+}
+
+input 7504:24616:unspecified_ErgoDox_ergonomic_keyboard {
+  xkb_layout gb
+}
 # host specific section
 {%- do salt.log.error('sway/files/' + host) -%}
 {% include 'sway/files/' + host %}
index 97ccbae8cd701953e7ccaa1009a68118a70c826f..7d99708203023ae0c13d4811ebb94df359ff41f1 100644 (file)
@@ -6,7 +6,7 @@
        {% set font_size = 11 %}
 {% endif %}
 
-{% if grains['host'] == 'barium' or grains['host'] == 'rhenium' %}
+{% 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 407febd439d1d9fec8166412a431951c9cafd0e7..63657cb6b956a8051bdce1aaa2bcc80416763a65 100644 (file)
@@ -5,3 +5,5 @@ install vim:
       - vim-molokai
       - powerline
       - powerline-fonts
+      - vim_bridge-git
+      - ctags
index 50509aeef109310152876e0b51897372651e442c..1fc97881cbbe1d8dc1e9ff8174d80021c241d656 100644 (file)
@@ -40,6 +40,7 @@ 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
@@ -155,3 +156,6 @@ hi MatchParen cterm=underline ctermbg=none ctermfg=none
 
 " Rainbow parens
 let g:rainbow_active = 1
+
+" Activate tagbar with F8
+nmap <F8> :TagbarToggle<CR>