aboutsummaryrefslogtreecommitdiff
path: root/.i3-blocks/blocks/bluetooth
blob: c9673a593d05724b7a073f30a18b31707665e1c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# Left click
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
  sudo bluetooth on
# Middle click
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
  sudo bluetooth toggle
# Right click
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
  sudo bluetooth off
fi

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

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