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/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 + 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/config b/i3/config index ab27806a..fa5c8867 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 { @@ -359,21 +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 --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 diff --git a/i3/i3blocks.conf b/i3/i3blocks.conf index b51a7482..86ae58c7 100644 --- a/i3/i3blocks.conf +++ b/i3/i3blocks.conf @@ -97,6 +97,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. 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 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