Browse Source

more fixes

main
Cian Butler 3 years ago
parent
commit
5bd69de44f
Signed by: butlerx GPG Key ID: B37CA765BAA89170
10 changed files with 94 additions and 85 deletions
  1. +1
    -0
      eslintrc.js
  2. +1
    -1
      i3/config
  3. +28
    -30
      i3/i3lock.sh
  4. +17
    -15
      setup.sh
  5. +12
    -0
      sshconfig
  6. +7
    -15
      tmux/tmux_mem_cpu_load
  7. +1
    -1
      tmux/uptime.sh
  8. +1
    -0
      vimrc.d/ale.vim
  9. +12
    -12
      xinitrc
  10. +14
    -11
      zsh.d/docker-functions.zsh

+ 1
- 0
eslintrc.js View File

@@ -2,6 +2,7 @@ module.exports = {
env: {
es6: true,
node: true,
browser: true,
},
root: true,
extends: ['airbnb'],


+ 1
- 1
i3/config View File

@@ -149,7 +149,7 @@ gaps outer 10
smart_gaps on

#Nautilus
bindsym $mod+Shift+U exec nautilus --no-desktop --browser
bindsym $mod+Shift+U exec nautilus --browser

# rofi
bindsym $alt+Tab exec rofi -show window


+ 28
- 30
i3/i3lock.sh View File

@@ -1,41 +1,39 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

# Variables
tmpbg='/tmp/screen.png'
B='#00000000' # blank
C='#ffffff22' # clear ish
D='#032e72ff' # default
T='#27027cff' # text
W='#c60707bb' # wrong
V='#bb00bbbb' # verifying
B='#00000000' # blank
C='#ffffff22' # clear ish
D='#032e72ff' # default
T='#27027cff' # text
W='#c60707bb' # wrong
V='#bb00bbbb' # verifying

# Take Screenshot and pixelate it
scrot "$tmpbg"
convert "$tmpbg" -scale 4% -scale 2500% "$tmpbg"

i3lock -i "$tmpbg" \
--insidevercolor=$C \
--ringvercolor=$V \
--insidewrongcolor=$C \
--ringwrongcolor=$W \
--insidecolor=$C \
--ringcolor=$D \
--linecolor=$B \
--separatorcolor=$D \
--textcolor=$T \
--timecolor=$T \
--timesize=64 \
--datesize=28 \
--datecolor=$T \
--keyhlcolor=$W \
--bshlcolor=$W \
--clock \
--indicator \
--timestr="%H:%M:%S" \
--datestr="%A, %m %Y" \
--wrongtext="Nope!" \
--radius=180 \
--textsize=56
i3lock -i "$tmpbg" \
--insidevercolor=$C \
--ringvercolor=$V \
--insidewrongcolor=$C \
--ringwrongcolor=$W \
--insidecolor=$C \
--ringcolor=$D \
--linecolor=$B \
--separatorcolor=$D \
--timecolor=$T \
--timesize=64 \
--datesize=28 \
--datecolor=$T \
--keyhlcolor=$W \
--bshlcolor=$W \
--clock \
--indicator \
--timestr="%H:%M:%S" \
--datestr="%A, %m %Y" \
--wrongtext="Nope!" \
--radius=180

# Clean up
rm "$tmpbg"

+ 17
- 15
setup.sh View File

@@ -1,17 +1,19 @@
#!/bin/bash
#!/usr/bin/env sh

set -ex

git clone https://github.com/butlerx/dotfiles.git "$HOME/.dotfiles"
# nvim or vim
which nvim;
which nvim
NVIM_INSTALL=$?
if [ $NVIM_INSTALL -eq 0 ]; then
mkdir -p "${XDG_CONFIG_HOME:=$HOME/.config}"
ln -s ~/.vim "$XDG_CONFIG_HOME/nvim"
ln -s "$HOME/.dotfiles/vimrc" "$XDG_CONFIG_HOME/nvim/init.vim"
nvim +qall
mkdir -p "${XDG_CONFIG_HOME:=$HOME/.config}"
ln -s ~/.vim "$XDG_CONFIG_HOME/nvim"
ln -s "$HOME/.dotfiles/vimrc" "$XDG_CONFIG_HOME/nvim/init.vim"
nvim +qall
else
ln -s "$HOME/.dotfiles/vimrc" "$HOME/.vimrc"
vim +qall
ln -s "$HOME/.dotfiles/vimrc" "$HOME/.vimrc"
vim +qall
fi
# zsh
ln -s "$HOME/.dotfiles/zshrc" "$HOME/.zshrc"
@@ -37,12 +39,12 @@ git config --global user.name "$GITHUB_EMAIL"
# X11
echo "Do you use i3? (y/N)"
read -r answer
if echo "$answer" | grep -iq "^y" ; then
ln -s "$HOME/.dotfiles/xinitrc" "$HOME/.xinitrc"
ln -s "$HOME/.dotfiles/i3" "$HOME/.i3"
ln -s "$HOME/.dotfiles/polybar" "$HOME/.config/polybar/config"
git clone https://github.com/butlerx/bash-bin.git "$HOME/bin"
echo "This setup uses rofi, polybar, nautalis and feh which youll need to setup with your package manager"
if echo "$answer" | grep -iq "^y"; then
ln -s "$HOME/.dotfiles/xinitrc" "$HOME/.xinitrc"
ln -s "$HOME/.dotfiles/i3" "$HOME/.i3"
ln -s "$HOME/.dotfiles/polybar" "$HOME/.config/polybar/config"
git clone https://github.com/butlerx/bash-bin.git "$HOME/bin"
echo "This setup uses rofi, polybar, nautalis and feh which youll need to setup with your package manager"
else
echo "To each there own"
echo "To each there own"
fi

+ 12
- 0
sshconfig View File

@@ -2,6 +2,10 @@ Host pyg
HostName pyg.redbrick.dcu.ie
user butlerx

Host meth
HostName metharme.redbrick.dcu.ie
user butlerx

Host rb
HostName redbrick.dcu.ie
user butlerx
@@ -25,3 +29,11 @@ Host paphos
Host zeus
HostName zeus.redbrick.dcu.ie
user alfred

Host albus
HostName albus.redbrick.dcu.ie
user alfred

Host pyg.alfred
HostName pyg.redbrick.dcu.ie
user alfred

+ 7
- 15
tmux/tmux_mem_cpu_load View File

@@ -5,7 +5,9 @@ and code from psutil top.py.
"""
import os
import sys

import psutil

if os.name != 'posix':
sys.exit('platform not supported')

@@ -13,9 +15,8 @@ if os.name != 'posix':
def get_dashes(perc):
""" Generate dashes """
dashes = "|" * int((float(perc) / 10))
empty_dashes = " " * (10 - len(dashes))

return dashes, empty_dashes
return dashes, (" " * (10 - len(dashes)))


def info():
@@ -23,22 +24,13 @@ def info():
mem = psutil.virtual_memory()
cpu = psutil.cpu_percent(interval=0.1)
cpu_dashes, cpu_empty_dashes = get_dashes(cpu)
line = "%s/%s MB [%s%s]%5s%%" % (
str(int(mem.used / 1024 / 1024)),
str(int(mem.total / 1024 / 1024)),
cpu_dashes, cpu_empty_dashes, cpu,
)
return "%s/%s MB [%s%s]%5s%%" % (str(int(mem.used / 1024 / 1024)),
str(int(mem.total / 1024 / 1024)),
cpu_dashes, cpu_empty_dashes, cpu)

return line


def main():
"""main"""
if __name__ == '__main__':
try:
print(info())
except (KeyboardInterrupt, SystemExit):
pass


if __name__ == '__main__':
main()

+ 1
- 1
tmux/uptime.sh View File

@@ -1,2 +1,2 @@
#!/bin/bash
#!/usr/bin/env sh
uptime | awk -F '( |,|:)+' '{print $6,$7,$8":"$9}'

+ 1
- 0
vimrc.d/ale.vim View File

@@ -1,5 +1,6 @@
let g:ale_fixers = {
\ 'javascript': ['prettier_eslint', 'prettier', 'eslint', 'trim_whitespace', 'remove_trailing_lines'],
\ 'html': ['eslint', 'trim_whitespace', 'remove_trailing_lines'],
\ 'json': ['prettier', 'fixjson', 'jq', 'trim_whitespace', 'remove_trailing_lines'],
\ 'scss': ['prettier', 'stylelint', 'trim_whitespace', 'remove_trailing_lines'],
\ 'css': ['prettier', 'stylelint', 'trim_whitespace', 'remove_trailing_lines'],


+ 12
- 12
xinitrc View File

@@ -1,24 +1,24 @@
#!/bin/sh
#!/usr/bin/env sh

# merge in defaults and keymaps
[ -f ~/.dotfiles/Xresources ] && xrdb -merge -I"$HOME" ~/.dotfiles/Xresources
[ -f /etc/X11/xinit/.Xresources ] && xrdb -merge /etc/X11/xinit/.Xresources
[ -f /etc/X11/xinit/.Xmodmap ] && xmodmap /etc/X11/xinit/.Xmodmap
[ -f ~/.dotfiles/Xmodmap ] && xmodmap ~/.dotfiles/Xmodmap
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
# shellcheck disable=SC1091
# shellcheck source=/etc/X11/xinit/xinitrc.d/*.sh
[ -x "$f" ] && . "$f"
done
unset f
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
# shellcheck disable=SC1091
# shellcheck source=/etc/X11/xinit/xinitrc.d/*.sh
[ -x "$f" ] && . "$f"
done
unset f
fi

session=${1:-xfce}

case $session in
i3|i3wm ) exec i3;;
xfce|xfce4 ) exec startxfce4;;
# No known session, try to run it as command
* ) exec "$1";;
i3 | i3wm) exec i3 ;;
xfce | xfce4) exec startxfce4 ;;
# No known session, try to run it as command
*) exec "$1" ;;
esac

+ 14
- 11
zsh.d/docker-functions.zsh View File

@@ -1,17 +1,16 @@
#!/usr/bin/env zsh

docker-tty() {
tty=tty -s &&
docker run \
--tty \
--interactive \
--rm \
--user "$(id -u)":"$(id -g)" \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume "$(pwd)":/app \
--workdir /app \
"$@"
docker run \
--tty \
--interactive \
--rm \
--user "$(id -u)":"$(id -g)" \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume "$(pwd)":/app \
--workdir /app \
"$@"
}

compose() {
@@ -30,6 +29,10 @@ maven() {
docker-tty maven $@
}

hadolint() {
docker run --rm -i hadolint/hadolint <$@
}

docker-ip() {
docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}, {{end}}' "$@"
}

Loading…
Cancel
Save