From f940a44e16179c252c74d1b37fb24116975d4a0b Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 7 May 2018 13:52:19 +0100 Subject: [PATCH 1/7] Add secondary monitor blocka a comment in home config --- i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/i3/config b/i3/config index ab27806a..d1d051c7 100644 --- a/i3/config +++ b/i3/config @@ -235,6 +235,7 @@ bindsym $mod+r mode "resize" # finds out, if available) bar { #status_command i3status + #status_command i3blocks -c ./i3blocks-secondary.conf status_command i3blocks #tray_output primary colors { From c83c35a445daa31bd32435c32ed2b9444d2dbe7c Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 7 May 2018 19:01:32 +0100 Subject: [PATCH 2/7] Add brightness block --- i3/blocks/brightness | 57 ++++++++++++++++++++++++++++++++++++++++++++ i3/i3blocks.conf | 4 ++++ 2 files changed, 61 insertions(+) create mode 100755 i3/blocks/brightness diff --git a/i3/blocks/brightness b/i3/blocks/brightness new file mode 100755 index 00000000..7761b65f --- /dev/null +++ b/i3/blocks/brightness @@ -0,0 +1,57 @@ +#!/bin/bash + +# One of the following: xrandr, xbacklight, kernel +METHOD="xbacklight" + +# Left click +if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then + xbacklight -inc 10 +# Right click +elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then + xbacklight -dec 10 +fi + +URGENT_VALUE=10 + +if [[ "${METHOD}" = "xrandr" ]]; then + device="${BLOCK_INSTANCE:-primary}" + xrandrOutput=$(xrandr --verbose) + + if [[ "${device}" = "primary" ]]; then + device=$(echo "${xrandrOutput}" | grep 'primary' | head -n 1 | awk -F ' ' '{print $1}') + fi + + curBrightness=$(echo "${xrandrOutput}" | grep "${device}" -A 5 | grep -i "Brightness" | awk -F ':' '{print $2}') +elif [[ "${METHOD}" = "kernel" ]]; then + device="${BLOCK_INSTANCE:-intel_backlight}" + maxBrightness=$(cat /sys/class/backlight/${device}/max_brightness) + curBrightness=$(cat /sys/class/backlight/${device}/brightness) +elif [[ "${METHOD}" = "xbacklight" ]]; then + curBrightness=$(xbacklight -get) +fi + +if [[ "${curBrightness}" -le 0 ]]; then + exit +fi + +if [[ "${METHOD}" = "xrandr" ]]; then + percent=$(echo "scale=0;${curBrightness} * 100" | bc -l) +elif [[ "${METHOD}" = "kernel" ]]; then + percent=$(echo "scale=0;${curBrightness} / ${maxBrightness} * 100" | bc -l) +elif [[ "${METHOD}" = "xbacklight" ]]; then + percent=$(echo "scale=0;${curBrightness}" | bc -l) +fi + +percent=${percent%.*} + +if [[ "${percent}" -le 0 ]]; then + exit +fi + +echo "🔆${percent}%" +echo "${percent}%" +echo "" + +if [[ "${percent}" -le "${URGENT_VALUE}" ]]; then + exit 33 +fi diff --git a/i3/i3blocks.conf b/i3/i3blocks.conf index 28bf21d8..633247b4 100644 --- a/i3/i3blocks.conf +++ b/i3/i3blocks.conf @@ -95,6 +95,10 @@ instance=Master interval=once signal=10 +[brightness] +command=~/.dotfiles/i3/blocks/brightness +interval=once + # Memory usage # # The type defaults to "mem" if the instance is not specified. From 2f1581779638989b7f5d232c0b455e95edc8b249 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 7 May 2018 19:29:30 +0100 Subject: [PATCH 3/7] Add autosuggestions --- .gitmodules | 3 +++ shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions | 1 + 2 files changed, 4 insertions(+) create mode 160000 shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions diff --git a/.gitmodules b/.gitmodules index e8ee1da8..9e65e059 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "shells/zsh/zsh-syntax-highlighting"] path = shells/zsh/zsh-syntax-highlighting url = https://github.com/zsh-users/zsh-syntax-highlighting.git +[submodule "shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions"] + path = shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions + url = https://github.com/zsh-users/zsh-autosuggestions diff --git a/shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions b/shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions new file mode 160000 index 00000000..67a364bc --- /dev/null +++ b/shells/zsh/oh-my-zsh/plugins/zsh-autosuggestions @@ -0,0 +1 @@ +Subproject commit 67a364bc1766fb775010cd00dda1967210013410 From 616351f99eed639682fad24651cf300681f8f638 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 7 May 2018 22:41:11 +0100 Subject: [PATCH 4/7] add autocomplete to shell --- shells/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shells/zsh/zshrc b/shells/zsh/zshrc index b18054ef..80dff553 100644 --- a/shells/zsh/zshrc +++ b/shells/zsh/zshrc @@ -52,7 +52,7 @@ ZSH_CUSTOM=$HOME/.dotfiles/shells/zsh/oh-my-zsh # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git) +plugins=(git zsh-autosuggestions) source $ZSH/oh-my-zsh.sh From ce379571a8f10d5120d7555b94cc90916794f74a Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 7 May 2018 22:43:32 +0100 Subject: [PATCH 5/7] Add set background script --- bin/setbackground | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/setbackground diff --git a/bin/setbackground b/bin/setbackground new file mode 100755 index 00000000..a63ab978 --- /dev/null +++ b/bin/setbackground @@ -0,0 +1,6 @@ +#!/usr/bin/bash + +rngback -fg "#404552" -bg "#5294e2" 3840 2160 30 15 -o ~/background.jpg + +feh --bg-fill ~/background.jpg + From d96eccc4b2501f3f1f90dd38c150937337bd895b Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 8 May 2018 08:38:27 +0100 Subject: [PATCH 6/7] Make i3 set background on startup --- i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/i3/config b/i3/config index d1d051c7..baeb4263 100644 --- a/i3/config +++ b/i3/config @@ -362,6 +362,7 @@ mode "$mode_gaps_outer" { #exec --no-startup-id redshift-gtk #exec_always feh --bg-fill /home/jonathan/Pictures/Wallpapers/blueConky/dfCXBel.jpg +exec_always setbackground exec --no-startup-id compton -f -i 0.95 exec_always --no-startup-id albert #exec --no-startup-id nm-applet From 49ec6181c14415c9d0613cb9c3b1f9100702333b Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 8 May 2018 08:43:33 +0100 Subject: [PATCH 7/7] Start tidying i3 config --- i3/config | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/i3/config b/i3/config index baeb4263..fa5c8867 100644 --- a/i3/config +++ b/i3/config @@ -360,22 +360,8 @@ mode "$mode_gaps_outer" { -#exec --no-startup-id redshift-gtk -#exec_always feh --bg-fill /home/jonathan/Pictures/Wallpapers/blueConky/dfCXBel.jpg -exec_always setbackground +exec_always --no-startup-id setbackground exec --no-startup-id compton -f -i 0.95 exec_always --no-startup-id albert -#exec --no-startup-id nm-applet -#exec --no-startup-id blueman-applet exec --no-startup-id xfce4-clipman -#exec --no-startup-id xfce4-power-manager -#exec_always --no-startup-id /usr/lib/kdeconnectd -#exec_always --no-startup-id indicator-kdeconnect -#exec_always --no-startup-id killall conky -#exec_always --no-startup-id sleep 1s; killall -9 conky -#exec --no-startup-id sh /home/jonathan/.conky/conky-startup.sh -#exec_always --no-startup-id sleep 2s; conky -c "/home/jonathan/.conky/BibleVerse/bibleGateway" -#exec_always --no-startup-id sleep 2s; conky -c "/home/jonathan/.conky/MyBlue/MyBlue" -#exec_always --no-startup-id cd /home/jonathan/.conky/Octupi_Arch -#exec_always --no-startup-id sleep 2s; conky -c "co_main" exec setxkbmap gb