Skip to main content

i3blocks misc

cat microphone

------------------------------------------------------------------------------------------------------------------------------

 #!/bin/bash

# Left click
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
  amixer -q sset Capture 5%+
# Middle click
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
  amixer -q sset Capture toggle
# Right click
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
  amixer -q sset Capture 5%-
fi

statusLine=$(amixer get Capture | tail -n 1)
status=$(echo "${statusLine}" | grep -wo "on")
volume=$(echo "${statusLine}" | awk -F ' ' '{print $5}' | tr -d '[]%')

if [[ "${status}" == "on" ]]; then
  echo "${volume}%"
  echo "${volume}%"
  echo ""
else
  echo "off"
  echo "off"
  echo ""

----------------------------------------------------------------------------------------------------------------------------- 

[microphone]
label=
interval=once
signal=2

-----------------------------------------------------------------------------------------------------------------------------

webcam


device=${BLOCK_INSTANCE:-/dev/video0}
if [[ -c "${device}" ]]; then
  if [[ "$(fuser /dev/video0)" != "" ]]; then
    echo "rec"
    echo "rec"
    echo ""
  else
    echo "off"
    echo "off"
    echo ""
  fi
fi


[webcam]
label=
instance=/dev/video0
interval=5

-----------------------------------------------------------------------------------------------------------------------------

cat keystate
#!/bin/bash

TYPE="${BLOCK_INSTANCE:-caps}"

lockLine=$(xset -q | grep "Num Lock")

capsLock=$(echo "${lockLine}" | awk -F ' ' '{print $4}')
numLock=$(echo "${lockLine}" | awk -F ' ' '{print $8}')
scrollLock=$(echo "${lockLine}" | awk -F ' ' '{print $12}')

if [[ "${TYPE}" == "caps" ]]; then
  checkLock="${capsLock}"
elif [[ "${TYPE}" == "num" ]]; then
  checkLock="${numLock}"
elif [[ "${TYPE}" == "scroll" ]]; then
  checkLock="${scrollLock}"
else
  exit
fi

if [[ "${checkLock}" == "on" ]]; then
  echo "on"
  echo "on"
  echo ""


[keystate]
label=
instance=caps
interval=once
signal=5

[keystate]
label=
instance=num
interval=once
signal=5

----------------------------------------------------------------------------------------------------------------------------- 

ssid

#!/bin/bash

SSID_NAME=$(iwgetid -r)

# You can put any urgent name so the block will give warning
# if a network with this name is used, like public wifi or alike.
# You can separate multiple values with \|
URGENT_VALUE=""

if [[ "${SSID_NAME}" != "" ]]; then
  echo "${SSID_NAME}"
  echo "${SSID_NAME}"
  echo ""

  if [[ "${URGENT_VALUE}" != "" ]] && [[ $(echo "${SSID_NAME}" | grep -we "${URGENT_VALUE}") != "" ]]; then
    exit 33
  fi

[ssid]
label=
interval=60


----------------------------------------------------------------------------------------------------------------------------- 

network

#!/bin/bash

device="${BLOCK_INSTANCE:-wlan0}"
status=$(cat /sys/class/net/${device}/operstate)

URGENT_VALUE=20

if [[ "${status}" == "up" ]]; then
  if [[ -d "/sys/class/net/${device}/wireless" ]]; then
    quality=$(grep ${device} /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
    echo "${quality}%"
    echo "${quality}%"
    echo ""

    if [[ "${quality}" -le "${URGENT_VALUE}" ]]; then
      exit 33
    fi
  else
    echo "on"
    echo "on"
    echo ""
  fi

[network]
label=
instance=wlan0
interval=10

----------------------------------------------------------------------------------------------------------------------------- 

vpn

#!/bin/bash

VPNC_FILE='/var/run/vpnc.pid'

if [[ -e "${VPNC_FILE}" ]]; then
  echo "on"
  echo "on"
  echo ""

[vpn]
label=
interval=once

-----------------------------------------------------------------------------------------------------------------------------

bluetooth

#!/bin/bash

STATUS=$(bluetooth | grep -wo 'on')

if [[ "${STATUS}" = "on" ]]; then
  echo "on"
  echo "on"
  echo ""
fi


[bluetooth]
label=
interval=once


-----------------------------------------------------------------------------------------------------------------------------


 backlight

#!/bin/sh
case $BLOCK_BUTTON in
    4) brightnessctl s 1%+ >> /dev/null;;
    5) brightnessctl s 1%- >> /dev/null;;
    esac
BNESS="$(brightnessctl get)"
MAX="$(brightnessctl max)"
PERC="$((BNESS*100/MAX))"
BLIGHT=${PERC%.*}
ICON=""   

echo $ICON $BLIGHT


[backlight]
interval=once
signal=3


----------------------------------------------------------------------------------------------------------------------------- 

user

#!/bin/bash

echo "${USER}"
echo "${USER}"
echo ""

if [[ $(id -u) -eq 0 ]]; then
  exit 33
fi
 

[user]
label=
interval=once

-----------------------------------------------------------------------------------------------------------------------------

battery

#!/bin/sh

case $BLOCK_BUTTON in
    3) notify-send "$(acpi)";;
    6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

# Loop through all attached batteries and format the info
for battery in /sys/class/power_supply/BAT?*; do
    # If non-first battery, print a space separator.
    [ -n "${capacity+x}" ] && printf " "
    # Sets up the status and capacity
    capacity="$(cat "$battery/capacity" 2>&1)"
    
    case "$(cat "$battery/status" 2>&1)" in
        "Full") status="" ;;
        "Discharging") status="" ;;
        "Charging") status="" ;;
        "Not charging") status="🛑" ;;
        "Unknown") status="♻️" ;;
        *) exit 1 ;;
    esac
    
    # Will make a warn variable if discharging and low
    
    [ "$status" = "" ] && [ "$capacity" -le 25 ] && warn="❗"    
    
if [ "$capacity" -gt "95" ] && [ "$status" = "" ] ; then
    status=""
elif [ "$capacity" -gt "75" ] && [ "$status" = "" ]; then
    status=""
elif [ "$capacity" -gt "50" ] && [ "$status" = "" ]; then
    status=""
elif [ "$capacity" -gt "25" ] && [ "$status" = "" ] ; then
    status=""
elif [ "$capacity" -gt "10" ] && [ "$status" = "" ]; then
    status=""
fi
    
    # Prints the info
    printf "%s%s%d%%" "$status"  "$warn" "$capacity" ; unset warn
done && printf "\\n"
 

 

[battery]
interval=1
 

 

-----------------------------------------------------------------------------------------------------------------------------

set $refresh_vol pkill -RTMIN+1 i3blocks

set $refresh_mic pkill -RTMIN+2 i3blocks
set $refresh_bri pkill -RTMIN+3 i3blocks

set $refresh_keyind pkill -RTMIN+3 i3blocks

 

 

bindsym XF86AudioRaiseVolume exec --no-startup-id amixer sset Master 5%+  && $refresh_vol
bindsym XF86AudioLowerVolume exec --no-startup-id amixer sset Master 5%-  && $refresh_vol
bindsym XF86AudioMute exec --no-startup-id amixer sset Master toggle && $refresh_vol
 

#dont have hardware mic keys so

bindsym Control+XF86AudioMute exec amixer -q sset Capture toggle && $refresh_mic
bindsym Control+XF86AudioRaiseVolume exec amixer -q sset Capture 5%+ && $refresh_mic
bindsym Control+XF86AudioLowerVolume execamixer -q sset Capture 5%+ && $refresh_mic

bindsym XF86AudioPause exec playerctl play-pause

 


bindsym XF86MonBrightnessUp exec brightnessctl  s 2%+    && $refresh_bri
bindsym XF86MonBrightnessDown exec brightnessctl  s 2%-  && $refresh_bri
bindsym Control+XF86MonBrightnessUp exec brightnessctl  s 10%+  && $refresh_bri
bindsym Control+XF86MonBrightnessDown exec brightnessctl  s 10%-   && $refresh_bri

##fat border for float with rt clk and kill with middle

bindsym --border button2 kill
bindsym --border button3 floating toggle
#bindsym  --border button1 floating enable 

bindsym --release Caps_Lock exec $refresh_keyind
bindsym --release Num_Lock  exec $refresh_keyind



 



 

 


 

 



Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

xbps-install  sxhkd ------------ mkdir .config/sxhkd cd .config/sxhkd nano/vim sxhkdrc -------------------------------- XF86AudioRaiseVolume         amixer -c 1 -- sset Master 2db+ XF86AudioLowerVolume         amixer -c 1 -- sset Master 2db- XF86AudioMute         amixer -c 1 -- sset Master toggle alt + shift + Escape         pkill -USR1 -x sxhkd XF86MonBrightnessUp          xbacklight -inc 20 XF86MonBrightnessDown          xbacklight -dec 20 ------------------------------------------------------------- amixer -c card_no -- sset Interface volume run alsamixer to find card no and interface names xbps-install -S git git clone https://git.suckless.org/dwm xbps-install -S base-devel libX11-devel libXft-devel libXinerama-devel  vim config.mk # FREETYPEINC = ${X11INC}/freetype2 #comment for non-bsd make clean install   cp config.def.h config.h vim config.h xbps-install -S font-symbola #for emoji on statusbar support     void audio config xbps-i

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you

download office 2021 and activate

get office from here  https://tb.rg-adguard.net/public.php open powershell as admin (win+x and a ) type cmd  goto insall dir 1.         cd /d %ProgramFiles(x86)%\Microsoft Office\Office16 2.           cd /d %ProgramFiles%\Microsoft Office\Office16 try 1 or 2 depending on installation  install volume license  for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x" activate using kms cscript ospp.vbs /setprt:1688 cscript ospp.vbs /unpkey:6F7TH >nul cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH cscript ospp.vbs /sethst:s8.uk.to cscript ospp.vbs /act Automatic script (windefender may block it) ------------------------------------------------------------------------------------------------------------------- @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&