scripts: show-wifi-password & trackball.sh
This commit is contained in:
parent
a84025dce4
commit
21d00a7cf2
20
.local/scripts/show-wifi-password
Executable file
20
.local/scripts/show-wifi-password
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
curr_network=$(nmcli device wifi | rg "^\*" | awk '{print $3}')
|
||||
if [ -z "$curr_network" ]; then
|
||||
echo "Looks like we're not connected to any network"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path_to_net_conns="/etc/NetworkManager/system-connections"
|
||||
fullpath="${path_to_net_conns}/${curr_network}.nmconnection"
|
||||
|
||||
if [ ! -f "$fullpath" ]; then
|
||||
echo "Could not find this wifi's Network Manager entry"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
password=$(sudo cat $fullpath | rg "^psk" | cut -d "=" -f 2)
|
||||
|
||||
echo Name: \ \ \ $curr_network
|
||||
echo Password: $password
|
13
.local/scripts/trackball.sh
Executable file
13
.local/scripts/trackball.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Set mouse buttons for elecom
|
||||
# 3 = 9 (forward)
|
||||
# 8 = 3 (right click)
|
||||
# 9 = 2 (middle click)
|
||||
# 10 = 8 (back)
|
||||
dev_id=$(xinput | rg "slave\s+pointer" | rg ELECOM | rg -o "id=(\d+)" -r '$1')
|
||||
if [ -n "$dev_id" ]; then
|
||||
xinput set-button-map $dev_id 1 2 9 4 5 6 7 2 3 8
|
||||
echo "Button mapping applied" >> /tmp/trackball.log
|
||||
else
|
||||
echo "No device found" >> /tmp/trackball.log
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user