mirror of
https://github.com/shokinn/.files.git
synced 2025-06-28 07:40:40 +00:00
consolidate and templeate my to files
in order to stop maintainung different files for each operationg system
This commit is contained in:
parent
7a1e8fda4b
commit
c377eb276a
40 changed files with 246 additions and 454 deletions
|
@ -1,6 +1,6 @@
|
|||
;=======================================
|
||||
;
|
||||
; {{@@ env['dotdrop_warning'] @@}}
|
||||
; {{@@ header() @@}}
|
||||
;
|
||||
; Polybar configuration for
|
||||
; Dell XPS 15 9560
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# {{@@ env['dotdrop_warning'] @@}}
|
||||
# {{@@ header() @@}}
|
||||
#
|
||||
|
||||
load=$(uptime | grep -ohe 'load average[s:][: ].*' | sed 's/,//g' | awk '{print $3" "$4" "$5}')
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# {{@@ env['dotdrop_warning'] @@}}
|
||||
# {{@@ header() @@}}
|
||||
#
|
||||
|
||||
# Terminate already running bar instances
|
||||
|
@ -13,4 +14,4 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
|||
# Launch bar1 and bar2
|
||||
polybar -r -q 9560-top &
|
||||
polybar -r -q 9560-bottom &
|
||||
$HOME/.config/polybar/refresh_bar_usb_nic.sh &
|
||||
{{@@ env['HOME'] @@}}/.config/polybar/refresh_bar_usb_nic.sh &
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;
|
||||
; {{@@ env['dotdrop_warning'] @@}}
|
||||
; {{@@ header() @@}}
|
||||
;
|
||||
|
||||
;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################
|
||||
#
|
||||
# {{@@ env['dotdrop_warning'] @@}}
|
||||
# {{@@ header() @@}}
|
||||
#
|
||||
# This script detects if an USB NIC was connected and reloads the bar
|
||||
#
|
||||
|
@ -11,30 +10,30 @@ while true; do
|
|||
# Get PID of the bottom bar
|
||||
pid_bottom_bar=$(ps -x | awk '!/awk/ && /9560-bottom/ {print $1}')
|
||||
# 1st USB port (right)
|
||||
if [[ -z $USB_NIC1 ]]; then
|
||||
if [[ -z ${USB_NIC1} ]]; then
|
||||
USB_NIC1=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1)
|
||||
if [[ -n $USB_NIC1 ]]; then
|
||||
polybar-msg -p $pid_bottom_bar cmd restart
|
||||
if [[ -n ${USB_NIC1} ]]; then
|
||||
polybar-msg -p ${pid_bottom_bar} cmd restart
|
||||
fi
|
||||
elif [[ -n $USB_NIC1 ]]; then
|
||||
elif [[ -n ${USB_NIC1} ]]; then
|
||||
USB_NIC1_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u1/ {print $2}' | cut -d":" -f1)
|
||||
if [[ -z $USB_NIC1_CHECK ]]; then
|
||||
if [[ -z ${USB_NIC1_CHECK} ]]; then
|
||||
unset USB_NIC1
|
||||
polybar-msg -p $pid_bottom_bar cmd restart
|
||||
polybar-msg -p ${pid_bottom_bar} cmd restart
|
||||
fi
|
||||
fi
|
||||
|
||||
# 2nd USB port (left)
|
||||
if [[ -z $USB_NIC2 ]]; then
|
||||
if [[ -z ${USB_NIC2} ]]; then
|
||||
USB_NIC2=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1)
|
||||
if [[ -n $USB_NIC2 ]]; then
|
||||
polybar-msg -p $pid_bottom_bar cmd restart
|
||||
if [[ -n ${USB_NIC2} ]]; then
|
||||
polybar-msg -p ${pid_bottom_bar} cmd restart
|
||||
fi
|
||||
elif [[ -n $USB_NIC2 ]]; then
|
||||
elif [[ -n ${USB_NIC2} ]]; then
|
||||
USB_NIC2_CHECK=$(ip link | awk '!/awk/ && /enp0s20f0u2/ {print $2}' | cut -d":" -f1)
|
||||
if [[ -z $USB_NIC2_CHECK ]]; then
|
||||
if [[ -z ${USB_NIC2_CHECK} ]]; then
|
||||
unset USB_NIC2
|
||||
polybar-msg -p $pid_bottom_bar cmd restart
|
||||
polybar-msg -p ${pid_bottom_bar} cmd restart
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue