From 4cb3de339a34622be4b366762650b60969aca04d Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 26 Mar 2020 16:32:32 -0500 Subject: [PATCH] WIP emacs --- apps/config | 18 ++++++++++++++++++ apps/de/sway/init | 5 ++--- bin/clip | 16 +++++++++++----- bin/field | 3 +++ bin/getip | 4 ++++ bin/is_wayland | 2 +- setup.bash | 1 + 7 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 apps/config create mode 100755 bin/field create mode 100755 bin/getip diff --git a/apps/config b/apps/config new file mode 100644 index 0000000..cf91234 --- /dev/null +++ b/apps/config @@ -0,0 +1,18 @@ + +;; Added by Package.el. This must come before configurations of +;; installed packages. Don't delete this line. If you don't want it, +;; just comment it out by adding a semicolon to the start of the line. +;; You may delete these explanatory comments. + +;; jk + +(require 'package) +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/")) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) +(package-initialize) + +;; Given all of this, just `package-refresh-contents` + +(require 'evil) +(evil-mode 5) diff --git a/apps/de/sway/init b/apps/de/sway/init index 2fb090b..6b9302f 100755 --- a/apps/de/sway/init +++ b/apps/de/sway/init @@ -5,6 +5,7 @@ . "$DOTFILES_PATH/bin/prelude" +# killall -9 dunst &> /dev/null # killall -9 urxvtd # urxvtd & @@ -25,11 +26,9 @@ export MOZ_ENABLE_WAYLAND=1 # configuration flag for some of my dotfiles scripts export IS_WAYLAND=1 -mako & -killall -9 dunst &> /dev/null - sway +# mako & # has_command libinput-gestures-setup && libinput-gestures-setup start # has_command kdeconnect-indicator && kdeconnect-indicator & # has_command gnome-keyring-daemon && eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)" diff --git a/bin/clip b/bin/clip index 45b93c0..96c7a18 100755 --- a/bin/clip +++ b/bin/clip @@ -1,7 +1,13 @@ #!/usr/bin/env sh -xclip -selection primary -xclip -selection primary -out | xclip -selection clipboard -xclip -selection primary -out | xclip -selection secondary -echo "Your input was stored in all clipboards." -sleep 5 && killall xclip &>/dev/null & +if is_wayland; then + # echo "Clip: YES. THIS IS WAYLAND SPEAKING." >&2 + sed 's/^\s+//g' | wl-copy "$@" + echo "Your trimmed input was stored in all clipboards." +else + xclip -selection primary + xclip -selection primary -out | xclip -selection clipboard + xclip -selection primary -out | xclip -selection secondary + echo "Your input was stored in all clipboards." + sleep 5 && killall xclip > /dev/null 2>&1 & +fi diff --git a/bin/field b/bin/field new file mode 100755 index 0000000..d5f874d --- /dev/null +++ b/bin/field @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +gawk '{print $'${1:-1}'}' diff --git a/bin/getip b/bin/getip new file mode 100755 index 0000000..94c6eaa --- /dev/null +++ b/bin/getip @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +curl -s --connect-timeout 3 --max-time 10 --retry 5 --retry-delay 0 \ + --retry-max-time 40 "$@" ifconfig.co/json | jq diff --git a/bin/is_wayland b/bin/is_wayland index e69c45d..72253e8 100755 --- a/bin/is_wayland +++ b/bin/is_wayland @@ -1,3 +1,3 @@ #!/usr/bin/env bash -(test -z "$DISPLAY" || test -n "$WAYLAND_DISPLAY" || test -n "$SWAYSOCK" || test "$IS_WAYLAND" -eq 1) +test "$IS_WAYLAND" == "1" || test -n "$WAYLAND_DISPLAY" || test -n "$SWAYSOCK" || test -z "$DISPLAY" diff --git a/setup.bash b/setup.bash index 6771597..9f9ff17 100755 --- a/setup.bash +++ b/setup.bash @@ -48,6 +48,7 @@ links=( "apps/neovim/" "$HOME/.vim" "apps/neovim/init.vim" "$HOME/.vimrc" "bin/lib/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim" + "apps/emacs/config" "$HOME/.emacs" # gtk configuration files "apps/de/gtk/2rc" "$HOME/.gtkrc-2.0"