switched to automatic laptop/desktop config
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
from libqtile import widget, bar
|
||||
|
||||
from defines import base_color
|
||||
from defines import blue_color
|
||||
from defines import base_color, blue_color
|
||||
from defines import ChassisType, chassis_type
|
||||
from Widgets import Left_widgets, volume_widget, System_widgets, end_widgets, Laptop_widgets
|
||||
|
||||
widget_defaults = dict(
|
||||
background=base_color,
|
||||
font='Ubuntu Mono',
|
||||
fontsize=18,
|
||||
padding=3,
|
||||
padding=1 if chassis_type == ChassisType.LAPTOP else 3,
|
||||
)
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
main_bar_fontsize=22
|
||||
main_bar_height=28
|
||||
main_bar_height=24 if chassis_type == ChassisType.LAPTOP else 28
|
||||
secondary_bar_height=24
|
||||
secondary_bar_fontsize=18
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from libqtile.config import Key, Drag, Click
|
||||
from libqtile.command import lazy
|
||||
|
||||
from defines import mod, term
|
||||
from defines import mod, term, ChassisType, chassis_type
|
||||
|
||||
keys = [
|
||||
#screen lock & hibernation
|
||||
@@ -56,11 +56,11 @@ keys = [
|
||||
Key([mod],'Return',lazy.spawn("rofi -show drun -show-icons -modi drun"),desc="launch rofi (drun)"),
|
||||
|
||||
# audio hotkeys
|
||||
Key([], 'XF86AudioRaiseVolume', lazy.spawn('pulseaudio-ctl up 1'), desc="increase speaker volume"),
|
||||
Key([], 'XF86AudioLowerVolume', lazy.spawn('pulseaudio-ctl down 1'), desc="decrease speaker volume"),
|
||||
Key([], 'XF86AudioRaiseVolume', lazy.spawn(f'pulseaudio-ctl up {5 if chassis_type == ChassisType.LAPTOP else 1}'), desc="increase speaker volume"),
|
||||
Key([], 'XF86AudioLowerVolume', lazy.spawn(f'pulseaudio-ctl down {5 if chassis_type == ChassisType.LAPTOP else 1}'), desc="decrease speaker volume"),
|
||||
Key([], 'XF86AudioMute', lazy.spawn('pulseaudio-ctl mute'), desc="toggle speaker mute"),
|
||||
Key(['control'], 'XF86AudioRaiseVolume', lazy.spawn('amixer set Capture 1%+'), desc="increase mic volume"),
|
||||
Key(['control'], 'XF86AudioLowerVolume', lazy.spawn('amixer set Capture 1%-'), desc="decrease mic volume"),
|
||||
Key(['control'], 'XF86AudioRaiseVolume', lazy.spawn(f'amixer set Capture {5 if chassis_type == ChassisType.LAPTOP else 1}%+'), desc="increase mic volume"),
|
||||
Key(['control'], 'XF86AudioLowerVolume', lazy.spawn(f'amixer set Capture {5 if chassis_type == ChassisType.LAPTOP else 1}%-'), desc="decrease mic volume"),
|
||||
Key(['control'], 'XF86AudioMute', lazy.spawn('amixer set Capture toggle'), desc="toggle mic mute"),
|
||||
Key([], 'XF86AudioMicMute', lazy.spawn('amixer set Capture toggle'), desc="toggle mic mute"),
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ sleep 1&
|
||||
nitrogen --restore &
|
||||
/usr/lib/geoclue-2.0/demos/agent&
|
||||
bash .screenlayout/layout.sh &
|
||||
# pulseaudio-ctl set 50 &
|
||||
pulseaudio-ctl set 50 &
|
||||
dunst &
|
||||
nextcloud &
|
||||
timeshift &
|
||||
@@ -16,3 +16,17 @@ blueman-applet &
|
||||
thunderbird &
|
||||
fcitx5 -d&
|
||||
emacs --daemon &
|
||||
# Use hostnamectl to get system information
|
||||
chassis_type=$(hostnamectl status | grep "Chassis:" | awk '{print $2}')
|
||||
|
||||
# Check if the chassis type is "laptop"
|
||||
if [ "$chassis_type" == "laptop" ]; then
|
||||
xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Tapping Enabled" 1
|
||||
xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Natural Scrolling Enabled" 1
|
||||
cbatticon &
|
||||
# set font size for alacritty
|
||||
sed -i 's/size: [0-9][0-9]/size: 11/' ~/.config/alacritty/alacritty.yml
|
||||
else
|
||||
# set font size for alacritty
|
||||
sed -i 's/size: [0-9][0-9]/size: 14/' ~/.config/alacritty/alacritty.yml
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
from enum import Enum
|
||||
import subprocess
|
||||
|
||||
term = 'alacritty'
|
||||
focus_color = '#076678'
|
||||
border_width = 2
|
||||
@@ -7,6 +10,23 @@ hotkey_file='/home/paul/Hotkeys'
|
||||
main_screen_res = [3440,1440]
|
||||
top_screen_res = [1440,900]
|
||||
|
||||
#region chassis type detection
|
||||
class ChassisType(Enum):
|
||||
DESKTOP = 0
|
||||
LAPTOP = 1
|
||||
|
||||
def detect_chassis_type() -> ChassisType:
|
||||
try:
|
||||
output = subprocess.check_output(["hostnamectl", "status"], universal_newlines=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("Error running hostnamectl:", e)
|
||||
exit(1)
|
||||
return ChassisType.LAPTOP if "Chassis: laptop" in output else ChassisType.DESKTOP
|
||||
|
||||
chassis_type = detect_chassis_type()
|
||||
#endregion
|
||||
|
||||
|
||||
#region colors
|
||||
light_foreground_color = ['#fbf1c7','#fbf1c7']
|
||||
dark_foreground_color = ['#282828','#282828']
|
||||
|
||||
Reference in New Issue
Block a user