Initial commit

This commit is contained in:
natemaia
2017-10-16 12:38:02 -07:00
commit f6fd221a54
131 changed files with 10444 additions and 0 deletions

59
home/.config/polybar/config Executable file
View File

@ -0,0 +1,59 @@
;=====================================================
; Includes
;=====================================================
[section/base]
include-file = /home/liveuser/.config/polybar/master.conf
include-file = /home/liveuser/.config/polybar/modules.conf
;=====================================================
; i3 Bars
;=====================================================
[bar/i3-bar]
inherit = bar/master
; Use $ xrandr -q | grep " connected" | cut -d ' ' -f1
monitor =
modules-left = i3-workspaces menu
modules-center = clock
modules-right = pkg memory temperature coreuse network volume
; All available modules (some require configuration in modules.conf)
; redshift github filesystem mpd wired-network wireless-network battery menu volume-bar
; pkg keyboard memory temperature coreuse network clock volume i3-workspaces workspaces window_switch
;;;;;; Tray is commented out ;;;;;;;;
;tray-position = center
;tray-padding = 10
;tray-background = ${colors.background}
;tray-offset-x = 20%
;=====================================================
; Openbox Bars
;=====================================================
[bar/openbox-bar]
inherit = bar/master
; Use $ xrandr -q | grep " connected" | cut -d ' ' -f1
monitor =
modules-left = window_switch workspaces menu
modules-center = clock
modules-right = pkg memory temperature coreuse network volume
; All available modules (some require configuration in modules.conf)
; redshift github filesystem mpd wired-network wireless-network battery menu volume-bar
; pkg keyboard memory temperature coreuse network clock volume i3-workspaces workspaces window_switch
;;;;;; Tray is commented out ;;;;;;;;
;tray-position = center
;tray-padding = 10
;tray-background = ${colors.background}
;tray-offset-x = 20%

View File

@ -0,0 +1,57 @@
;=====================================================
; Settings & Colors
;=====================================================
[settings]
compositing-background = source
compositing-foreground = source
compositing-overline = source
compositing-underline = source
compositing-border = source
screenchange-reload = true
throttle-output = 5
throttle-output-for = 10
throttle-input-for = 30
; Fallback colors for modules
format-foreground = ${colors.foreground}
format-background = ${colors.background}
[colors]
background = #ed2b303b
foreground = #8FA1B3
urgent = #E7816B
blue = #6BA4E7
pink = #9181E7
orange = #FEBE8E
purple = #D7AFF9
yellow = #F9F1AF
;=====================================================
; Master Bar
;=====================================================
[bar/master]
width = 100%
height = 28
radius = 0.0
line-size = 2
bottom = false
fixed-center = true
border-bottom-size = 2
padding-left = 0
padding-right = 0
module-margin-left = 1
module-margin-right = 1
separator = │
foreground = ${colors.foreground}
background = ${colors.background}
border-color = ${colors.foreground}
font-0 = "DejaVu Sans Mono:size=10:antialias=false;2"
font-1 = "MaterialIcons:size=9:antialias=false;2"
font-2 = "icomoon:size=10:antialias=false;2"
font-3 = "Ubuntu Nerd Font:size=9:antialias=false;2"

View File

@ -0,0 +1,447 @@
;=====================================================
; Modules
;=====================================================
;;;;;;;;;;;;;;;;;;;;;;;;
;; Openbox Workspaces ;;
;;;;;;;;;;;;;;;;;;;;;;;;
[module/workspaces]
type = internal/xworkspaces
pin-workspaces = true
enable-click = true
enable-scroll = true
format-padding = 0
icon-0 = 1;
icon-1 = 2;
icon-2 = 3;
icon-3 = 4;
icon-4 = 5;
icon-5 = 6;
icon-6 = 7;
icon-7 = 8;
icon-8 = 9;
icon-9 = 10;
icon-default =
format = <label-state>
label-active = " %icon% %name% "
label-active-foreground = ${colors.blue}
label-active-underline = ${colors.blue}
label-occupied = " %icon% %name% "
label-occupied-underline = ${colors.blue}
label-urgent = " %icon% %name% "
label-urgent-foreground = ${colors.urgent}
label-urgent-underline = ${colors.urgent}
label-empty = " %icon% %name% "
label-empty-foreground = ${colors.foreground}
;;;;;;;;;;;;;;;;;;;
;; i3 Workspaces ;;
;;;;;;;;;;;;;;;;;;;
[module/i3-workspaces]
type = internal/i3
pin-workspaces = true
strip-wsnumbers = true
index-sort = true
enable-click = true
enable-scroll = false
wrapping-scroll = false
reverse-scroll = false
fuzzy-match = true
ws-icon-0 = 1;
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-5 = 6;
ws-icon-6 = 7;
ws-icon-7 = 8;
ws-icon-8 = 9;
ws-icon-9 = 10;
ws-icon-default = 
format = <label-state><label-mode>
label-mode = %mode%
label-mode-padding = 2
label-mode-underline = ${colors.urgent}
label-focused = "%name% %icon%"
label-focused-underline = ${colors.blue}
label-focused-padding = 1
label-unfocused = "%name% %icon%"
label-unfocused-padding = 1
label-visible = "%name% %icon%"
label-visible-underline = ${colors.blue}
label-visible-padding = 1
label-urgent = "%name% %icon%"
label-urgent-underline = ${colors.urgent}
label-urgent-padding = 1
;;;;;;;;;;;;;
;; Network ;;
;;;;;;;;;;;;;
[module/network]
type = custom/script
exec = $HOME/.config/polybar/scripts/network.sh
click-left = networkmanager_dmenu &
click-right = networkmanager_dmenu &
interval = 1
tail = true
;;;;;;;;;;;;;;;;;;;
;; Window Switch ;;
;;;;;;;;;;;;;;;;;;;
[module/window_switch]
type = custom/script
interval = 5
label = "%{A1:skippy-xd:} %{A3:skippy-xd:} %output% %{A} %{A}"
exec = echo "  "
format = <label>
;;;;;;;;;
;; CPU ;;
;;;;;;;;;
[module/coreuse]
type = internal/cpu
interval = 1
format = <label><ramp-coreload>
label = %{A1:termite --exec=htop & disown:} %percentage%% %{A}
ramp-coreload-0 = %{T1}%{F#8FA1B3}▂%{F-}%{T-}
ramp-coreload-1 = %{T1}%{F#8FA1B3}▃%{F-}%{T-}
ramp-coreload-2 = %{T1}%{F#6BA4E7}▄%{F-}%{T-}
ramp-coreload-3 = %{T1}%{F#6BA4E7}▅%{F-}%{T-}
ramp-coreload-4 = %{T1}%{F#FFFE5D}▆%{F-}%{T-}
ramp-coreload-5 = %{T1}%{F#FFFE5D}▇%{F-}%{T-}
ramp-coreload-6 = %{T1}%{F#FF5B6C}█%{F-}%{T-}
;;;;;;;;;
;; MEM ;;
;;;;;;;;;
[module/memory]
type = internal/memory
interval = 3
format = <label>
label = %{A1:termite --exec=htop & disown:} %percentage_used%%%{A}
;;;;;;;;;
;; PKG ;;
;;;;;;;;;
[module/pkg]
type = custom/script
exec = $HOME/.config/polybar/scripts/pkg.sh
exec-if = "ping -q -w 2 -c 1 176.34.135.167 > /dev/null"
label = %{A1:termite --exec=pacli & disown:} %{A3:termite --exec=pacli & disown:}%output%%{A} %{A}
interval = 10
tail = true
;;;;;;;;;;;
;; Clock ;;
;;;;;;;;;;;
[module/clock]
type = internal/date
format = <label>
interval = 5
time = %R
label = %{A1:gsimplecal & disown:} %{A3:gsimplecal & disown:}  %time% %{A} %{A}
;;;;;;;;;;;;;;;;;
;; TEMPERATURE ;;
;;;;;;;;;;;;;;;;;
[module/temperature]
type = internal/temperature
interval = 3
thermal-zone = 0
warn-temperature = 70
format = <ramp><label>
label = %{A1:termite --exec='watch sensors' & disown:} %temperature% %{A}
ramp-0 = ""
ramp-0-foreground = ${colors.blue}
ramp-1 = ""
ramp-1-foreground = ${colors.pink}
ramp-2 = ""
ramp-2-foreground = ${colors.purple}
ramp-3 = ""
ramp-3-foreground = ${colors.urgent}
format-warn = <label-warn>
label-warn = " %temperature%"
label-warn-foreground = ${colors.urgent}
;;;;;;;;;;;;
;; Volume ;;
;;;;;;;;;;;;
[module/volume]
type = internal/volume
master-mixer = Master
label-volume-foreground = ${colors.foreground}
label-volume = %{A3:pavucontrol & disown:}%percentage%% %{A}
format-volume = <ramp-volume> <label-volume>
label-muted = " muted "
label-muted-foreground = #888
ramp-volume-0 = ""
ramp-volume-0-foreground = ${colors.foreground}
ramp-volume-1 = ""
ramp-volume-1-foreground = ${colors.blue}
ramp-volume-2 = ""
ramp-volume-2-foreground = ${colors.orange}
ramp-volume-3 = ""
ramp-volume-3-foreground = ${colors.urgent}
;;;;;;;;;;;;;
;; BATTERY ;;
;;;;;;;;;;;;;
[module/battery]
type = internal/battery
; Use $ ls -1 /sys/class/power_supply/
battery = BAT1
adapter = AC
full-at = 98
poll-interval = 5
time-format = %H:%M
format-charging = <animation-charging><label-charging>
format-discharging = <ramp-capacity><label-discharging>
format-full = <ramp-capacity><label-full>
format-padding = 0
ramp-capacity-0 = " "
ramp-capacity-0-foreground = ${colors.urgent}
ramp-capacity-1 = " "
ramp-capacity-1-foreground = #ffa900
ramp-capacity-2 = " "
ramp-capacity-3 = " "
ramp-capacity-4 = " "
ramp-capacity-foreground = ${colors.blue}
bar-capacity-width = 10
animation-charging-0 = "  "
animation-charging-1 = "  "
animation-charging-2 = "  "
animation-charging-3 = "  "
animation-charging-4 = "  "
animation-charging-framerate = 750
;;;;;;;;;;
;; MENU ;;
;;;;;;;;;;
[module/menu]
type = custom/menu
format-spacing = 1
label-open = "  "
label-close = "  "
label-close-foreground = ${colors.urgent}
label-separator = " | "
# Top level
menu-0-0 = "  "
menu-0-0-exec = menu-open-1
menu-0-1 = "  "
menu-0-1-exec = menu-open-2
menu-0-2 = "  |"
menu-0-2-exec = menu-open-3
# 1
menu-1-0 = "  "
menu-1-0-exec = menu-open-0
menu-1-0-foreground = ${colors.urgent}
menu-1-1 = "  "
menu-1-1-exec = exo-open --launch WebBrowser
menu-1-2 = "  "
menu-1-2-exec = exo-open --launch TerminalEmulator
menu-1-3 = "  |"
menu-1-3-exec = exo-open --launch FileManager
# 2
menu-2-0 = "  "
menu-2-0-exec = menu-open-0
menu-2-0-foreground = ${colors.urgent}
menu-2-1 = "  "
menu-2-1-exec = termite --exec=pacli &
menu-2-2 = "  "
menu-2-2-exec = xfce4-settings-manager &
menu-2-3 = "  |"
menu-2-3-exec = pavucontrol &
# 3
menu-3-0 = "  "
menu-3-0-exec = menu-open-0
menu-3-0-foreground = ${colors.urgent}
menu-3-1 = "  "
menu-3-1-exec = i3lock-fancy -p -f Ubuntu &
menu-3-2 = "  "
menu-3-2-exec = systemctl reboot
menu-3-3 = "  |"
menu-3-3-exec = systemctl poweroff
;;;;;;;;;;;;;;;;;;;
;; Extra Modules
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;
;; KEYBOARD ;;
;;;;;;;;;;;;;;;
[module/keyboard]
type = internal/xkeyboard
; List of indicators to ignore
blacklist-0 = num lock
blacklist-1 = scroll lock
format = <label-layout>
label-layout = %{A1:mintlocale & disown:} %{A3:mintlocale & disown:} %layout%%{A} %{A}
;;;;;;;;;;;;;;
;; ETHERNET ;;
;;;;;;;;;;;;;;
[module/wired-network]
type = internal/network
interface =
format-connected = <label-connected>
format-connected-foreground = ${colors.purple}
format-disconnected = <label-disconnected>
label-connected =  %local_ip%
;;;;;;;;;;;;;;
;; REDSHIFT ;;
;;;;;;;;;;;;;;
[module/redshift]
type = custom/script
interval = 5
exec = $HOME/.config/polybar/scripts/redshift
label = %output%
tail = true
click-left = $HOME/.config/polybar/scripts/redshift toggle
click-right = $HOME/.config/polybar/scripts/redshift toggle
;;;;;;;;;;;;
;; GITHUB ;;
;;;;;;;;;;;;
[module/github]
type = internal/github
token = ${~/.config/polybar/github_access.token}
empty-notifications = false
;;;;;;;;;;;;;;;;
;; FILESYSTEM ;;
;;;;;;;;;;;;;;;;
[module/filesystem]
type = internal/fs
format-mounted = <label-mounted>
label-mounted = %mountpoint% : %percentage_free%%
label-mounted-foreground = ${colors.yellow}
mount-0 = /
interval = 1200
fixed-values = false
spacing = 2
;;;;;;;;;
;; MPD ;;
;;;;;;;;;
[module/mpd]
type = internal/mpd
format-online = <bar-progress> <icon-prev> <icon-stop> <toggle> <icon-next> <label-song>
format-offline = <label-offline>
label-offline = mpd is off
format-online-prefix = " "
icon-play = 
icon-pause = 
icon-stop = 
icon-prev = 
icon-next = 
icon-random = 
icon-repeat = 
toggle-on-foreground =
toggle-off-foreground = #55
bar-progress-width = 35
bar-progress-format = %{+o +u}%fill%%{-o -u}%indicator%%{+o +u}%empty%%{-u -o}
; bar-progress-indicator = |
bar-progress-indicator = █
bar-progress-indicator-foreground = #A85659
bar-progress-indicator-font = 2
; bar-progress-fill = ─
bar-progress-fill = █
bar-progress-fill-foreground = #bb
bar-progress-fill-font = 2
; bar-progress-empty = ─
bar-progress-empty = ▒
bar-progress-empty-font = 2
bar-progress-empty-foreground = #44
;;;;;;;;;;
;; WIFI ;;
;;;;;;;;;;
[module/wireless-network]
type = internal/network
interface =
format-connected = <ramp-signal> <label-connected>
format-packetloss = <animation-packetloss>
label-connected = " %local_ip% "
ramp-signal-0 = 
ramp-signal-0-foreground = #F03051
ramp-signal-1 = 
ramp-signal-1-foreground = #F07127
ramp-signal-2 = 
ramp-signal-2-foreground = #F9CE56
ramp-signal-3 = 
ramp-signal-3-foreground = ${colors.purple}
ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.purple}
ramp-signal-5 = 
ramp-signal-5-foreground = ${colors.purple}
animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = #000000
animation-packetloss-framerate = 500
;;;;;;;;;;;;;;;;
;; VOLUME BAR ;;
;;;;;;;;;;;;;;;;
[module/volume-bar]
type = internal/volume
format-volume = <label-volume><bar-volume>
label-volume = "  "
label-volume-foreground = #B6C2E7
format-muted-foreground = #E76BB4
label-muted = "  mute"
bar-volume-font = 2
bar-volume-width = 20
bar-volume-foreground-0 = #92A3F7
bar-volume-foreground-1 = #92A3F7
bar-volume-foreground-2 = #6BB3E7
bar-volume-foreground-3 = #6BB3E7
bar-volume-foreground-4 = #6BB3E7
bar-volume-foreground-5 = #6BE7D8
bar-volume-foreground-6 = #6BE7D8
bar-volume-gradient = true
bar-volume-indicator = |
bar-volume-fill = •
bar-volume-empty = ·
bar-volume-empty-foreground = #666666

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
START="al-compositor --start"
STOP="al-compositor --stop"
if (pgrep -x "compton" > /dev/null); then
$STOP
else
$START
fi

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
#The icon that would change color
icon=" "
if pgrep -x "compton" > /dev/null
then
echo "%{F#EFF0F1}$icon"
else
echo "%{F#484852}$icon"
fi

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 0.5; done
echo "Bars stopped..."

View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# config location
CONF_PATH=$HOME/.config/polybar
# Check WM
cur_wm=$(wmctrl -m | grep Name | cut -d " " -f2)
if [[ $1 == --reload ]]; then
if ! [[ $cur_wm == i3 ]]; then
openbox --restart
al-compositor --restart
al-tint2restart
else
echo -e "WARN: Option [--reload] not meant for i3..\n\nUse [Super]+[Shift]+r to reload i3\n"
fi
fi
# Terminate already running bar instances
killall -q polybar
if pgrep -x "tint2" >/dev/null; then
echo "Tint is running, not launching bars"
exit 1
fi
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 0.5; done
echo "WM is $cur_wm... Launching appropriate bars"
if [[ $cur_wm == i3 ]]; then # if i3 launch the i3-bar
polybar -r --config=$CONF_PATH/config i3-bar &
else # otherwise we assume openbox
polybar -r --config=$CONF_PATH/config openbox-bar &
fi
echo "Bars launched..."

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
online=$(ip addr | grep "state UP" | cut -d ":" -f2)
#connected=""
#offline=""
connected="  "
offline="  "
if [[ "$online" ]]; then
echo %{F#8FA1B3}${connected}
else
echo %{F#E7816B}${offline}; sleep 0.6; echo %{F#8FA1B3}${offline}
fi

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
pac=$(checkupdates | wc -l)
if [[ "$pac" > "1" ]]; then
echo %{F#6BA4E7}$pac %{F#6BA4E7}
else
echo  
fi

View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
#Usage : redshift.sh [toggle]
START='redshift'
STOP="killall redshift"
if [[ "$@" = *toggle* ]]; then
if pgrep redshift > /dev/null
then
$STOP
else
$START &
fi
fi
# Specifying the icon(s) in the script
# This allows us to change its appearance conditionally
icon=""
pgrep -x redshift &> /dev/null
if [[ $? -eq 0 ]]; then
temp=$(redshift -p 2>/dev/null | grep temp | cut -d' ' -f3)
temp=${temp//K/}
fi
# OPTIONAL: Append ' ${temp}K' after $icon
if [[ -z $temp ]]; then
echo "%{F#8FA1B3} $icon " # Greyed out (not running)
elif [[ $temp -ge 5000 ]]; then
echo "%{F#6BA4E7} $icon " # Blue
elif [[ $temp -ge 4000 ]]; then
echo "%{F#F9F1AF} $icon " # Yellow
else
echo "%{F#E7816B} $icon " # Orange
fi

View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
TRASH_DIRECTORY="${BLOCK_INSTANCE}"
if [[ "${TRASH_DIRECTORY}" = "" ]]; then
TRASH_DIRECTORY="${XDG_DATA_HOME:-${HOME}/.local/share}/Trash"
fi
# Left click
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
xdg-open "${TRASH_DIRECTORY}/files"
# Right click
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
# Delete all files permanently (unlink them)
rm -r "${TRASH_DIRECTORY}/files"
rm -r "${TRASH_DIRECTORY}/info"
# Create new directory
mkdir "${TRASH_DIRECTORY}/files"
mkdir "${TRASH_DIRECTORY}/info"
fi
TRASH_COUNT=$(ls -U -1 "${TRASH_DIRECTORY}/files" | wc -l)
URGENT_VALUE=30
echo "${TRASH_COUNT}"
echo "${TRASH_COUNT}"
echo ""
if [[ "${TRASH_COUNT}" -ge "${URGENT_VALUE}" ]]; then
exit 31
fi