Browse Source

Added lock screen and a script to open in emacs

master
Josh Wolfe 3 years ago
parent
commit
e4d2ec0ade
5 changed files with 70 additions and 7 deletions
  1. 7
    7
      .emacs.d/README.org
  2. 3
    0
      bin/diskusage
  3. 33
    0
      bin/lock.sh
  4. 26
    0
      bin/openinemacs
  5. 1
    0
      i3/config

+ 7
- 7
.emacs.d/README.org View File

@@ -357,13 +357,13 @@ Better narrowing.
* Org Mode

#+BEGIN_SRC emacs-lisp :tangle yes
;;(require 'ox-latex)
;;(add-to-list 'org-latex-packages-alist '("" "minted"))
;;(setq org-latex-listings 'minted)
;;(setq org-latex-pdf-process
;; '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(setq org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))

(require 'org-agenda)
(use-package ox-reveal

+ 3
- 0
bin/diskusage View File

@@ -0,0 +1,3 @@
#!/bin/sh

du --max-depth=1 2> /dev/null | sort -n -r | head -n20

+ 33
- 0
bin/lock.sh View File

@@ -0,0 +1,33 @@
#!/bin/bash

# i3lock blurred screen inspired by /u/patopop007 and the blog post
# http://plankenau.com/blog/post-10/gaussianlock

# Timings are on an Intel i7-2630QM @ 2.00GHz

# Dependencies:
# imagemagick
# i3lock
# scrot (optional but default)

IMAGE=/tmp/i3lock.png
SCREENSHOT="scrot $IMAGE" # 0.46s

# Alternate screenshot method with imagemagick. NOTE: it is much slower
# SCREENSHOT="import -window root $IMAGE" # 1.35s

# Here are some imagemagick blur types
# Uncomment one to use, if you have multiple, the last one will be used

# All options are here: http://www.imagemagick.org/Usage/blur/#blur_args
BLURTYPE="0x5" # 7.52s
#BLURTYPE="0x2" # 4.39s
#BLURTYPE="5x2" # 3.80s
#BLURTYPE="2x8" # 2.90s
#BLURTYPE="2x3" # 2.92s

# Get the screenshot, add the blur and lock the screen with it
$SCREENSHOT
convert $IMAGE -blur $BLURTYPE $IMAGE
i3lock -i $IMAGE
rm $IMAGE

+ 26
- 0
bin/openinemacs View File

@@ -0,0 +1,26 @@
#!/bin/bash
file=$1
line=$2
col=$3
emacsclient -n -e \
"(progn

;; Load the file
(find-file \"$file\")

;; Jump to the same point as in IntelliJ
;; Unfortunately, IntelliJ doesn't always supply the values
;; depending on where the open is invoked from; e.g. keyboard
;; works, tab context doesn't
(when (not (string= \"\" \"$line\"))
(goto-char (point-min))
(forward-line (1- $2))
(forward-char (1- $3)))

;; Raise/focus our window; depends on the windowing system
(if (string-equal system-type \"darwin\")
(ns-do-applescript \"tell application \\\"Emacs\\\" to activate\")
(raise-frame))

;; Automatically pick up changes made in IntelliJ
(auto-revert-mode t))"

+ 1
- 0
i3/config View File

@@ -60,6 +60,7 @@ bindsym $mod+Shift+q kill
bindsym $mod+space exec rofi -show run -font "snap 10" -o 85
bindsym $mod+p exec "~/bin/toggle-layout"
bindsym $mod+c exec chromium
bindsym $mod+n exec "~/bin/lock.sh"

# change focus
bindsym $mod+h focus left

Loading…
Cancel
Save