mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
Update: Added new modules to polybar, edited i3 config, added rofi-powermenu and touchpad_toggle scripts.
This commit is contained in:
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
# rofi theme
|
||||
theme="$HOME/.config/rofi/main_without_icons.rasi"
|
||||
|
||||
get_options() {
|
||||
echo " Poweroff"
|
||||
echo " Reboot"
|
||||
echo " Reboot to Windows"
|
||||
echo " Hibernate"
|
||||
echo " Lock"
|
||||
echo " Suspend"
|
||||
echo " Log out"
|
||||
}
|
||||
|
||||
main() {
|
||||
|
||||
# get choice from rofi
|
||||
# choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$theme")
|
||||
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "")
|
||||
|
||||
# run the selected command
|
||||
case $choice in
|
||||
' Poweroff')
|
||||
systemctl poweroff
|
||||
;;
|
||||
' Reboot')
|
||||
systemctl reboot
|
||||
;;
|
||||
' Reboot to Windows')
|
||||
pkexec grub-reboot 3 && systemctl reboot
|
||||
;;
|
||||
' Hibernate')
|
||||
systemctl hibernate
|
||||
;;
|
||||
' Lock')
|
||||
lock
|
||||
;;
|
||||
' Suspend')
|
||||
systemctl suspend
|
||||
;;
|
||||
' Log out')
|
||||
i3-msg exit
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# done
|
||||
set -e
|
||||
}
|
||||
|
||||
main &
|
||||
|
||||
exit 0
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
touchad_id=$(xinput list | grep -i 'touchpad' | grep -oP 'id=\K\d+')
|
||||
|
||||
if [ -z "$touchad_id" ]; then
|
||||
dunstify -a "Touchpad" "Touchpad" "Touchpad not found" -r 100
|
||||
exit 1
|
||||
fi
|
||||
|
||||
state=$(xinput list-props "$touchad_id" | grep "Device Enabled" | grep -o "[01]$")
|
||||
|
||||
# Przełącz stan touchpada
|
||||
if [ "$state" -eq 1 ]; then
|
||||
xinput disable "$touchad_id"
|
||||
dunstify -a "Touchpad" "Touchpad" "Touchpad is disabled" -r 100
|
||||
else
|
||||
xinput enable "$touchad_id"
|
||||
dunstify -a "Touchpad" "Touchpad" "Touchpad is enabled" -r 100
|
||||
fi
|
||||
Reference in New Issue
Block a user