Просмотр исходного кода

Make sure to run xt.dash using dash, not bash

Alois Mahdal 10 месяцев назад
Родитель
Сommit
abceb96abb
2 измененных файлов: 8 добавлений и 3 удалений
  1. 1
    1
      dotfiles/config/i3/config
  2. 7
    2
      dotfiles/config/i3/macros/xt.dash

+ 1
- 1
dotfiles/config/i3/config Просмотреть файл

451
 bindsym --release $mod+Ctrl+grave           exec "xdotool .config/i3/macros/grave.xdotool"
451
 bindsym --release $mod+Ctrl+grave           exec "xdotool .config/i3/macros/grave.xdotool"
452
 bindsym --release $mod+Ctrl+bracketleft     exec "xdotool .config/i3/macros/bracketleft.xdotool"
452
 bindsym --release $mod+Ctrl+bracketleft     exec "xdotool .config/i3/macros/bracketleft.xdotool"
453
 bindsym --release $mod+Ctrl+bracketright    exec "xdotool .config/i3/macros/bracketright.xdotool"
453
 bindsym --release $mod+Ctrl+bracketright    exec "xdotool .config/i3/macros/bracketright.xdotool"
454
-bindsym --release $mod+Ctrl+v               exec "bash .config/i3/macros/xt.dash"
454
+bindsym --release $mod+Ctrl+v               exec "dash .config/i3/macros/xt.dash"
455
 
455
 
456
 
456
 
457
 
457
 

+ 7
- 2
dotfiles/config/i3/macros/xt.dash Просмотреть файл

1
-#!/bin/bash
1
+#!/bin/dash
2
 
2
 
3
 
3
 
4
 fixnl () {
4
 fixnl () {
12
             single=chop
12
             single=chop
13
         ;;
13
         ;;
14
     esac;
14
     esac;
15
-    cache="$(mktemp -t fixnl.XXXXXXXX)";
15
+    # TODO: ^^ should probably be:
16
+    #
17
+    #   test -n "$UID" || return 3
18
+    #   cache="$(mktemp "/run/user/$UID/fixnl.XXXXXXXX")";
19
+    #
20
+    # but UID is not supported in bash, so..
16
     cat > "$cache";
21
     cat > "$cache";
17
     nlcount=$(<"$cache" wc -l);
22
     nlcount=$(<"$cache" wc -l);
18
     lastchr=$(<"$cache" tail -c1 | hexdump -e '"%02x"');
23
     lastchr=$(<"$cache" tail -c1 | hexdump -e '"%02x"');