This commit is contained in:
Stephan Raabe
2023-12-20 11:05:15 +01:00
parent 59a037c694
commit 51e9d67781
18 changed files with 82 additions and 297 deletions
@@ -15,7 +15,8 @@
# For Virtual Machine
# xrandr --output Virtual-1 --mode 1920x1080
# Set keyboard layout in config.py
# Keyboard layout
setxkbmap en
# Load picom
picom &
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
# ___ _____ ___ _ _____ ____ _ _
# / _ \_ _|_ _| | | ____| / ___|| |_ __ _ _ __| |_
# | | | || | | || | | _| \___ \| __/ _` | '__| __|
# | |_| || | | || |___| |___ ___) | || (_| | | | |_
# \__\_\|_| |___|_____|_____| |____/ \__\__,_|_| \__|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# My screen resolution
# xrandr --rate 120
# For Virtual Machine
# xrandr --output Virtual-1 --mode 1920x1080
# Set keyboard mapping in config.py
# Load power manager
xfce4-power-manager &
# Load notification service
dunst &
# Load cliphist history
wl-paste --watch cliphist store &
# Launch GTK
~/dotfiles/gtk/gtk.sh
swww init
# Setup Wallpaper and update colors
~/dotfiles/qtile/scripts/wayland/wallpaper.sh init &
+49 -125
View File
@@ -60,14 +60,12 @@ logger.warning("Using config.py with " + core_name)
# --------------------------------------------------------
# Define Status Bar
# --------------------------------------------------------
if core_name == "x11":
try:
wm_bar = Path(home + "/.cache/.qtile_bar_x11.sh").read_text().replace("\n", "")
except:
wm_bar = "qtile"
elif qtile.core.name == "wayland":
try:
wm_bar = Path(home + "/.cache/.qtile_bar_x11.sh").read_text().replace("\n", "")
except:
wm_bar = "qtile"
logger.warning("Status bar: " + wm_bar)
# --------------------------------------------------------
@@ -89,118 +87,60 @@ terminal = "alacritty"
mod = "mod4" # SUPER KEY
if core_name == "x11":
logger.warning("Using keys with x11")
keys = [
keys = [
# Focus
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
# Move
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
# Swap
Key([mod, "shift"], "h", lazy.layout.swap_left()),
Key([mod, "shift"], "l", lazy.layout.swap_right()),
Key([mod], "Print", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/screenshot.sh")),
# Size
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Floating
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
# Split
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
# Toggle Layouts
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
# Fullscreen
Key([mod], "f", lazy.window.toggle_fullscreen()),
#System
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/qtile/scripts/powermenu.sh"), desc="Open Powermenu"),
Key([mod, "shift"], "s", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/barswitcher.sh"), desc="Switch Status Bar"),
# Focus
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
# Apps
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod, "control"], "Return", lazy.spawn("rofi -show drun"), desc="Launch Rofi"),
Key([mod], "b", lazy.spawn("sh " + home + "/dotfiles/.settings/browser.sh"), desc="Launch Browser"),
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/wallpaper.sh"), desc="Update Theme and Wallpaper"),
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/x11/wallpaper.sh select"), desc="Select Theme and Wallpaper"),
# Move
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl -q s +20%")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl -q s 20%-"))
]
elif qtile.core.name == "wayland":
logger.warning("Using keys with wayland")
# Swap
Key([mod, "shift"], "h", lazy.layout.swap_left()),
Key([mod, "shift"], "l", lazy.layout.swap_right()),
keys = [
Key([mod], "Print", lazy.spawn(home + "/dotfiles/qtile/scripts/screenshot.sh")),
# Focus
Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window around"),
# Move
Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
# Size
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Swap
Key([mod, "shift"], "h", lazy.layout.swap_left()),
Key([mod, "shift"], "l", lazy.layout.swap_right()),
# Floating
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
# Split
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
Key([mod], "Print", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/screenshot.sh")),
# Toggle Layouts
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
# Size
Key([mod, "control"], "Down", lazy.layout.shrink(), desc="Grow window to the left"),
Key([mod, "control"], "Up", lazy.layout.grow(), desc="Grow window to the right"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Fullscreen
Key([mod], "f", lazy.window.toggle_fullscreen()),
# Floating
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
# Split
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
#System
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/qtile/scripts/powermenu.sh"), desc="Open Powermenu"),
Key([mod, "shift"], "s", lazy.spawn(home + "/dotfiles/qtile/scripts/barswitcher.sh"), desc="Switch Status Bar"),
# Toggle Layouts
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
# Apps
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod, "control"], "Return", lazy.spawn("rofi -show drun"), desc="Launch Rofi"),
Key([mod], "b", lazy.spawn("sh " + home + "/dotfiles/.settings/browser.sh"), desc="Launch Browser"),
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wallpaper.sh"), desc="Update Theme and Wallpaper"),
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wallpaper.sh select"), desc="Select Theme and Wallpaper"),
# Fullscreen
Key([mod], "f", lazy.window.toggle_fullscreen()),
#System
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.spawn(home + "/dotfiles/qtile/scripts/powermenu.sh"), desc="Open Powermenu"),
# Apps
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod, "control"], "Return", lazy.spawn("rofi -show drun"), desc="Launch Rofi"),
Key([mod], "b", lazy.spawn("sh " + home + "/dotfiles/.settings/browser.sh"), desc="Launch Browser"),
Key([mod, "shift"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/wallpaper.sh"), desc="Update Theme and Wallpaper"),
Key([mod, "control"], "w", lazy.spawn(home + "/dotfiles/qtile/scripts/wayland/wallpaper.sh select"), desc="Select Theme and Wallpaper"),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl -q s +20%")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl -q s 20%-"))
]
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl -q s +20%")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl -q s 20%-"))
]
# --------------------------------------------------------
# Groups
@@ -517,9 +457,6 @@ reconfigure_screens = True
# focus, should we respect this or not?
auto_minimize = True
# When using the Wayland backend, this can be used to configure input devices.
wl_input_rules = None
# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
# string besides java UI toolkits; you can see several discussions on the
# mailing lists, GitHub issues, and other WM documentation that suggest setting
@@ -535,15 +472,6 @@ wl_input_rules = None
wmname = "QTILE"
# --------------------------------------------------------
# Set wayland properties
# --------------------------------------------------------
# Keyboard layout
wl_input_rules = {
"type:keyboard": InputConfig(kb_layout=keyboard_layout),
}
# --------------------------------------------------------
# Hooks
# --------------------------------------------------------
@@ -551,12 +479,8 @@ wl_input_rules = {
# HOOK startup
@hook.subscribe.startup_once
def autostart():
if qtile.core.name == "x11":
autostartscript = "~/.config/qtile/autostart_x11.sh"
subprocess.Popen(['setxkbmap',keyboard_layout])
elif qtile.core.name == "wayland":
autostartscript = "~/.config/qtile/autostart_wayland.sh"
autostartscript = "~/.config/qtile/autostart_x11.sh"
subprocess.Popen(['setxkbmap',keyboard_layout])
home = os.path.expanduser(autostartscript)
subprocess.Popen([home])
View File
@@ -22,7 +22,10 @@ case $1 in
# Select wallpaper with rofi
"select")
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-wallpaper.rasi)
selected=$( find "$HOME/wallpaper" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort | while read rfile
do
echo -en "$rfile\x00icon\x1f$HOME/wallpaper/${rfile}\n"
done | rofi -dmenu -replace -l 6 -config ~/dotfiles/rofi/config-wallpaper.rasi)
if [ ! "$selected" ]; then
echo "No wallpaper selected"
exit
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
# ____ _ _
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
DIR="$HOME/Pictures/screenshots/"
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
option2="Selected area"
option3="Fullscreen (delay 3 sec)"
options="$option2\n$option3"
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-screenshot.rasi -i -no-show-icons -l 2 -width 30 -p "Take Screenshot")
case $choice in
$option2)
grim -g "$(slurp)" - | swappy -f -
notify-send "Screenshot created" "Mode: Selected area"
;;
$option3)
sleep 3
grim - | swappy -f -
notify-send "Screenshot created" "Mode: Fullscreen"
;;
esac
-78
View File
@@ -1,78 +0,0 @@
#!/bin/bash
# _ _
# __ ____ _| | |_ __ __ _ _ __ ___ _ __
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
# |_| |_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
case $1 in
# Load wallpaper from .cache of last session
"init")
if [ -f ~/.cache/current_wallpaper.jpg ]; then
wal -q -i ~/.cache/current_wallpaper.jpg
else
wal -q -i ~/wallpaper/
fi
;;
# Select wallpaper with rofi
"select")
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-wallpaper.rasi)
if [ ! "$selected" ]; then
echo "No wallpaper selected"
exit
fi
wal -q -i ~/wallpaper/$selected
;;
# Randomly select wallpaper
*)
wal -q -i ~/wallpaper/
;;
esac
# -----------------------------------------------------
# Load current pywal color scheme
# -----------------------------------------------------
source "$HOME/.cache/wal/colors.sh"
echo "Wallpaper: $wallpaper"
# -----------------------------------------------------
# Copy selected wallpaper into .cache folder
# -----------------------------------------------------
cp $wallpaper ~/.cache/current_wallpaper.jpg
# -----------------------------------------------------
# get wallpaper iamge name
# -----------------------------------------------------
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
# -----------------------------------------------------
# Set the new wallpaper
# -----------------------------------------------------
swww init
transition_type="wipe"
# transition_type="outer"
# transition_type="random"
swww img $wallpaper \
--transition-bezier .43,1.19,1,.4 \
--transition-fps=60 \
--transition-type=$transition_type \
--transition-duration=0.7 \
qtile cmd-obj -o cmd -f reload_config
# -----------------------------------------------------
# Send notification
# -----------------------------------------------------
notify-send "Colors and Wallpaper updated" "with image $newwall"
echo "DONE!"