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
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# ____
# | _ \ _____ _____ _ __ _ __ ___ ___ _ __ _ _
# | |_) / _ \ \ /\ / / _ \ '__| '_ ` _ \ / _ \ '_ \| | | |
# | __/ (_) \ V V / __/ | | | | | | | __/ | | | |_| |
# |_| \___/ \_/\_/ \___|_| |_| |_| |_|\___|_| |_|\__,_|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
echo $XDG_SESSION_TYPE
if [ $XDG_SESSION_TYPE == "wayland" ]; then
lockapp=swaylock
else
lockapp=slock
fi
echo "Using $lockapp to lock the screen."
option1=" lock"
option2=" logout"
option3=" reboot"
option4=" power off"
options="$option1\n"
options="$options$option2\n"
options="$options$option3\n$option4"
choice=$(echo -e "$options" | rofi -dmenu -config ~/dotfiles/rofi/config-power.rasi -i -no-show-icons -l 4 -width 30 -p "Powermenu")
case $choice in
$option1)
$lockapp ;;
$option2)
qtile cmd-obj -o cmd -f shutdown ;;
$option3)
systemctl reboot ;;
$option4)
systemctl poweroff ;;
esac
+32
View File
@@ -0,0 +1,32 @@
#!/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 -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
@@ -0,0 +1,78 @@
#!/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 -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!"
+32
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
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
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
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."