Browse Source

WIP: Cleanup pass & light refactor

master
jcmdln 2 years ago
parent
commit
73ad3303ed
12 changed files with 189 additions and 1169 deletions
  1. 0
    476
      etc/emacs/default.el
  2. 0
    219
      etc/i3/config
  3. 0
    47
      etc/i3status.conf
  4. 21
    0
      etc/portage/sets/gein-base
  5. 8
    0
      etc/portage/sets/gein-i3wm
  6. 4
    0
      etc/portage/sets/gein-laptop
  7. 11
    0
      etc/portage/sets/gein-lxqt
  8. 36
    0
      etc/portage/sets/gein-steam
  9. 0
    97
      etc/sudoers
  10. 0
    61
      etc/tmux.conf
  11. 0
    171
      etc/vimrc
  12. 109
    98
      install.sh

+ 0
- 476
etc/emacs/default.el View File

@@ -1,476 +0,0 @@
;; /etc/emacs/default.el

;; Disable menubar, scrollbar, and toolbar before they initialize
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))

;; Theme/Font
(load-theme 'tango-dark)
(set-face-attribute 'default nil
:family "Monospace" :weight 'normal
:width 'normal :height 96)

(add-hook
'after-init-hook
(lambda()
;; Line number column
(add-hook 'lisp-mode-hook 'linum-mode)
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode)

;; Saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)

;; Shorter y/n prompts
(fset 'yes-or-no-p 'y-or-n-p)

;; Globally enable word-wrap
(global-visual-line-mode t)

;; Highlight matching parenthesis
(show-paren-mode t)

;; Enable Emacs mouse commands
(xterm-mouse-mode t)

;; Environment Variables
(setenv "EDITOR" "emacsclient")
(setenv "GIT_EDITOR" "emacsclient")
(setenv "GOPATH" (getenv "GOPATH"))
(setenv "MANPATH" (getenv "MANPATH"))
(setenv "PATH" (getenv "PATH"))
(setenv "PROMPT_COMMAND" "")
(setenv "SHELL" (getenv "SHELL"))
(setenv "TERM" (getenv "TERM"))))

(setq
;; Misc
initial-scratch-message nil
inhibit-splash-screen t
inhibit-startup-buffer-menu t
column-number-mode t
visible-bell t

;; Encoding
prefer-coding-system 'utf-8
set-default-coding-systems 'utf-8
set-language-environment "UTF-8"
set-locale-environment "en_US.UTF-8"

;; Cut/Paste
require-final-newline t
save-interprogram-paste-before-kill t
select-enable-primary nil

;; Indentation
c-basic-offset 2
cperl-indent-level 2
js-indent-level 2
tab-width 2
indent-tabs-mode nil

;; Mouse
mouse-wheel-follow-mouse 't
mouse-wheel-progressive-speed nil
mouse-wheel-scroll-amount '(3 ((shift) . 3))
mouse-yank-at-point t

;; Scrolling
auto-window-vscroll nil
scroll-conservatively 101
scroll-down-aggressively 0.0
scroll-margin 0
scroll-preserve-screen-position 1
scroll-step 1
scroll-up-aggressively 0.0)

;; Autoload custom file on start
(setq custom-file "~/.emacs.d/custom.el")
(if (file-exists-p custom-file)
(load custom-file)
(write-region "" nil custom-file))


;;; Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun append-to-list (list-var elements)
"Append ELEMENTS to the end of LIST-VAR."
(set list-var (append (symbol-value list-var) elements)))


;;; Input ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Buffers
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x x") 'kill-buffer-and-window)
(global-set-key (kbd "<C-tab>") 'next-buffer)
(global-set-key (kbd "<C-iso-lefttab>") 'previous-buffer)
(global-set-key (kbd "M--") (lambda() (interactive)
(split-window-vertically)
(other-window 1 nil)
(switch-to-next-buffer)))
(global-set-key (kbd "M-=") (lambda() (interactive)
(split-window-horizontally)
(other-window 1 nil)
(switch-to-next-buffer)))

;; Comments
(global-set-key (kbd "C-c c") 'comment-or-uncomment-region)

;; Mouse
(global-set-key (kbd "<mouse-4>") (lambda() (interactive)
(scroll-down 4)))
(global-set-key (kbd "<mouse-5>") (lambda() (interactive)
(scroll-up 4)))

;; Movement
(global-set-key (kbd "<M-down>") 'windmove-down)
(global-set-key (kbd "<M-left>") 'windmove-left)
(global-set-key (kbd "<M-right>") 'windmove-right)
(global-set-key (kbd "<M-up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)


;;; Package Manager ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'package)
(setq package-user-dir "~/.emacs.d/pkg/"
package-archives
'(("GNU ELPA" . "http://elpa.gnu.org/packages/")
("MELPA Stable" . "https://stable.melpa.org/packages/")
("MELPA" . "https://melpa.org/packages/"))
package-archive-priorities
'(("MELPA Stable" . 3)
("GNU ELPA" . 2)
("MELPA" . 1)))
(package-initialize)

;; Install 'use-package' if not present
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)


;;; Built-in Packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package async
:config (async-bytecomp-package-mode '(all)))

(use-package auto-compile
:config
(auto-compile-on-load-mode)
(auto-compile-on-save-mode))

(use-package auto-dictionary)

(use-package elfeed
:bind ("C-x w" . elfeed)
:config
(setq elfeed-search-filter "@1-week-ago +unread "
url-queue-timeout 30)
(if (file-exists-p "~/.emacs.d/elfeed.el")
(load-file "~/.emacs.d/elfeed.el")))

(use-package eshell
:config
(setq eshell-cmpl-cycle-completions nil
eshell-error-if-no-glob t
eshell-hist-ignoredups t
eshell-history-size 4096
eshell-prefer-lisp-functions t
eshell-save-history-on-exit t
eshell-scroll-to-bottom-on-input 'all)

(setq eshell-prompt-function
(lambda nil
(concat
"[" (user-login-name) "@" (system-name) " "
(if (= (length (eshell/pwd)) (length (getenv "HOME")))
"~" (eshell/basename (eshell/pwd))) "]"
(if (= (user-uid) 0) "# " "$ ")))
eshell-prompt-regexp "^[^#$\n]*[#$] ")

(add-hook
'eshell-mode-hook
(lambda()
(append-to-list 'eshell-visual-commands
'("alsamixer" "htop" "top" "nano" "vi" "vim" "less" "ssh"
"tail" "watch"))

(eshell/alias "clear" "eshell-clear")
(eshell/alias "cp" "cp -ip $1 $2")
(eshell/alias "cr" "cp -ipr $1 $2")
(eshell/alias "hurl" "curl --fail --location --remote-name-all --progress-bar $*")
(eshell/alias "df" "df -h $*")
(eshell/alias "di" "df -hi $*")
(eshell/alias "free" "free -h $*")
(eshell/alias "l" "ls -hSC --color=auto --group-directories-first $*")
(eshell/alias "la" "ls -ahSC --color=auto --group-directories-first $*")
(eshell/alias "ll" "ls -halS --color=auto --group-directories-first $*")
(eshell/alias "ls" "ls -hSC --color=auto --group-directories-first $*")
(eshell/alias "mkcd" "mkdir -vp $1; cd $1")
(eshell/alias "mkdir" "mkdir -vp $*")
(eshell/alias "rf" "rm -rf $*")
(eshell/alias "rm" "rm -i $*")
(eshell/alias "rr" "rm -ir $*")))

(defun eshell-clear()
"Clear the eshell buffer"
(let ((inhibit-read-only t))
(erase-buffer)
(eshell-send-input)))

(defun eshell-new()
"Open a new instance of eshell."
(interactive)
(eshell 'N)))

(use-package eww
:config
(setq browse-url-browser-function 'eww-browse-url
shr-blocked-images "")

(defun eww-toggle-images()
"Toggle blocking images in eww."
(interactive)
(if (bound-and-true-p shr-blocked-images)
(setq shr-blocked-images nil)
(setq shr-blocked-images ""))
(eww-reload))

(defun eww-new()
"Open a new instance of eww."
(interactive)
(let ((url (read-from-minibuffer "Enter URL or keywords: ")))
(switch-to-buffer (generate-new-buffer "*eww*"))
(eww-mode)
(eww url)))

(defun eww-open-url-in-new()
"Open link under cursor in new instance of eww"
(interactive)
(let ((url (get-text-property (point) 'shr-url)))
(print url)
(switch-to-buffer (generate-new-buffer "*eww*"))
(eww-mode)
(eww url))))

(use-package gnus
:config
(gnus-add-configuration
'(article
(horizontal 1.0
(vertical 25 (group 1.0))
(vertical 1.0
(summary 0.25 point)
(article 1.0)))))
(gnus-add-configuration
'(summary
(horizontal 1.0
(vertical 25 (group 1.0))
(vertical 1.0 (summary 1.0 point))))))

(use-package ibuffer
:config
(add-hook 'ibuffer-hook
(lambda()
(ibuffer-do-sort-by-alphabetic)
(ibuffer-do-sort-by-major-mode))))

(use-package scratch
:config
(defun scratch-new()
"Open a new scratch buffer."
(interactive)
(switch-to-buffer (generate-new-buffer "*scratch*"))
(lisp-mode)))

(use-package server
:bind ("C-x C-c" . server-stop)
:config (unless (server-running-p)(server-start))

(defun server-kill()
"Delete current Emacs server, then kill Emacs"
(interactive)
(server-force-delete)
(kill-emacs))

(defun server-stop()
"Prompt to save buffers, then kill Emacs."
(interactive)
(if (y-or-n-p "Quit Emacs? ")
(save-buffers-kill-emacs)))

(defun server-update()
"Refresh package contents, then update all packages."
(interactive)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(package-utils-upgrade-all)))

(use-package xclip
:config (xclip-mode 1))


;;; Extras ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package circe
:config
(add-hook 'circe-chat-mode-hook 'my-circe-prompt)
(add-hook 'circe-message-option-functions 'my-circe-message-option-chanserv)
(add-hook 'lui-mode-hook (lambda() (my-lui-setup) (my-circe-set-margin)))
(if (file-exists-p "~/.emacs.d/circe.el")
(load-file "~/.emacs.d/circe.el"))

(setq circe-default-part-message ""
circe-default-quit-message ""
circe-format-server-topic "*** Topic change by {userhost}: {topic-diff}"
circe-reduce-lurker-spam t
circe-use-cycle-completion t
lui-fill-type nil
lui-flyspell-alist '((".*" "american"))
lui-flyspell-p t
lui-time-stamp-format "%H:%M:%S"
lui-time-stamp-position 'left-margin)

(require 'circe-chanop)
(enable-circe-color-nicks)

(defun my-circe-set-margin() (setq left-margin-width 9))
(setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)

(defun my-lui-setup()
(setq fringes-outside-margins t
left-margin-width 9
word-wrap t
wrap-prefix ""))

(defun my-circe-prompt()
(lui-set-prompt
(concat (propertize
(concat (buffer-name) ">")
'face 'circe-prompt-face) " ")))

(defun my-circe-message-option-chanserv (nick user host command args)
(when (and (string= "ChanServ" nick)
(string-match "^\\[#.+?\\]" (cadr args)))
'((dont-display . t)))))

(use-package cmake-ide
:config (cmake-ide-setup))

(use-package company
:config
(add-hook 'prog-mode-hook 'company-mode)
(add-hook 'text-mode-hook 'company-mode))

(use-package company-irony
:config (add-to-list 'company-backends 'company-irony))

(use-package company-irony-c-headers
:config
(add-to-list 'company-backends '(company-irony-c-headers company-irony)))

(use-package counsel
:bind (("<f1> f" . counsel-describe-function)
("<f1> l" . counsel-find-library)
("<f1> v" . counsel-describe-variable)
("<f2> i" . counsel-info-lookup-symbol)
("<f2> u" . counsel-unicode-char)
("C-S-o" . counsel-rhythmbox)
("C-c g" . counsel-git)
("C-c j" . counsel-git-grep)
("C-c l" . counsel-ag)
("C-r" . counsel-expression-history)
("C-x C-f" . counsel-find-file)
("C-x l" . counsel-locate)
("M-x" . counsel-M-x)))

(use-package diff-hl
:config
(add-hook 'prog-mode-hook 'diff-hl-mode)
(add-hook 'text-mode-hook 'diff-hl-mode))

(use-package eww-lnum
:config
(define-key eww-mode-map "f" 'eww-lnum-follow)
(define-key eww-mode-map "F" 'eww-lnum-universal))

(use-package flycheck
:config (add-hook 'prog-mode-hook 'flycheck-mode))

(use-package flymake)

(use-package flyspell
:config
(add-hook 'flyspell-mode-hook (auto-dictionary-mode 1))
(add-hook 'markdown-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
(add-hook 'text-mode-hook 'flyspell-mode))

(use-package go-mode
:config
(add-hook 'before-save-hook 'gofmt-before-save)
(add-hook 'go-mode-hook (lambda()
(setq tab-width 4
indent-tabs-mode 1))))

(use-package highlight-indent-guides
:config
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
(setq highlight-indent-guides-method 'character))

(use-package irony
:config
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
(define-key irony-mode-map [remap completion-at-point] 'counsel-irony)
(define-key irony-mode-map [remap complete-symbol] 'counsel-irony)
(setq irony-additional-clang-options '("-std=c++14")))

(use-package ivy
:bind (("C-c C-r" . ivy-resume)
("<f6>" . ivy-resume))
:config
(ivy-mode 1)
(setq ivy-use-virtual-buffers t
enable-recursive-minibuffers t))

(use-package magit)

(use-package no-littering)

(use-package nov
:config (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))

(use-package rainbow-delimiters
:config
(add-hook 'markdown-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'text-mode-hook 'rainbow-delimiters-mode))

(use-package ranger)

(use-package smartparens
:config
(add-hook 'markdown-mode-hook 'smartparens-mode)
(add-hook 'prog-mode-hook 'smartparens-mode)
(add-hook 'text-mode-hook 'smartparens-mode)
(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay nil
sp-highlight-wrap-tag-overlay nil))

(use-package swiper
:bind ("C-s" . swiper))

(use-package undo-tree
:config (global-undo-tree-mode))

+ 0
- 219
etc/i3/config View File

@@ -1,219 +0,0 @@
# /etc/i3/config

### Startup ######################################

## Disable DPMS
exec --no-startup-id xset s off -dpms

## i3wm modifier key
set $mod Mod4

## Applications
bindsym $mod+d exec dmenu_run
bindsym $mod+Return exec dbus-launch gnome-terminal


### Appearance ###################################

## Font
font pango:Noto Mono Regular 9.5

## Taskbar
bar {
position top
status_command i3status

colors {
background #333333
statusline #eeeeee
separator #eeeeee

focused_workspace #eeeeee #00894e
active_workspace #eeeeee #777777
inactive_workspace #eeeeee #333333
urgent_workspace #eeeeee #b22222
}
}

## Colors
exec --no-startup-id xsetroot -solid '#333333'
client.background #333333
client.focused #00894e #00894e #eeeeee #30f277 #00894e
client.focused_inactive #333333 #333333 #eeeeee #888888 #333333
client.placeholder #333333 #333333 #eeeeee #333333 #333333
client.unfocused #333333 #333333 #888888 #888888 #333333
client.urgent #b22222 #b22222 #eeeeee #ff5454 #b22222


### System #######################################

## Reload
set $Config Reload i3 config (r), Live restart of i3 (Shift+r)
bindsym $mod+Shift+r mode "$Config"
mode "$Config" {
bindsym r reload
bindsym Shift+r restart

bindsym Escape mode "default"
}

## i3lock
set $Locker xset s 10 dpms 10 && i3lock -c 333333 -n && xset s off -dpms

## Menu
set $System Lock (l), Logout (e), Reboot (r), Shutdown (s)
bindsym $mod+Home mode "$System"
mode "$System" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym r exec --no-startup-id reboot, mode "default"
bindsym s exec --no-startup-id poweroff -i, mode "default"

bindsym Escape mode "default"
}


### Display ######################################

## Auto-enable/disable HDMI-1
exec --no-startup-id \
while :; do \
if [ $(xrandr | grep -c 'HDMI-1 connected') == 1 ]; then \
xrandr \
--output DP-1 --off \
--output LVDS-1 --primary --mode 1366x768 --pos 554x1080 --rotate normal \
--output HDMI-1 --mode 1920x1080 --pos 0x0 --rotate normal \
--output VGA-1 --off; \
else \
xrandr --output DP-1 --off \
--output LVDS-1 --primary --mode 1366x768 --pos 0x0 --rotate normal \
--output VGA-1 --off \
--output HDMI-1 --off; \
fi; \
sleep 2; \
done


#### Keybinds ####################################

## Window splitting
bindsym $mod+h split h
bindsym $mod+v split v

## Fullscreen focused container
bindsym $mod+f fullscreen toggle

## Kill focused window
bindsym $mod+Shift+q kill

## Cycle frame layout
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

## Change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

## Move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

## Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

## Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

## Focus the parent container
bindsym $mod+a focus parent

## Drag floating windows with Mouse+$mod
floating_modifier $mod

## Toggle floating on focused frame
bindsym $mod+Shift+space floating toggle

## Change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

## Floating rules
for_window [window_role="pop-up"] floating enable

## Resize
bindsym $mod+r mode "resize"
mode "resize" {
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt

bindsym Escape mode "default"
}

## Screenshot (scrot)
bindsym Print \
exec --no-startup-id scrot $HOME/Pictures/`date +%Y-%m-%d_%H:%M:%S`.png
bindsym $mod+Print \
exec --no-startup-id scrot -u $HOME/Pictures/`date +%Y-%m-%d_%H:%M:%S`.png
bindsym Shift+Print --release \
exec --no-startup-id scrot -s $HOME/Pictures/`date +%Y-%m-%d_%H:%M:%S`.png

## Audio (PulseAudio)
bindsym XF86AudioRaiseVolume \
exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume \
exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute \
exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioPlay exec --no-startup-id pactl play-pause
bindsym XF86AudioPause exec --no-startup-id pactl pause
bindsym XF86AudioNext exec --no-startup-id pactl next
bindsym XF86AudioPrev exec --no-startup-id pactl previous

## Audio (Alsa)
# bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 5+
# bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 5-
# bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle

## Brightness (brightnessctl)
# bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set 5%+
# bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-

## Brightness (xbacklight)
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15

+ 0
- 47
etc/i3status.conf View File

@@ -1,47 +0,0 @@
# /etc/i3status.conf

general {
colors = true
interval = 5
}

order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "volume master"
#order += "disk /"
order += "battery all"
order += "load"
order += "tztime local"

wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}

ethernet _first_ {
format_up = "E: %ip (%speed)"
format_down = "E: down"
}

volume master {
format = "🔊: %volume"
format_muted = "🔈: %volume"
device = "default"
}

disk "/" {
format = "%avail"
}

battery all {
format = "%status %percentage %remaining"
}

tztime local {
format = "%Y-%m-%d %H:%M:%S"
}

load {
format = "%1min"
}

+ 21
- 0
etc/portage/sets/gein-base View File

@@ -0,0 +1,21 @@
# gein-base

app-admin/sudo
app-editors/vim
app-misc/tmux
app-text/aspell
dev-vcs/git
media-fonts/noto
media-libs/alsa-lib
media-sound/alsa-utils
net-misc/dhcpcd
sys-apps/mlocate
sys-apps/pciutils
sys-boot/grub:2
sys-kernel/gentoo-sources
sys-kernel/linux-firmware
sys-process/htop
virtual/cron
x11-apps/xset
x11-apps/xsetroot
x11-misc/xclip

+ 8
- 0
etc/portage/sets/gein-i3wm View File

@@ -0,0 +1,8 @@
# gein-i3wm

x11-misc/arandr
x11-misc/dmenu
x11-misc/i3lock
x11-misc/i3status
x11-wm/i3
x11-terms/st

+ 4
- 0
etc/portage/sets/gein-laptop View File

@@ -0,0 +1,4 @@
# gein-laptop

app-laptop/laptop-mode-tools
x11-apps/xbacklight

+ 11
- 0
etc/portage/sets/gein-lxqt View File

@@ -0,0 +1,11 @@
# gein-lxqt

kde-frameworks/breeze-icons
kde-plasma/breeze
kde-plasma/breeze-grub
kde-plasma/breeze-gtk
kde-plasma/kwin
kde-plasma/sddm-kcm
lxde-base/lxappearance
lxqt-base/lxqt-meta
net-misc/cmst

+ 36
- 0
etc/portage/sets/gein-steam View File

@@ -0,0 +1,36 @@
# gein-steam

dev-libs/glib:2
dev-libs/libgcrypt
dev-libs/nspr
dev-libs/nss
gnome-base/gconf
media-libs/alsa-lib
media-libs/fontconfig
media-libs/freetype:2
media-libs/libjpeg-turbo
media-libs/libogg
media-libs/libpng:1.2
media-libs/libsdl
media-libs/libtheora
media-libs/libtxc_dxtn
media-libs/libvorbis
media-libs/openal
net-misc/curl
net-print/cups
sys-apps/dbus
virtual/libusb:1
virtual/opengl
x11-libs/cairo
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXScrnSaver
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/pango
x11-libs/pixman
x11-misc/xdg-user-dirs

+ 0
- 97
etc/sudoers View File

@@ -1,97 +0,0 @@
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

+ 0
- 61
etc/tmux.conf View File

@@ -1,61 +0,0 @@
# /etc/tmux.conf

### General ######################################

## Force reload of config file
unbind r
bind r source-file ~/.tmux.conf

## Terminal
set-option -g xterm-keys on
set -g default-terminal "tmux-256color"

## Keybind preference
setw -g mode-keys vi
set-option -g status-keys vi
set -g mouse on

## Display
set -s escape-time 0
set-option -g repeat-time 0
set -g base-index 1
setw -g pane-base-index 1

## Activate inner-most session (when nesting tmux) to send commands
bind a send-prefix

## History
set -g history-limit 8192


### Keybinds #####################################

## Return to previous window when prefix is pressed twice
bind C-a last-window
bind C-b last-window

## Window cycle/swap
bind e previous-window
bind f next-window
bind E swap-window -t -1
bind F swap-window -t +1
bind -n M-[ previous-window
bind -n M-] next-window

## Moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D

## Easy split pane commands
unbind '"'
unbind %
bind = split-window -h
bind - split-window -v
bind -n M-= split-window -h
bind -n M-- split-window -v

+ 0
- 171
etc/vimrc View File

@@ -1,171 +0,0 @@
" /etc/vimrc

""" Vim-Plug ====================================

if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged') " Minimalist Vim Plugin Manager


""" Settings ====================================

Plug 'tpope/vim-sensible' " Sensible Defaults

set t_BE= " Disable bracketed paste
set nocompatible " be iMproved, required
set nobackup "
set noswapfile "
set termencoding=utf-8 " UTF8 as default encoding
set encoding=utf-8 " ...
set scrolloff=100


""" Input =======================================

set mouse=a " Enable mouse support
set clipboard=unnamedplus " Share X11 clipboard
let mapleader = ','

"
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" Fold Mappings
inoremap <leader>z <C-O>za
nnoremap <leader>z za
onoremap <leader>z <C-C>za
vnoremap <leader>z zf

" Use <leader>/ to clear search highlight
nmap <silent> <leader>/ :nohlsearch<CR>

"
set pastetoggle=<F2>
set listchars=tab:\|.,trail:.,extends:#,nbsp:.

" Write target file as sudo using 'tee' buffer
function SudoWrite()
w !sudo tee %
endfunction


""" Display =====================================

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline#extensions#tabline#enabled = 1

Plug 'edkolev/tmuxline.vim'
let g:tmuxline_powerline_separators = 0

if has('gui_running')
colorscheme slate
set guifont=Noto\ Mono\ Regular\ 10
set background=dark
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
endif


""" Utilities ===================================

Plug 'spolu/dwm.vim' " Tiled Window Management
Plug 'Shougo/vimfiler.vim' " Powerful file explorer
Plug 'tpope/vim-eunuch' " Helpers for UNIX
Plug 'tpope/vim-dispatch' " Async Build/Test
Plug 'benmills/vimux' " tmux Integration

Plug 'mileszs/ack.vim' " Enhanced Grepping within Vim
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif

Plug 'ctrlpvim/ctrlp.vim' " Fuzzy file/buffer/mru/tag/etc finder
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']

Plug 'universal-ctags/ctags' " ctags implementation
Plug 'majutsushi/tagbar' " Displays tags in a window
nmap <F8> :TagbarToggle<CR>

Plug 'francoiscabrol/ranger.vim'


""" Languages ===================================

Plug 'sheerun/vim-polyglot' " Language Support

Plug 'scrooloose/syntastic' " Syntax checking hacks for vim
nmap <leader>c :SyntasticCheck<CR>
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_error_symbol="S>"
let g:syntastic_style_error_symbol="E>"
let g:syntastic_warning_symbol="W>"
let g:syntastic_style_warning_symbol="W>"

Plug 'fatih/vim-go' " Go development plugin for Vim
let g:go_auto_type_info = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1


""" Editor ======================================

set tabstop=4 " Tabs are 4 columns
set shiftwidth=4 " ...
set softtabstop=4 " ...
set expandtab " Change tabs to spaces

set list " Show whitespace
set number " Show line numbers
set wrap linebreak nolist
autocmd BufWritePre * %s/\s\+$//e " Delete trailing whitespace on save

Plug 'tpope/vim-sleuth' " Heuristically set buffer options
Plug 'nathanaelkane/vim-indent-guides' " Visaully display indent level

Plug 'junegunn/vim-easy-align' " Easier text alignment
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)

Plug 'ervandew/supertab' " Vim insert mode completions with Tab
Plug 'tpope/vim-surround' " Quoting/Parenthesizing made simple
Plug 'junegunn/limelight.vim' " Hyperfocus-writing in Vim


""" Version Control System ======================

Plug 'airblade/vim-gitgutter' " Show git diff in the gutter
nmap <Leader>ha <Plug>GitGutterStageHunk
nmap <Leader>hr <Plug>GitGutterUndoHunk

Plug 'tpope/vim-fugitive' " Git wrapper
Plug 'tpope/vim-git' " Git integration
Plug 'mattn/gist-vim' " Gist upload (GitHub)

call plug#end()

+ 109
- 98
install.sh View File

@@ -1,6 +1,7 @@
#!/usr/bin/env sh
#
# Copyright (C) 2017 Johnathan C Maudlin <jcmdln@gmail.com>
#
# This software is licensed under the Azryn Software Labs Public License
# of version 1.1.0 or later. You should have received a copy of the
# Azryn Software Labs Public License along with this program. If not,
@@ -14,13 +15,6 @@
#


# This script heavily relies on downloading configuration files from the
# main repository. If you have cloned gein and made your own changes
# to the configuration files, you may change the $Source URL as needed.

Source="https://raw.githubusercontent.com/jcmdln/gein/master"


# This section defines the basic variables needed in order to complete
# the installation. Your root password is set to the value of $Hostname
# for simplicity. Change your root password with 'passwd' after the
@@ -41,6 +35,14 @@ TimeZone="America/New_York"
#VideoCards="virtualbox vmware"


# This script relies on downloading primary configuration files from both
# the main repository and auxiliary configuration files from a separate
# repository.

Source="https://raw.githubusercontent.com/jcmdln/gein/master"
Config="https://raw.githubusercontent.com/jcmdln/cfg/master"


# By default, $AutoKernel is set to 'true' which means that the kernel
# will be built using 'make defconfig'. If you want to run
# 'make defconfig; make menuconfig' then set $AutoKernel to 'false'. You
@@ -56,7 +58,8 @@ AutoKernel="true"
# interacting with Portage though this section simply creates easily
# referenced variables that may be called later in this script. At the
# time of writing, the Gentoo stage3 no longer includes 'git' which
# prevents using the GitHub mirror. Please leave this commented for now.
# prevents using the GitHub mirror. Please leave this commented unless
# you plan to emerge git ahead of time.

MakeConf="$Source/etc/portage/make.conf"
PackageAcceptKeywords="$Source/etc/portage/package.accept_keywords"
@@ -72,12 +75,12 @@ PackageUse="$Source/etc/portage/package.use"
# errors when executing MINIMAL() or DESKTOP() due to cURL missing
# after completing the BOOTSTRAP().

S3Arch="amd64"
S3Src="http://distfiles.gentoo.org/releases/$S3Arch/autobuilds"
S3Txt="curl -s $S3Src/latest-stage3-$S3Arch.txt"
[ -x "$(command -v curl)" ] && \
S3Cur="$($S3Txt|tail -1|awk '{print $1}')" && \
Stage3="$S3Src/$S3Cur"
S3_Arch="amd64"
S3_Source="http://distfiles.gentoo.org/releases/$S3_Arch/autobuilds"
S3_Release="curl -s $S3_Source/latest-stage3-$S3_Arch.txt"
[ -x "$(command -v curl)" ] &&
S3_Current="$($S3_Release|tail -1|awk '{print $1}')" &&
Stage3="$S3_Source/$S3_Current"


# Bootstrapping a Gentoo stage3 archive is a fairly quick process though
@@ -103,8 +106,8 @@ BOOTSTRAP() {
fi

echo "gein: Ensuring we are in /mnt/gentoo..."
[ ! -e /mnt/gentoo/$(basename $0) ] && \
cp $0 /mnt/gentoo/ && \
[ ! -e /mnt/gentoo/$(basename $0) ] &&
cp $0 /mnt/gentoo/ &&
cd /mnt/gentoo

echo "gein: Setting system time via ntpd..."
@@ -126,9 +129,9 @@ BOOTSTRAP() {
if [ -e /mnt/gentoo/$target ]; then
case $target in
proc) mount -t proc /proc /mnt/gentoo/proc;;
sys ) mount --rbind /sys /mnt/gentoo/sys
sys ) mount --rbind /sys /mnt/gentoo/sys &&
mount --make-rslave /mnt/gentoo/sys;;
dev ) mount --rbind /dev /mnt/gentoo/dev
dev ) mount --rbind /dev /mnt/gentoo/dev &&
mount --make-rslave /mnt/gentoo/dev;;
*) echo "gein: $target: Improper hardware device"
exit
@@ -151,27 +154,39 @@ BOOTSTRAP() {
cp -L /etc/resolv.conf /mnt/gentoo/etc/

echo "gein: Downloading portage configuration files..."
[ ! -z $MakeConf ] && \
[ ! -z $MakeConf ] &&
wget -q $MakeConf \
-O /mnt/gentoo/etc/portage/make.conf
[ ! -z $PackageAcceptKeywords ] && \
[ ! -z $PackageAcceptKeywords ] &&
wget -q $PackageAcceptKeywords \
-O /mnt/gentoo/etc/portage/package.accept_keywords
[ ! -z $PackageEnv ] && \
[ ! -z $PackageEnv ] &&
wget -q $PackageEnv \
-O /mnt/gentoo/etc/portage/package.env
[ ! -z $PackageLicense ] && \
[ ! -z $PackageLicense ] &&
wget -q $PackageLicense \
-O /mnt/gentoo/etc/portage/package.license
[ ! -z $PackageUse ] && \
rm -rf /mnt/gentoo/etc/portage/package.use && \
[ ! -z $PackageUse ] &&
rm -rf /mnt/gentoo/etc/portage/package.use &&
wget -q $PackageUse \
-O /mnt/gentoo/etc/portage/package.use
[ ! -z $ReposConf ] && \
mkdir -p /mnt/gentoo/etc/portage/repos.conf && \
[ ! -z $ReposConf ] &&
mkdir -p /mnt/gentoo/etc/portage/repos.conf &&
wget -q $ReposConf \
-O /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

echo "gein: Downloading gein Portage package sets..."
PortageSets="
/etc/portage/sets/gein-base
/etc/portage/sets/gein-i3wm
/etc/portage/sets/gein-laptop
/etc/portage/sets/gein-lxqt
/etc/portage/sets/gein-steam
"
for Set in $PortageSets; do
wget -q $Source/$Set -0 $Set
done

echo "gein: Chroot'ing into /mnt/gentoo..."
chroot /mnt/gentoo /usr/bin/env -i \
HOME="/root" TERM="$TERM" PS1="[chroot \u@\h \w]$" \
@@ -208,22 +223,8 @@ MINIMAL() {
eselect locale set $TargetLocale
env-update && source /etc/profile && export PS1="[chroot \u@\h \w]$"

echo "gein: Emerging base packages..."
emerge \
-v --quiet-build \
app-admin/sudo \
app-editors/vim \
app-misc/tmux \
dev-util/bcc \
dev-vcs/git \
net-misc/connman \
net-misc/dhcpcd \
sys-apps/pciutils \
sys-boot/grub:2 \
sys-kernel/gentoo-sources \
sys-kernel/linux-firmware \
sys-process/htop \
virtual/cron
echo "gein: Emerging minimal packages..."
emerge -v --quiet-build @gein-base

if grep -Rqi 'intel' /proc/cpuinfo; then
echo "gein: emerging intel-microcode"
@@ -256,7 +257,6 @@ MINIMAL() {

echo "gein: Adding services to OpenRC..."
rc-update add dhcpcd default
rc-update add connman default
rc-update add cronie default

echo "gein: Setting hostname..."
@@ -268,14 +268,11 @@ MINIMAL() {

echo "gein: Adding userland configurations..."
CfgFiles="
/etc/bash/bashrc
/etc/profile
/etc/profile.d/alias.sh
/etc/profile.d/gein.sh
/etc/profile.d/env.sh
/etc/sudoers
/etc/tmux.conf
/etc/vimrc
/etc/bash/bashrc
/etc/profile
/etc/profile.d/alias.sh
/etc/profile.d/gein.sh
/etc/profile.d/env.sh
"
for cfg in $CfgFiles; do
wget -q $Source/$cfg -O $cfg
@@ -297,58 +294,41 @@ DESKTOP() {
env-update && source /etc/profile && export PS1="[chroot \u@\h \w]$"

echo "gein: Installing desktop packages..."
emerge \
-v --quiet-build \
app-editors/emacs \
app-laptop/laptop-mode-tools \
app-portage/gentoolkit \
app-text/aspell \
media-fonts/noto \
media-gfx/scrot \
media-libs/alsa-lib \
media-sound/alsa-utils \
media-sound/pavucontrol \
media-video/mpv \
net-misc/youtube-dl \
sys-apps/mlocate \
x11-apps/xbacklight \
x11-apps/xset \
x11-apps/xsetroot \
x11-misc/arandr \
x11-misc/dmenu \
x11-misc/i3lock \
x11-misc/i3status \
x11-misc/xclip \
x11-terms/gnome-terminal \
x11-wm/i3

echo "gein: Add laptop_mode to OpenRC..."
rc-update add laptop_mode default
emerge -v --quiet-build @gein-base $DesktopChoice

echo "gein: Adding userland configuration files..."
CfgFiles="
/etc/Xresources
/etc/emacs/default.el
/etc/i3/config
/etc/i3status.conf
/etc/xinitrc
"
[ ! -d /etc/emacs ] && mkdir -p /etc/emacs
for cfg in $CfgFiles; do
wget -q $Source/$cfg -O $cfg
done
if [ ! -z $DesktopConfig ]; then
echo "gein: Adding configuration files..."
fi
}

LAPTOP() {
echo "gein: Installing laptop packages..."
emerge -v --quiet-build @gein-laptop

echo "azryn: Add laptop_mode to OpenRC..."
rc-update add laptop_mode default
}


# This section is for completing tasks after the installation is
# complete. The user will have a complete system already installed and
# may skip these steps if desired.

POSTINSTALL() {
echo "gein: Creating 'power' group"
groupadd power
# poweroff reboot shutdown

read -ep "gein: Install laptop packages? [Y/N]: " SetupUser
if echo $SetupUser | grep -iq "^y"; then
emerge -v --quiet-build @gein-laptop
fi

read -ep "gein: Setup a standard user? [Y/N]: " SetupUser
if echo $SetupUser | grep -iq "^y"; then
read -ep "Username: " Username
read -ep "Password: " Password
useradd -m -G wheel,audio,video -s /bin/bash $Username
useradd -m -G wheel,audio,video,power -s /bin/bash $Username
echo $Username:$Password | chpasswd
fi
}
@@ -370,18 +350,49 @@ case $1 in
;;

-d|desktop)
MINIMAL
DESKTOP
POSTINSTALL
case $2 in
i3)
DesktopChoice="@gein-i3wm"
DesktopConfig="
/etc/i3/config
/etc/xinitrc
"
MINIMAL && DESKTOP && POSTINSTALL
;;

lxqt)
DesktopChoice="@gein-lxqt"
MINIMAL && DESKTOP

echo "azryn: Set SDDM as the display manager"
sed -i 's/DISPLAYMANAGER="xdm"/DISPLAYMANAGER="sddm"/g' \
/etc/conf.d/xdm
sed -i 's/startlxqt/"ck-launch-session dbus-launch startlxqt"/g' \
/usr/share/xsessions/lxqt.desktop
rc-update add xdm default
rc-update add dbus default

POSTINSTALL
;;

*)
echo "gein: $2 not an available desktop"
echo ""
echo "Available desktops:"
echo " i3 A complete i3wm desktop"
echo " lxqt A complete LXQT desktop"
esac
;;

*)
echo "gein: Linux-based derivative of Gentoo"
echo " -h help Shows this output"
echo " -b bootstrap Bootstrap the stage3 tarball"
echo " -h, help Shows this output"
echo " -b, bootstrap Bootstrap the stage3 tarball"
echo ""
echo "Post-bootstrap:"
echo " -m minimal Perform a basic Gentoo installation"
echo " -d desktop Install a complete gein desktop"
echo " -m, minimal Perform a basic Gentoo installation"
echo " -d, desktop Install a gein desktop"
echo " i3 A complete i3wm desktop"
echo " lxqt A complete LXQT desktop"
esac
shopt -u nocasematch

Loading…
Cancel
Save