diff options
author | Andrew Cady <d@jerkface.net> | 2018-06-12 16:53:25 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-06-12 16:55:02 -0400 |
commit | b1645568b2c0d1b5450ff7fb04e4ef2c71d352cd (patch) | |
tree | 19b4be28ed4e8b55ce56e00956d26c6cb928942a /dot | |
parent | 097abc2307be83290743b15045ecf5a1f03637af (diff) |
improvements
Diffstat (limited to 'dot')
-rw-r--r-- | dot/bashrc | 18 | ||||
-rwxr-xr-x | dot/local/bin/text2png | 3 | ||||
-rw-r--r-- | dot/xbindkeysrc | 82 | ||||
-rwxr-xr-x | dot/xinitrc | 14 |
4 files changed, 112 insertions, 5 deletions
@@ -60,8 +60,12 @@ memoize_retval() | |||
60 | add_path -a /usr/games | 60 | add_path -a /usr/games |
61 | add_path "$HOME/.cabal/bin" "$HOME/.local/bin" "$HOME/bin" | 61 | add_path "$HOME/.cabal/bin" "$HOME/.local/bin" "$HOME/bin" |
62 | 62 | ||
63 | if have stack; then | 63 | # if have stack; then |
64 | add_stack_binpath | 64 | # add_stack_binpath |
65 | # fi | ||
66 | |||
67 | if have dbus-autolaunch; then | ||
68 | eval $(dbus-autolaunch) | ||
65 | fi | 69 | fi |
66 | 70 | ||
67 | if match_glob "*zsh" "$SHELL"; then | 71 | if match_glob "*zsh" "$SHELL"; then |
@@ -138,7 +142,7 @@ memoize_retval() | |||
138 | alias ip=/sbin/ip | 142 | alias ip=/sbin/ip |
139 | alias ipaddr='ip addr' | 143 | alias ipaddr='ip addr' |
140 | 144 | ||
141 | if have ps && match_glob 'procps*' $(ps -V 2>/dev/null); then | 145 | if have ps && match_glob '*procps*' "$(ps -V 2>/dev/null)"; then |
142 | export PS_FORMAT=pid,user:6,tty,\%mem,\%cpu,start,cmd | 146 | export PS_FORMAT=pid,user:6,tty,\%mem,\%cpu,start,cmd |
143 | alias p='ps x -H' | 147 | alias p='ps x -H' |
144 | have less && alias pp='p a |grep -v " \[[^] ]\+\]\$"| less -RSeX' | 148 | have less && alias pp='p a |grep -v " \[[^] ]\+\]\$"| less -RSeX' |
@@ -306,3 +310,11 @@ torrent () | |||
306 | { | 310 | { |
307 | rsync -P "$@" borges:/srv/4T-temp/transmission/torrents/ | 311 | rsync -P "$@" borges:/srv/4T-temp/transmission/torrents/ |
308 | } | 312 | } |
313 | |||
314 | webterm() | ||
315 | { | ||
316 | PATH="/usr/lib/xorg:$PATH" xpra start --bind-tcp=0.0.0.0:14500 --html=on --start="${1:-xterm}" | ||
317 | printf '%s\n' 'Stop server by pressing enter.' 'Connect to server via http://localhost:14500/' | ||
318 | read line | ||
319 | PATH="/usr/lib/xorg:$PATH" xpra stop | ||
320 | } | ||
diff --git a/dot/local/bin/text2png b/dot/local/bin/text2png index ada7780..a435914 100755 --- a/dot/local/bin/text2png +++ b/dot/local/bin/text2png | |||
@@ -12,6 +12,8 @@ $desired_height = 1296; | |||
12 | 12 | ||
13 | # Font size in points (72 points per inch). This does not determine the size of | 13 | # Font size in points (72 points per inch). This does not determine the size of |
14 | # the image, because the image density is defined in terms of it. | 14 | # the image, because the image density is defined in terms of it. |
15 | |||
16 | # Probably this should be changed so density is fixed and font size varies. | ||
15 | $font_size = 72; | 17 | $font_size = 72; |
16 | $margin = $font_size; | 18 | $margin = $font_size; |
17 | 19 | ||
@@ -44,7 +46,6 @@ $offset = sprintf '+%i+%i', ($character_size) x 2; | |||
44 | $output = 'png:-'; | 46 | $output = 'png:-'; |
45 | 47 | ||
46 | system <<END; | 48 | system <<END; |
47 | set -x; | ||
48 | convert \\ | 49 | convert \\ |
49 | -size $initial_image_size \\ | 50 | -size $initial_image_size \\ |
50 | xc:white \\ | 51 | xc:white \\ |
diff --git a/dot/xbindkeysrc b/dot/xbindkeysrc new file mode 100644 index 0000000..26461f5 --- /dev/null +++ b/dot/xbindkeysrc | |||
@@ -0,0 +1,82 @@ | |||
1 | # For the benefit of emacs users: -*- shell-script -*- | ||
2 | ########################### | ||
3 | # xbindkeys configuration # | ||
4 | ########################### | ||
5 | # | ||
6 | # Version: 1.8.6 | ||
7 | # | ||
8 | # If you edit this file, do not forget to uncomment any lines | ||
9 | # that you change. | ||
10 | # The pound(#) symbol may be used anywhere for comments. | ||
11 | # | ||
12 | # To specify a key, you can use 'xbindkeys --key' or | ||
13 | # 'xbindkeys --multikey' and put one of the two lines in this file. | ||
14 | # | ||
15 | # The format of a command line is: | ||
16 | # "command to start" | ||
17 | # associated key | ||
18 | # | ||
19 | # | ||
20 | # A list of keys is in /usr/include/X11/keysym.h and in | ||
21 | # /usr/include/X11/keysymdef.h | ||
22 | # The XK_ is not needed. | ||
23 | # | ||
24 | # List of modifier: | ||
25 | # Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock), | ||
26 | # Mod3 (CapsLock), Mod4, Mod5 (Scroll). | ||
27 | # | ||
28 | |||
29 | # The release modifier is not a standard X modifier, but you can | ||
30 | # use it if you want to catch release events instead of press events | ||
31 | |||
32 | # By defaults, xbindkeys does not pay attention with the modifiers | ||
33 | # NumLock, CapsLock and ScrollLock. | ||
34 | # Uncomment the lines above if you want to pay attention to them. | ||
35 | |||
36 | #keystate_numlock = enable | ||
37 | #keystate_capslock = enable | ||
38 | #keystate_scrolllock= enable | ||
39 | |||
40 | # Examples of commands: | ||
41 | |||
42 | "xbindkeys_show" | ||
43 | control+shift + q | ||
44 | |||
45 | # Increase volume | ||
46 | "pavol *107/100" | ||
47 | XF86AudioRaiseVolume | ||
48 | |||
49 | # Decrease volume | ||
50 | "pavol *100/107" | ||
51 | XF86AudioLowerVolume | ||
52 | |||
53 | # Toggle mute | ||
54 | "pavol --mute" | ||
55 | XF86AudioMute | ||
56 | |||
57 | # set directly keycode (here control + f with my keyboard) | ||
58 | #"xterm" | ||
59 | # c:41 + m:0x4 | ||
60 | |||
61 | # specify a mouse button | ||
62 | #"xterm" | ||
63 | # control + b:2 | ||
64 | |||
65 | #"xterm -geom 50x20+20+20" | ||
66 | # Shift+Mod2+alt + s | ||
67 | # | ||
68 | ## set directly keycode (here control+alt+mod2 + f with my keyboard) | ||
69 | #"xterm" | ||
70 | # alt + c:0x29 + m:4 + mod2 | ||
71 | # | ||
72 | ## Control+Shift+a release event starts rxvt | ||
73 | #"rxvt" | ||
74 | # release+control+shift + a | ||
75 | # | ||
76 | ## Control + mouse button 2 release event starts rxvt | ||
77 | #"rxvt" | ||
78 | # Control + b:2 + Release | ||
79 | |||
80 | ################################## | ||
81 | # End of xbindkeys configuration # | ||
82 | ################################## | ||
diff --git a/dot/xinitrc b/dot/xinitrc index 796fb15..569464a 100755 --- a/dot/xinitrc +++ b/dot/xinitrc | |||
@@ -1,5 +1,10 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | exec </dev/null >.xsession-errors 2>&1 | ||
2 | set -x | 3 | set -x |
4 | # eval $(dbus-autolaunch) | ||
5 | [ "$XDG_RUNTIME_DIR" ] || export XDG_RUNTIME_DIR=/run/user/"$(id -u)" | ||
6 | [ "$DBUS_SESSION_BUS_ADDRESS" ] || export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus | ||
7 | |||
3 | USING_GNOME= | 8 | USING_GNOME= |
4 | if [ -r "$XAUTHORITY" -a ! "$XAUTHORITY" -ef "$HOME"/.Xauthority ]; then | 9 | if [ -r "$XAUTHORITY" -a ! "$XAUTHORITY" -ef "$HOME"/.Xauthority ]; then |
5 | ln -sf "$XAUTHORITY" "$HOME"/.Xauthority | 10 | ln -sf "$XAUTHORITY" "$HOME"/.Xauthority |
@@ -7,6 +12,7 @@ if [ -r "$XAUTHORITY" -a ! "$XAUTHORITY" -ef "$HOME"/.Xauthority ]; then | |||
7 | fi | 12 | fi |
8 | warn() { xmessage ".xinitrc: Warning: $*" & } | 13 | warn() { xmessage ".xinitrc: Warning: $*" & } |
9 | xrdb -merge ~/.Xresources || warn "xrdb returned $?" | 14 | xrdb -merge ~/.Xresources || warn "xrdb returned $?" |
15 | xbindkeys | ||
10 | 16 | ||
11 | # if [ "$USING_GNOME" ]; then | 17 | # if [ "$USING_GNOME" ]; then |
12 | # xrdb -merge - <<'END' || warn "xrdb returned $?" | 18 | # xrdb -merge - <<'END' || warn "xrdb returned $?" |
@@ -20,6 +26,12 @@ setxkbmap -option terminate:ctrl_alt_bksp -option caps:super | |||
20 | # gnome: | 26 | # gnome: |
21 | gsettings set org.gnome.libgnomekbd.keyboard options "['terminate\tterminate:ctrl_alt_bksp', 'caps\tcaps:super']" | 27 | gsettings set org.gnome.libgnomekbd.keyboard options "['terminate\tterminate:ctrl_alt_bksp', 'caps\tcaps:super']" |
22 | 28 | ||
29 | # enable tap-to-click | ||
30 | xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 0 0 0 1 2 3 | ||
31 | # c.f: | ||
32 | # http://www.mepis.org/docs/en/index.php?title=Configuring_the_touchpad_with_xinput | ||
33 | # pad corners rt rb lt lb tap fingers 1 2 3 (can't simulate more then 2 tap fingers AFAIK) - values: 0=disable 1=left 2=middle 3=right etc. (in FF 8=back 9=forward) | ||
34 | |||
23 | ( | 35 | ( |
24 | exec xterm -e tmux attach | 36 | exec xterm -e tmux attach |
25 | ) & | 37 | ) & |
@@ -29,5 +41,5 @@ if [ "$USING_GNOME" ]; then | |||
29 | else | 41 | else |
30 | (exec xmonad || exec fluxbox) & | 42 | (exec xmonad || exec fluxbox) & |
31 | fi | 43 | fi |
32 | exec perl -MPOSIX -e pause | 44 | exec perl -e 'wait while 1' |
33 | xterm # if exec fails | 45 | xterm # if exec fails |