This commit is contained in:
Stephan Raabe
2023-11-10 21:12:15 +00:00
parent eca6b8659a
commit ea2a6adbf0
137 changed files with 2941 additions and 4897 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# _ _ _ _
# | |__ __ _ _ __ _____ _(_) |_ ___| |__ ___ _ __
# | '_ \ / _` | '__/ __\ \ /\ / / | __/ __| '_ \ / _ \ '__|
# | |_) | (_| | | \__ \\ V V /| | || (__| | | | __/ |
# |_.__/ \__,_|_| |___/ \_/\_/ |_|\__\___|_| |_|\___|_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
# Load status bar information
# -----------------------------------------------------
bar=$(cat ~/.cache/.qtile_bar_x11.sh)
# -----------------------------------------------------
# Switch status bar information
# -----------------------------------------------------
if [ $bar == "qtile" ]; then
echo "Change to Polybar"
echo "polybar" > ~/.cache/.qtile_bar_x11.sh
notify-send "Status Bar is changing..." "to Polybar"
else
echo "Change to Qtile Bar"
echo "qtile" > ~/.cache/.qtile_bar_x11.sh
notify-send "Status Bar is changing..." "to Qtile Status Bar"
fi
# -----------------------------------------------------
# Load status bar
# -----------------------------------------------------
~/dotfiles/qtile/scripts/x11/loadbar.sh

43
qtile/scripts/x11/loadbar.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
# _ _ _
# | | ___ __ _ __| | |__ __ _ _ __
# | |/ _ \ / _` |/ _` | '_ \ / _` | '__|
# | | (_) | (_| | (_| | |_) | (_| | |
# |_|\___/ \__,_|\__,_|_.__/ \__,_|_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
# Check if information about the bar exists in .cache
# If not create it
# -----------------------------------------------------
if [ ! -f ~/.cache/.qtile_bar_x11.sh ]; then
touch ~/.cache/.qtile_bar_x11.sh
echo "qtile" > ~/.cache/.qtile_bar_x11.sh
echo ".qtile_bar_x11.sh created"
fi
# -----------------------------------------------------
# Load status bar information
# -----------------------------------------------------
bar=$(cat ~/.cache/.qtile_bar_x11.sh)
# -----------------------------------------------------
# Load status bar based on loaded information
# -----------------------------------------------------
if [ $bar == "qtile" ]; then
killall polybar
sleep 0.2
qtile cmd-obj -o cmd -f reload_config
else
killall polybar
sleep 0.2
qtile cmd-obj -o cmd -f reload_config
sleep 0.2
source "$HOME/.cache/wal/colors.sh"
~/dotfiles/polybar/launch.sh &
sleep 0.2
qtile cmd-obj -o cmd -f reload_config
fi

36
qtile/scripts/x11/screenshot.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# ____ _ _
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
DIR="$HOME/Pictures/screenshots/"
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
option1="Selected window (delay 3 sec)"
option2="Selected area"
option3="Fullscreen (delay 3 sec)"
options="$option2\n$option3\n$option1"
choice=$(echo -e "$options" | rofi -i -dmenu -config ~/dotfiles/rofi/config-screenshot.rasi -width 30 -l 3 -p "Take Screenshot")
case $choice in
$option1)
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f' -c -z -u
notify-send "Screenshot created" "Mode: Selected window"
;;
$option2)
scrot $DIR$NAME -s -e 'xclip -selection clipboard -t image/png -i $f'
notify-send "Screenshot created" "Mode: Selected area"
;;
$option3)
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f'
notify-send "Screenshot created" "Mode: Fullscreen"
;;
esac

63
qtile/scripts/x11/wallpaper.sh Executable file
View File

@@ -0,0 +1,63 @@
#!/bin/bash
# ____ _ _____ _
# / ___| |__ __ _ _ __ __ _ ___ |_ _| |__ ___ _ __ ___ ___
# | | | '_ \ / _` | '_ \ / _` |/ _ \ | | | '_ \ / _ \ '_ ` _ \ / _ \
# | |___| | | | (_| | | | | (_| | __/ | | | | | | __/ | | | | | __/
# \____|_| |_|\__,_|_| |_|\__, |\___| |_| |_| |_|\___|_| |_| |_|\___|
# |___/
#
# 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 -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
# -----------------------------------------------------
# Reload qtile to color bar
# -----------------------------------------------------
qtile cmd-obj -o cmd -f reload_config
# -----------------------------------------------------
# Get new theme
# -----------------------------------------------------
source "$HOME/.cache/wal/colors.sh"
echo "Wallpaper: $wallpaper"
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
# -----------------------------------------------------
# Copy selected wallpaper into .cache folder
# -----------------------------------------------------
cp $wallpaper ~/.cache/current_wallpaper.jpg
sleep 1
# -----------------------------------------------------
# Send notification
# -----------------------------------------------------
notify-send "Colors and Wallpaper updated" "with image $newwall"
echo "Done."