Browse Source

Some emacs updates, and xdotool macros for emacs

Simon Watson 2 years ago
parent
commit
f73896bc91
4 changed files with 80 additions and 2 deletions
  1. 30 1
      bashrc/bashrc-all
  2. 15 1
      emacs/.emacs-all
  3. 33 0
      openbox/casana-void/rc.xml
  4. 2 0
      xinit/swatson-casana-xinitrc

+ 30 - 1
bashrc/bashrc-all

@@ -92,6 +92,27 @@ pb () {
 	curl -F "file=@-" http://chate.io:669
 }
 
+# For use with emacs vterm
+# See: https://github.com/akermu/emacs-libvterm
+vterm_printf(){
+    if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ] ); then
+        # Tell tmux to pass the escape sequences through
+        printf "\ePtmux;\e\e]%s\007\e\\" "$1"
+    elif [ "${TERM%%-*}" = "screen" ]; then
+        # GNU screen (screen, screen-256color, screen-256color-bce)
+        printf "\eP\e]%s\007\e\\" "$1"
+    else
+        printf "\e]%s\e\\" "$1"
+    fi
+}
+
+if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
+    function clear(){
+        vterm_printf "51;Evterm-clear-scrollback";
+        tput clear;
+    }
+fi
+
 # Case defines platform specific configs
 # Platform agnostic configs above
 case $(hostname) in
@@ -128,7 +149,15 @@ case $(hostname) in
 	alias ssh-old="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1"
 	alias sleep-open="sudo zzz && slock"
 	alias ssh-aws="ssh -i ~/.ssh/aws_key"
-
+	
+	tmux_init () {
+		$TMUX_PATH new -s services -d
+		$TMUX_PATH new -s admin -d
+		$TMUX_PATH new -s personal -d
+		$TMUX_PATH new -s music -d
+		$TMUX_PATH new -s lisp-koans -d
+	}
+	
 	# Load non tracked aliases for work specific things
 	source ~/Work/secure_shell_aliases 
 	

+ 15 - 1
emacs/.emacs-all

@@ -20,7 +20,6 @@
 (straight-use-package
  '(slime-company :type git :host github :repo "anwyn/slime-company"))
 (straight-use-package 'sublimity)
-(straight-use-package 'dashboard)
 (straight-use-package 'all-the-icons)
 (straight-use-package 'neotree)
 (straight-use-package 'rust-mode)
@@ -67,6 +66,21 @@
   (let ((inhibit-read-only t))
     (ansi-color-apply-on-region (point-min) (point-max))))
 
+(straight-use-package
+ '(vterm :type git :host github
+   :repo "akermu/emacs-libvterm"))
+
+;;; Vterm config
+(setq vterm-buffer-name-string "%s")
+(add-hook 'vterm-mode-hook
+          (lambda ()
+            (set (make-local-variable 'buffer-face-mode-face) 'fixed-pitch)
+            (buffer-face-mode t)))
+
+(straight-use-package
+ '(tal-mode :type git :host github
+   :repo "rafapaezbas/uxntal-mode"))
+
 ;;(straight-use-package
 ;; '(org :type git :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git"))
 ;;(require 'org)

+ 33 - 0
openbox/casana-void/rc.xml

@@ -320,6 +320,9 @@
         <command>kfmclient openProfile filemanagement</command>
       </action>
     </keybind>
+    <keybind key="W-A-Down">
+      <action name="MoveToEdge"><direction>south</direction></action>
+    </keybind>
     <keybind key="A-space">
       <action name="Execute">
         <command>rofi -show run</command>
@@ -360,6 +363,36 @@
     <keybind key="W-S-s">
 	    <action name="Unshade"/>
     </keybind>
+    <keybind key="KP_End">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+c b</command>
+	    </action>
+    </keybind>
+    <keybind key="KP_Down">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+c z</command>
+	    </action>
+    </keybind>
+    <keybind key="KP_Left">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+x 5 2</command>
+	    </action>
+    </keybind>
+    <keybind key="KP_Begin">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+x 5 0</command>
+	    </action>
+    </keybind>
+    <keybind key="KP_Home">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+g</command>
+	    </action>
+    </keybind>
+    <keybind key="KP_Up">
+	    <action name="Execute">
+		    <command>xdotool key ctrl+x k</command>
+	    </action>
+    </keybind>
   </keyboard>
   <mouse>
     <dragThreshold>1</dragThreshold>

+ 2 - 0
xinit/swatson-casana-xinitrc

@@ -3,4 +3,6 @@ xinput set-button-map 11 1 1 3 4 5 6 7 & # Disable track pad middle click
 xmodmap ~/.xmodmap & # Swap CapsLock to L_Ctrl
 /home/swatson/.config/lemonbar/startLemon.sh &
 guake &
+tint2 &
 exec openbox
+#exec stumpwm