Update install.sh

This commit is contained in:
2024-05-14 20:20:20 +02:00
parent 1a7df10dd5
commit ba8393cbeb

View File

@@ -3,6 +3,15 @@
# Qtile - Debian install - Martin - ITmail.dk
# nano qtile-install.sh && chmod +x qtile-install.sh && ./qtile-install.sh
# bash -c "$(wget -O- http://192.168.18.34:3005/mara/made-install/raw/branch/main/install.sh)"
# sudo apt install -y git && git clone http://192.168.18.34:3005/mara/made-install.git && cd made-install && . install.sh
# Resource links to source
# https://qtile.org
#
# Rofi - Run menu´s
# https://github.com/ericmurphyxyz/rofi-wifi-menu
#
#
# Whiptail colors
export NEWT_COLORS='
@@ -70,12 +79,12 @@ questions=("Do you want to install XRDP Remote desktop" \
"Install Google Chrome" \
"Install Kitty terminal or use XTerm" \
"Install Thunar file manager" \
"Install Rofi Run-menu")
)
commands=("sudo apt install -y xrdp && sudo systemctl restart xrdp.service" \
"cd /tmp/ && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install -y /tmp/google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb" \
"sudo apt install -y kitty" \
"sudo apt install -y thunar" \
"sudo apt install -y rofi")
)
# Array to store user choices
choices=()
@@ -103,8 +112,6 @@ echo -e "${RED} "
echo -e "${RED}-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-"
echo -e "${RED} ${NC}"
sudo apt update
if ! dpkg -s apt-transport-https >/dev/null 2>&1; then
sudo apt install -y apt-transport-https
sudo sed -i 's+http:+https:+g' /etc/apt/sources.list
@@ -112,12 +119,14 @@ else
echo "apt-transport-https is already installed."
fi
sudo apt update
# -------------------------------------------------------------------------------------------------
echo -e "${YELLOW} Core System APT install ${NC}"
sudo apt install -y xserver-xorg x11-utils xinit arandr autorandr picom mesa-utils htop feh wget curl git alsa-utils alsa-tools pulseaudio numlockx cups xsensors xbacklight brightnessctl unzip
sudo apt install -y xserver-xorg x11-utils xinit arandr autorandr picom mesa-utils htop feh wget curl git alsa-utils alsa-tools pulseaudio numlockx cups xsensors xbacklight brightnessctl unzip network-manager dunst libnotify-bin notify-osd xautolock xsecurelock pm-utils rofi
sudo apt install -y sddm --no-install-recommends
sudo apt install -y nitrogen dunst notify-osd xarchiver mpv flameshot speedcrunch mc gvfs-backends mpd mpc ncmpcpp
sudo apt install -y nitrogen xarchiver mpv flameshot speedcrunch mc gvfs-backends mpd mpc ncmpcpp
# -------------------------------------------------------------------------------------------------
echo -e "${YELLOW} Audio on system - https://alsa.opensrc.org - https://wiki.debian.org/ALSA ${NC}"
@@ -206,6 +215,9 @@ numlockx on &
mpd &
#nitrogen --restore &
# lock computer automatically after X time of minutes.
xautolock -time 120 -locker "xsecurelock" -detectsleep -secure &
QTILEAUTOSTART
chmod +x ~/.config/qtile/autostart.sh
@@ -463,7 +475,7 @@ echo -e "${YELLOW} xrandr-set-max + Xsession START ${NC}"
if [ ! -f /usr/local/bin/xrandr-set-max ]; then
# Define the content of the script
xrandr-set-max_content=$(cat <<'XRANDRSETMAX'
xrandrsetmaxcontent=$(cat << "XRANDRSETMAX"
#!/bin/bash
# Get the names of all connected displays
@@ -481,7 +493,7 @@ XRANDRSETMAX
)
# Write the script content to the target file using sudo
echo "$xrandr-set-max_content" | sudo tee /usr/local/bin/xrandr-set-max >/dev/null
echo "$xrandrsetmaxcontent" | sudo tee /usr/local/bin/xrandr-set-max >/dev/null
# SDDM Before Login - /usr/share/sddm/scripts/Xsetup and After Login - /usr/share/sddm/scripts/Xsession
sudo sed -i '$a\. /usr/local/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsetup
@@ -2178,6 +2190,28 @@ from libqtile.lazy import lazy
from libqtile.utils import guess_terminal # terminal = guess_terminal()
#from libqtile.dgroups import simple_key_binder
# Custom code start ----------------------------------------------------
def guess_browser():
"""Guess the default web browser."""
# Define a list of common web browsers
browsers = ["google-chrome", "firefox", "chromium", "vivaldi", "opera", "brave-browser", "safari"]
# Loop through the list of browsers and check if they exist in PATH
for browser in browsers:
try:
subprocess.run(["which", browser], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return browser
except subprocess.CalledProcessError:
continue
# If no browser is found, return None
return None
# Custom code end ------------------------------------------------------
# Colors use example active=colors["3"],
# Colors format "number": "#hex color code", # comment
colors = {
@@ -2205,30 +2239,46 @@ colors = {
"bg_dark": "#1a1826", # black
}
#
mod = "mod4"
terminal = guess_terminal()
browser = "google-chrome"
browser = guess_browser()
fileexplorer = "thunar"
runmenu = 'rofi -modi "drun,run,window,filebrowser" -show drun' # Switch between -modi... Default key CTRL+TAB
keys = [
# A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
#
# Examples:
# a key binding that can run an external Script or Command
# Key([mod], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc='Computer Lockdown'),
#
# a normal key binding that pulls from a variable
# Key([mod], "Return", lazy.spawn(terminal), desc="Launch Terminal"),
# Custom keyboard shortcut + and there are more below ScratchPad Keybindings
# Keybindings
Key([mod], "Return", lazy.spawn(terminal), desc="Launch Terminal"),
Key([mod], "b", lazy.spawn(browser), desc="Launch Web Browser"),
Key([mod], "e", lazy.spawn(fileexplorer), desc="Launch File Explorer"),
Key([mod], "r", lazy.spawn(runmenu), desc='Launch Run Menu'),
Key([mod, "shift"], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([mod], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc='Computer Lockdown'),
# Audio
# ScratchPad Keybindings
Key([mod, "shift"], "Return", lazy.group['scratchpad'].dropdown_toggle('term')),
Key([mod, "shift"], "e", lazy.group['scratchpad'].dropdown_toggle('mc')),
Key([mod, "shift"], "v", lazy.group['scratchpad'].dropdown_toggle('volume')),
Key([mod, "shift"], "t", lazy.group['scratchpad'].dropdown_toggle('term2')),
# Audio
Key([mod, "mod1"], "Up", lazy.spawn("amixer set Master 1%+"), desc='Volume Up'),
Key([mod, "mod1"], "Down", lazy.spawn("amixer set Master 3%-"), desc='Volume down'),
Key([mod, "mod1"], "m", lazy.spawn("amixer set Master toggle"), desc='Volume Mute'),
# Default
# Default
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
@@ -2348,14 +2398,6 @@ groups.append(ScratchPad("scratchpad", [
]))
# ScratchPad Keybindings
keys.extend([
Key([mod, "shift"], "Return", lazy.group['scratchpad'].dropdown_toggle('term')),
Key([mod, "shift"], "e", lazy.group['scratchpad'].dropdown_toggle('mc')),
Key([mod, "shift"], "v", lazy.group['scratchpad'].dropdown_toggle('volume')),
Key([mod, "shift"], "t", lazy.group['scratchpad'].dropdown_toggle('term2')),
])
# Define layouts and layout themes
def init_layout_theme():
return {"margin":5,
@@ -2407,7 +2449,7 @@ screens = [
# widget.StatusNotifier(),
widget.Wallpaper(directory="~/Wallpapers/", label="", random_selection="True"),
#widget.NetGraph(type='line', line_width=1),
#widget.Net(prefix='M')
#widget.Net(prefix='M'),
widget.ThermalSensor(format='CPU: {temp:.0f}{unit}'),
widget.Volume(fmt="\ue638 {}"),
widget.Spacer(length=5),
@@ -2465,8 +2507,8 @@ auto_minimize = True
# Remember to add, "import os" and "import subprocess"
@hook.subscribe.startup_once
def autostart():
script = os.path.expanduser("~/.config/qtile/autostart.sh")
subprocess.run([script])
autostartscript = os.path.expanduser("~/.config/qtile/autostart.sh")
subprocess.run([autostartscript])
# When using the Wayland backend, this can be used to configure input devices.
wl_input_rules = None