This commit is contained in:
Stephan Raabe 2023-09-13 08:18:13 +02:00
commit 22b64d8929
14 changed files with 230 additions and 54 deletions

29
.bashrc
View File

@ -21,27 +21,24 @@ alias c='clear'
alias nf='neofetch'
alias pf='pfetch'
alias ls='exa -al'
alias mutt='neomutt'
alias m='neomutt'
alias shutdown='systemctl poweroff'
alias v='nvim'
alias r='ranger'
alias t='sudo timeshift --list'
alias ts='~/dotfiles/scripts/snapshot.sh'
alias matrix='cmatrix'
alias shot='scrot -d 3 -c -z -u'
alias shotsel='scrot -s'
alias wifi='nmtui'
alias od='~/private/onedrive.sh'
alias rw='~/dotfiles/waybar/reload.sh'
alias winclass="xprop | grep 'CLASS'"
# -----------------------------------------------------
# Window Managers
# -----------------------------------------------------
alias Qtile='startx'
# alias Hyprland="~/dotfiles/hypr/starthypr.sh"
# -----------------------------------------------------
# GIT
# -----------------------------------------------------
alias gs="git status"
alias ga="git add"
@ -50,8 +47,11 @@ alias gp="git push"
alias gpl="git pull"
alias gst="git stash"
alias gsp="git stash; git pull"
alias gcheck="git checkout"
# -----------------------------------------------------
# SCRIPTS
# -----------------------------------------------------
alias w='~/dotfiles/scripts/updatewal.sh'
alias gr='python ~/dotfiles/scripts/growthrate.py'
@ -59,24 +59,32 @@ alias ChatGPT='python ~/mychatgpt/mychatgpt.py'
alias chat='python ~/mychatgpt/mychatgpt.py'
alias ascii='~/dotfiles/scripts/figlet.sh'
# -----------------------------------------------------
# VIRTUAL MACHINE
# -----------------------------------------------------
alias vm='~/private/launchvm.sh'
alias lg='~/dotfiles/scripts/looking-glass.sh'
alias vmstart='virsh --connect qemu:///system start win11'
alias vmstop='virsh --connect qemu:///system destroy win11'
# -----------------------------------------------------
# EDIT CONFIG FILES
# -----------------------------------------------------
alias confq='nvim ~/dotfiles/qtile/config.py'
alias confp='nvim ~/dotfiles/picom/picom.conf'
alias confb='nvim ~/dotfiles/.bashrc'
# -----------------------------------------------------
# EDIT NOTES
# -----------------------------------------------------
alias notes='vim ~/notes.txt'
# -----------------------------------------------------
# SYSTEM
# -----------------------------------------------------
alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
alias setkb='setxkbmap de;echo "Keyboard set back to de."'
@ -84,11 +92,14 @@ alias setkb='setxkbmap de;echo "Keyboard set back to de."'
# -----------------------------------------------------
# SCREEN RESOLUTINS
# -----------------------------------------------------
# Qtile
alias res1='xrandr --output DisplayPort-0 --mode 2560x1440 --rate 120'
alias res2='xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120'
alias r1='hyprctl keyword monitor ,preferred,auto,1'
alias r2='hyprctl keyword monitor ,1920x1080,auto,1'
#Hyprland
alias r1='hyprctl keyword monitor ,2560x1440@120,auto,1'
alias r2='hyprctl keyword monitor ,1920x1080@120,auto,1'
export PATH="/usr/lib/ccache/bin/:$PATH"

View File

@ -74,16 +74,13 @@ echo ""
echo "-> Install main packages"
packagesPacman=(
"picom"
"pacman-contrib"
"alacritty"
"rofi"
"rofi-calc"
"chromium"
"scrot"
"nitrogen"
"dunst"
"starship"
"slock"
"neovim"
"mpv"
"freerdp"
@ -152,7 +149,7 @@ while true; do
read -p "Do you want to install the custom login promt? (Yy/Nn): " yn
case $yn in
[Yy]* )
sudo cp ~/dotfiles/issue /etc/issue
sudo cp ~/dotfiles/login/issue /etc/issue
echo "Login promt installed."
break;;
[Nn]* )

View File

@ -48,6 +48,9 @@ echo "-> Install main packages"
packagesPacman=(
"qtile"
"polybar"
"picom"
"scrot"
"slock"
);
# ------------------------------------------------------

View File

86
scripts/installupdates.sh Executable file
View File

@ -0,0 +1,86 @@
#!/bin/bash
# ___ _ _ _ _ _ _ _
# |_ _|_ __ ___| |_ __ _| | | | | | |_ __ __| | __ _| |_ ___ ___
# | || '_ \/ __| __/ _` | | | | | | | '_ \ / _` |/ _` | __/ _ \/ __|
# | || | | \__ \ || (_| | | | | |_| | |_) | (_| | (_| | || __/\__ \
# |___|_| |_|___/\__\__,_|_|_| \___/| .__/ \__,_|\__,_|\__\___||___/
# |_|
# by Stephan Raabe (2023)
# -----------------------------------------------------
# Required: yay trizen timeshift btrfs-grub
# -----------------------------------------------------
sleep 1
source ~/dotfiles/scripts/library.sh
clear
echo "-----------------------------------------------------"
echo "Check for updates"
echo "-----------------------------------------------------"
echo ""
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then
echo "-> Pacman:"
checkupdates
echo ""
echo "-> AUR"
trizen -Su --aur
echo ""
echo "-> $updates updates available."
echo ""
else
echo "-> NO updates available"
exit
fi
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
while true; do
read -p "DO YOU WANT TO START THE UPDATE NOW? (Yy/Nn): " yn
case $yn in
[Yy]* )
echo "Update process started."
break;;
[Nn]* )
exit;
break;;
* ) echo "Please answer yes or no.";;
esac
done
if [[ $(_isInstalledYay "Timeshift") == 1 ]];
then
echo ""
echo "-----------------------------------------------------"
echo "Create a snapshot"
echo "-----------------------------------------------------"
echo ""
read -p "Enter a comment for the snapshot: " c
sudo timeshift --create --comments "$c"
sudo timeshift --list
sudo grub-mkconfig -o /boot/grub/grub.cfg
echo "DONE. Snapshot $c created!"
echo ""
fi
echo "-----------------------------------------------------"
echo "Start update"
echo "-----------------------------------------------------"
echo ""
yay

View File

@ -8,6 +8,19 @@
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# Requires pacman-contrib trizen
# -----------------------------------------------------
# Define threshholds for color indicators
# -----------------------------------------------------
threshhold_green=0
threshhold_yellow=25
threshhold_red=100
# -----------------------------------------------------
# Calculate available updates pacman and aur (with trizen)
# -----------------------------------------------------
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
@ -19,8 +32,24 @@ fi
updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then
echo " $updates"
else
echo " 0"
# -----------------------------------------------------
# Output in JSON format for Waybar Module custom-updates
# -----------------------------------------------------
css_class="green"
# test classes
# printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "red"}'
# exit
if [ "$updates" -gt $threshhold_yellow ]; then
css_class="yellow"
fi
if [ "$updates" -gt $threshhold_red ]; then
css_class="red"
fi
if [ "$updates" -gt $threshhold_green ]; then
printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class"
else
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}'
fi

View File

@ -20,9 +20,8 @@ wal -q -i ~/wallpaper/
source "$HOME/.cache/wal/colors.sh"
# -----------------------------------------------------
# Copy color file to waybar folder
# Copy selected wallpaper into .cache folder
# -----------------------------------------------------
cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/
cp $wallpaper ~/.cache/current_wallpaper.jpg
# -----------------------------------------------------

View File

@ -28,9 +28,8 @@ if [ "$selected" ]; then
source "$HOME/.cache/wal/colors.sh"
# -----------------------------------------------------
# Copy color file to waybar folder
# Copy selected wallpaper into .cache folder
# -----------------------------------------------------
cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/
cp $wallpaper ~/.cache/current_wallpaper.jpg
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")

View File

@ -18,7 +18,7 @@ killall waybar
# -----------------------------------------------------
if [[ $USER = "raabe" ]]
then
waybar -c ~/dotfiles/waybar/myconfig &
waybar -c ~/dotfiles/waybar/myconfig & -s ~/dotfiles/waybar/style.css
else
waybar &
fi

View File

@ -67,10 +67,13 @@
// Updates Count
"custom/updates": {
"format": " {}",
"format": " {}",
"tooltip-format": "{}",
"escape": true,
"return-type": "json",
"exec": "~/dotfiles/scripts/updates.sh",
"restart-interval": 600,
"on-click": "alacritty -e yay",
"restart-interval": 60,
"on-click": "alacritty -e ~/dotfiles/scripts/installupdates.sh",
"tooltip": false
},

View File

@ -13,7 +13,7 @@
/* -----------------------------------------------------
* Import Pywal colors
* ----------------------------------------------------- */
@import 'colors-waybar.css';
@import '../../.cache/wal/colors-waybar.css';
/* -----------------------------------------------------
* General
@ -117,7 +117,7 @@ window#waybar.empty #window {
* ----------------------------------------------------- */
#taskbar {
background: transparent;
background: @color11;
margin: 3px 15px 3px 0px;
padding: 2px 3px 1px 3px;
border-radius: 14px;
@ -191,6 +191,20 @@ window#waybar.empty #window {
opacity:0.8;
}
#custom-updates.green {
background-color: #FFFFFF;
}
#custom-updates.yellow {
background-color: #ff9a3c;
color: #ffffff;
}
#custom-updates.red {
background-color: #dc2f2f;
color: #ffffff;
}
/* -----------------------------------------------------
* Custom Youtube
* ----------------------------------------------------- */

View File

@ -1,35 +1,36 @@
{
"label" : "lock",
"action" : "swaylock",
"text" : "Lock"
"text" : "Lock",
"keybind" : "l"
}
{
"label" : "hibernate",
"action" : "systemctl hibernate",
"text" : "Hibernate"
"text" : "Hibernate",
"keybind" : "h"
}
{
"label" : "logout",
"action" : "hyprctl dispatch exit 0",
"text" : "Logout"
"action" : "loginctl terminate-user $USER",
"text" : "Logout",
"keybind" : "e"
}
{
"label" : "shutdown",
"action" : "systemctl poweroff",
"text" : "Shutdown"
"text" : "Shutdown",
"keybind" : "s"
}
{
"label" : "suspend",
"action" : "systemctl suspend",
"text" : "Suspend"
"text" : "Suspend",
"keybind" : "u"
}
{
"label" : "reboot",
"action" : "systemctl reboot",
"text" : "Reboot"
}
"text" : "Reboot",
"keybind" : "r"
}

BIN
wlogout/noise.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -1,44 +1,78 @@
/*
_ _
__ _| | ___ __ _ ___ _ _| |_
\ \ /\ / / |/ _ \ / _` |/ _ \| | | | __|
\ V V /| | (_) | (_| | (_) | |_| | |_
\_/\_/ |_|\___/ \__, |\___/ \__,_|\__|
|___/
by Stephan Raabe (2023)
-----------------------------------------------------
*/
* {
background-image: none;
transition: 0ms;
}
window {
background-color: rgba(12, 12, 12, 0.5);
background-color: rgba(12, 12, 12, 0.1);
background-image: url('./noise.png');
}
button {
color: #FFFFFF;
background-color: #1E1E1E;
color: #FFFFFF;
border-style: solid;
border-width: 0px;
border-width: 2px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
background-color: rgba(108, 112, 134, 0.4);
border: 1px solid rgba(108, 112, 134, 0.3);
border-top: 1px solid rgba(108, 112, 134, 0.3);
}
button:focus, button:active, button:hover {
background-color: #3700B3;
outline-style: none;
button:focus,
button:active,
button:hover {
background-color: rgba(156, 161, 192, 0.5);
border: 1px solid rgba(108, 112, 134, 0.15);
border-top: 1px solid rgba(108, 112, 134, 0.15);
}
#lock {
background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png"));
}
#logout {
background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png"));
}
#suspend {
background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png"));
}
#hibernate {
background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png"));
}
#shutdown {
background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png"));
}
#reboot {
background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png"));
margin: 10px;
border-radius: 20px;
background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png"));
}