Remove USB locking

This commit is contained in:
Sam A. 2023-01-16 13:57:15 +01:00
parent 361ad1c8b7
commit c4cb2829ac
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
6 changed files with 2 additions and 46 deletions

View file

@ -1,13 +0,0 @@
#!/usr/bin/env dash
if usbctl check; then
TEXT="\uf023"
TOOLTIP="PROTECTED"
CLASS="protected"
else
TEXT="\uf3c1"
TOOLTIP="UNPROTECTED"
CLASS="unprotected"
fi
env echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}"

View file

@ -1,8 +0,0 @@
#!/usr/bin/env dash
if usbctl check; then
MODE="$([ "$1" = "--permanent" ] && printf "unprotect" || printf "temporary")"
pkexec --disable-internal-agent usbctl "$MODE"
else
pkexec --disable-internal-agent usbctl protect
fi

View file

@ -23,9 +23,6 @@ bindsym $mod+Shift+c reload
# Lock the screen # Lock the screen
bindsym $mod+l exec swaylock bindsym $mod+l exec swaylock
# Unlock USB protection
bindsym $mod+u exec usb-unlock.sh
# Session and power management # Session and power management
bindsym $mod+Shift+e exec swaynag -t logout -m 'Log out?' -b 'Yes' 'swaymsg exit' bindsym $mod+Shift+e exec swaynag -t logout -m 'Log out?' -b 'Yes' 'swaymsg exit'
bindsym $mod+Shift+r exec swaynag -t reboot -m 'Reboot?' -b 'Yes' 'doas reboot' bindsym $mod+Shift+r exec swaynag -t reboot -m 'Reboot?' -b 'Yes' 'doas reboot'

View file

@ -3,7 +3,7 @@
"layer": "top", "layer": "top",
"position": "top", "position": "top",
"height": 36, "height": 36,
"modules-left": ["idle_inhibitor", "sway/workspaces", "custom/usb", "sway/mode"], "modules-left": ["idle_inhibitor", "sway/workspaces", "sway/mode"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": ["network", "pulseaudio", "backlight", "cpu", "memory", "battery", "tray"], "modules-right": ["network", "pulseaudio", "backlight", "cpu", "memory", "battery", "tray"],
"sway/workspaces": { "sway/workspaces": {
@ -80,13 +80,5 @@
"backlight": { "backlight": {
"format": "{icon} {percent}%", "format": "{icon} {percent}%",
"format-icons": ["", "", "", "", "", "", "", "", ""] "format-icons": ["", "", "", "", "", "", "", "", ""]
},
"custom/usb": {
"format": "{} USB",
"exec": "usb-status.sh",
"return-type": "json",
"interval": 1,
"on-click": "usb-unlock.sh",
"on-click-right": "usb-unlock.sh --permanent"
} }
} }

View file

@ -88,8 +88,7 @@ window#waybar.hidden {
#tray, #tray,
#mode, #mode,
#idle_inhibitor, #idle_inhibitor,
#mpd, #mpd {
#custom-usb {
padding: 0 4px; padding: 0 4px;
margin: 0 4px; margin: 0 4px;
color: @white; color: @white;
@ -198,13 +197,3 @@ label:focus {
color: @violet; color: @violet;
box-shadow: inset 0 3px @violet; box-shadow: inset 0 3px @violet;
} }
#custom-usb {
color: @orange;
box-shadow: inset 0 3px @orange;
}
#custom-usb.unprotected {
color: @red;
box-shadow: inset 0 3px @red;
}

View file

@ -67,7 +67,6 @@ if [[ $(lsb_release -si) == "Artix" ]]; then
alias pacss="pacman -Ss" alias pacss="pacman -Ss"
alias poweroff="doas poweroff" alias poweroff="doas poweroff"
alias reboot="doas reboot" alias reboot="doas reboot"
alias usb="doas usbctl tmp"
elif [[ $(lsb_release -si) == "Fedora" ]]; then elif [[ $(lsb_release -si) == "Fedora" ]]; then
alias code="codium" alias code="codium"
alias dnfin="sudo dnf install" alias dnfin="sudo dnf install"