From 578b14331f81be5bdc0738cdf5662fc75dd5b05c Mon Sep 17 00:00:00 2001 From: James Patrick Date: Wed, 11 Dec 2019 00:52:23 -0500 Subject: [PATCH] Added emacs modeline like feature. --- lib/helper/mk_link | 3 +++ lib/helper/report | 2 ++ lib/helper/rm_link | 2 ++ lib/post-merge | 2 ++ rofi/scripts/btctl | 1 + rofi/scripts/media_controls | 1 + rofi/scripts/power_menu | 1 + sway/scripts/import_gsetting | 1 + sway/scripts/menu | 1 + sway/scripts/menu_clipman | 1 + sway/scripts/menu_gopass | 3 ++- sway/scripts/printscreen | 3 ++- sway/scripts/sanitize_wob | 2 ++ tridactyl/scripts/speak | 1 + 14 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/helper/mk_link b/lib/helper/mk_link index 50a3197..15ce8c6 100755 --- a/lib/helper/mk_link +++ b/lib/helper/mk_link @@ -1,4 +1,6 @@ #! env zsh +# -*- sh -*- + REPORT=`dirname $0`/report if [ -z "$1" ] || [ -z "$2" ] ; then @@ -12,3 +14,4 @@ if [[ -e $2 ]] ; then fi $REPORT info "Symlinked `ln -svf $1 $2`" + diff --git a/lib/helper/report b/lib/helper/report index 2ac3318..758c0b0 100755 --- a/lib/helper/report +++ b/lib/helper/report @@ -1,4 +1,5 @@ #! env zsh +# -*- sh -*- R='\033[0;31m' Y='\033[0;33m' G='\033[0;32m' @@ -21,3 +22,4 @@ if [[ -z $2 ]] ; then else format $1 $2 fi + diff --git a/lib/helper/rm_link b/lib/helper/rm_link index fa951d4..2aa1c6a 100755 --- a/lib/helper/rm_link +++ b/lib/helper/rm_link @@ -1,4 +1,5 @@ #! env zsh +# -*- sh -*- REPORT=`dirname $0`/report if [[ -z $1 ]] ; then @@ -18,3 +19,4 @@ fi $REPORT info "Deleting $1" rm $1 + diff --git a/lib/post-merge b/lib/post-merge index 075e5b4..7e248b5 100755 --- a/lib/post-merge +++ b/lib/post-merge @@ -1,4 +1,5 @@ #!/bin/sh +# -*- zsh -*- local_hook="$HOME"/.git_template.local/hooks/post-merge [ -f "$local_hook" ] && . "$local_hook" @@ -6,3 +7,4 @@ local_hook="$HOME"/.git_template.local/hooks/post-merge .git/hooks/ctags >/dev/null 2>&1 & make update + diff --git a/rofi/scripts/btctl b/rofi/scripts/btctl index 2da5d6b..741605b 100755 --- a/rofi/scripts/btctl +++ b/rofi/scripts/btctl @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# -*- sh -*- # cmds=($(bluetoothctl help | cut -d' ' -f1 | sed 's/[\x01-\x1F\x7F]//g' | sed 's/\[[0-9];[0-9]\+m//g')) # unset "cmds[2]" diff --git a/rofi/scripts/media_controls b/rofi/scripts/media_controls index c0fc4c4..ba18b0e 100755 --- a/rofi/scripts/media_controls +++ b/rofi/scripts/media_controls @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# -*- sh -*- STATUS="$(playerctl status)" MSG="$(playerctl metadata --format '{{xesam:title}} - {{xesam:artist}}')" diff --git a/rofi/scripts/power_menu b/rofi/scripts/power_menu index c1c673d..5f66a9e 100755 --- a/rofi/scripts/power_menu +++ b/rofi/scripts/power_menu @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# -*- sh -*- OPTIONS=" Lock 鈴 Sleep diff --git a/sway/scripts/import_gsetting b/sway/scripts/import_gsetting index 93fb35c..aa654b4 100755 --- a/sway/scripts/import_gsetting +++ b/sway/scripts/import_gsetting @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- # Lifted from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # usage: import-gsettings : : ... diff --git a/sway/scripts/menu b/sway/scripts/menu index aa6f65f..67f38a2 100755 --- a/sway/scripts/menu +++ b/sway/scripts/menu @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- rofi \ -show drun \ -p run \ diff --git a/sway/scripts/menu_clipman b/sway/scripts/menu_clipman index 2448948..37fd91c 100755 --- a/sway/scripts/menu_clipman +++ b/sway/scripts/menu_clipman @@ -1,2 +1,3 @@ #! /bin/sh +# -*- sh -*- clipman --selector="rofi" --select diff --git a/sway/scripts/menu_gopass b/sway/scripts/menu_gopass index 8abea02..352fe0c 100755 --- a/sway/scripts/menu_gopass +++ b/sway/scripts/menu_gopass @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- gopass ls --flat \ | rofi -dmenu -p pass -i \ - | xargs --no-run-if-empty gopass show -c \ No newline at end of file + | xargs --no-run-if-empty gopass show -c diff --git a/sway/scripts/printscreen b/sway/scripts/printscreen index e75fec1..b01c230 100755 --- a/sway/scripts/printscreen +++ b/sway/scripts/printscreen @@ -1,6 +1,7 @@ #! /bin/sh +# -*- sh -*- file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').png grim -g "$(slurp)" $file \ && wl-copy $file \ - && notify-send -i $file "File copied to clipboard" \ No newline at end of file + && notify-send -i $file "File copied to clipboard" diff --git a/sway/scripts/sanitize_wob b/sway/scripts/sanitize_wob index 8e257de..80b86b9 100755 --- a/sway/scripts/sanitize_wob +++ b/sway/scripts/sanitize_wob @@ -1,4 +1,6 @@ #!/bin/bash +# -*- sh -*- +# while read IN do [[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0 diff --git a/tridactyl/scripts/speak b/tridactyl/scripts/speak index 9d47c29..5e7f794 100755 --- a/tridactyl/scripts/speak +++ b/tridactyl/scripts/speak @@ -1,4 +1,5 @@ #!/bin/bash +# -*- sh -*- message="$@" case "$OSTYPE" in