-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
176 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/sh | ||
|
||
bluetooth_print() { | ||
bluetoothctl | while read -r; do | ||
if [ "$(systemctl is-active "bluetooth.service")" = "active" -a "$(bluetoothctl show | grep "Powered:" | cut -d ':' -f 2 | cut -d ' ' -f 2)" = "yes" ]; then | ||
# printf '#1' | ||
|
||
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) | ||
counter=0 | ||
devices="" | ||
|
||
echo "$devices_paired" | while read -r line; do | ||
device_info=$(bluetoothctl info "$line") | ||
|
||
if echo "$device_info" | grep -q "Connected: yes"; then | ||
device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-) | ||
|
||
if [ $counter -gt 0 ]; then | ||
devices="${devices}, $device_alias" | ||
#printf ", %s" "$device_alias" | ||
else | ||
devices="$device_alias" | ||
#printf " %s" "$device_alias" | ||
fi | ||
|
||
counter=$((counter + 1)) | ||
fi | ||
|
||
if [ $counter -eq 0 ]; then | ||
echo "%{F#ffffff}" | ||
else | ||
echo "%{F#258df5} %{F#ffffff}$devices" | ||
fi | ||
|
||
# printf '\n' | ||
# printf "\%\{F#ffffff\} \%\{F#f0f0f0\}%s" "$devices" | ||
done | ||
else | ||
echo "%{F#787878}" | ||
fi | ||
done | ||
} | ||
|
||
bluetooth_toggle() { | ||
if bluetoothctl show | grep -q "Powered: no"; then | ||
bluetoothctl power on >> /dev/null | ||
sleep 1 | ||
|
||
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) | ||
echo "$devices_paired" | while read -r line; do | ||
bluetoothctl connect "$line" >> /dev/null | ||
done | ||
else | ||
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) | ||
echo "$devices_paired" | while read -r line; do | ||
bluetoothctl disconnect "$line" >> /dev/null | ||
done | ||
|
||
bluetoothctl power off >> /dev/null | ||
fi | ||
} | ||
|
||
case "$1" in | ||
--toggle) | ||
bluetooth_toggle | ||
;; | ||
*) | ||
bluetooth_print | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- defaults: | ||
link: | ||
relink: true | ||
create: true | ||
force: true | ||
|
||
|
||
- shell: | ||
- | ||
command : mkdir -p ~/nativefier/bins | ||
description: create folder for nativefier bins | ||
stdin: true | ||
stdout: true | ||
stderr: true | ||
- | ||
command : yarn global add nativefier@latest | ||
description: Install nativefier | ||
stdin: true | ||
stdout: true | ||
stderr: true | ||
- | ||
command : cd ~/nativefier && nativefier --name Notion -p linux -a x64 https://www.notion.so/ && ln -s ~/nativefier/notion-linux-x64/notion ~/nativefier/bins/notion | ||
description: Install notion as nativefier app | ||
stdin: true | ||
stdout: true | ||
stderr: true |