feat(polybar): update polybar style

This commit is contained in:
Anhgelus Morhtuuzh 2023-07-25 23:46:05 +02:00
parent 9f00495503
commit c57e8ab185
No known key found for this signature in database
GPG key ID: 7765EC9C8383805F
604 changed files with 86703 additions and 181 deletions

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
rofi -no-config -no-lazy-grab -show drun -modi drun -theme ~/.config/polybar/pwidgets/scripts/rofi/launcher.rasi

View file

@ -0,0 +1,95 @@
#!/usr/bin/env bash
## Author : Aditya Shakya
## Mail : adi1090x@gmail.com
## Github : @adi1090x
## Twitter : @adi1090x
dir="~/.config/polybar/pwidgets/scripts/rofi"
uptime=$(uptime -p | sed -e 's/up //g')
rofi_command="rofi -no-config -theme $dir/powermenu.rasi"
# Options
shutdown=" Shutdown"
reboot=" Restart"
lock=" Lock"
suspend=" Sleep"
logout=" Logout"
# Confirmation
confirm_exit() {
rofi -dmenu\
-no-config\
-i\
-no-fixed-num-lines\
-p "Are You Sure? : "\
-theme $dir/confirm.rasi
}
# Message
msg() {
rofi -no-config -theme "$dir/message.rasi" -e "Options : yes / y / no / n"
}
# Variable passed to rofi
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
case $chosen in
$shutdown)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl poweroff
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$reboot)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
systemctl reboot
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$lock)
if [[ -f /usr/bin/i3lock ]]; then
i3lock
elif [[ -f /usr/bin/betterlockscreen ]]; then
betterlockscreen -l
fi
;;
$suspend)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
$logout)
ans=$(confirm_exit &)
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
if [[ "$DESKTOP_SESSION" == "Openbox" ]]; then
openbox --exit
elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then
bspc quit
elif [[ "$DESKTOP_SESSION" == "i3" ]]; then
i3-msg exit
fi
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
exit 0
else
msg
fi
;;
esac

View file

@ -0,0 +1,59 @@
#!/usr/bin/env bash
# Color files
PFILE="$HOME/.config/polybar/pwidgets/colors.ini"
RFILE="$HOME/.config/polybar/pwidgets/scripts/rofi/colors.rasi"
WFILE="$HOME/.cache/wal/colors.sh"
# Get colors
pywal_get() {
wal -i "$1" -q -t
}
# Change colors
change_color() {
# polybar
sed -i -e "s/bg = #.*/bg = ${BG}/g" $PFILE
sed -i -e "s/fg = #.*/fg = ${FG}/g" $PFILE
sed -i -e "s/fga = #.*/fga = ${RFG}/g" $PFILE
sed -i -e "s/ac = #.*/ac = ${AC}/g" $PFILE
# rofi
cat > $RFILE <<- EOF
/* colors */
* {
al: #00000000;
bg: ${BG}FF;
fg: ${RFG}FF;
ac: ${AC}FF;
}
EOF
}
# Main
if [[ -x "`which wal`" ]]; then
if [[ "$1" ]]; then
pywal_get "$1"
# Source the pywal color file
if [[ -e "$WFILE" ]]; then
. "$WFILE"
else
echo 'Color file does not exist, exiting...'
exit 1
fi
BG=`printf "%s\n" "$background"`
FG=`printf "%s\n" "$foreground"`
RFG=`printf "%s\n" "$color8"`
AC=`printf "%s\n" "$color1"`
change_color
else
echo -e "[!] Please enter the path to wallpaper. \n"
echo "Usage : ./pywal.sh path/to/image"
fi
else
echo "[!] 'pywal' is not installed."
fi

View file

@ -0,0 +1,67 @@
#!/usr/bin/env bash
# Color files
PFILE="$HOME/.config/polybar/pwidgets/colors.ini"
RFILE="$HOME/.config/polybar/pwidgets/scripts/rofi/colors.rasi"
# Change colors
change_color() {
# polybar
sed -i -e "s/bg = #.*/bg = ${BG}/g" $PFILE
sed -i -e "s/fg = #.*/fg = ${BG}/g" $PFILE
sed -i -e "s/fga = #.*/fga = ${RFG}/g" $PFILE
sed -i -e "s/ac = #.*/ac = ${AC}/g" $PFILE
# rofi
cat > $RFILE <<- EOF
/* colors */
* {
al: #00000000;
bg: ${BG}FF;
fg: ${RFG}FF;
ac: ${AC}FF;
}
EOF
polybar-msg cmd restart
}
get_random_number() {
RNUM=$(( ($RANDOM % $1) + 1 ))
}
get_random_color() {
RCOLOR="#"
for i in 1 2 3 4 5 6
do
get_random_number "16"
case $RNUM in
"1") NEXTDIGIT="1";;
"2") NEXTDIGIT="2";;
"3") NEXTDIGIT="3";;
"4") NEXTDIGIT="4";;
"5") NEXTDIGIT="5";;
"6") NEXTDIGIT="6";;
"7") NEXTDIGIT="7";;
"8") NEXTDIGIT="8";;
"9") NEXTDIGIT="9";;
"10") NEXTDIGIT="A";;
"11") NEXTDIGIT="B";;
"12") NEXTDIGIT="C";;
"13") NEXTDIGIT="D";;
"14") NEXTDIGIT="E";;
"15") NEXTDIGIT="F";;
"16") NEXTDIGIT="0";;
esac
RCOLOR="$RCOLOR$NEXTDIGIT"
done
echo $RCOLOR
}
# Main
BG=`get_random_color`
RFG=`get_random_color`
AC=`get_random_color`
change_color

View file

@ -0,0 +1,8 @@
/* colors */
* {
al: #00000000;
bg: #FFFFFFFF;
fg: #454545FF;
ac: #1565C0FF;
}

View file

@ -0,0 +1,25 @@
/* Confirm Dialog */
@import "colors.rasi"
* {
background-color: @bg;
text-color: @fg;
font: "Iosevka Nerd Font 10";
}
window {
width: 230px;
padding: 20px;
border: 0px;
border-radius: 20px;
border-color: @ac;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
entry {
expand: true;
text-color: @ac;
}

View file

@ -0,0 +1,119 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Iosevka Nerd Font 10";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px;
border-color: @ac;
border-radius: 20px;
width: 460px;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
prompt {
enabled: true;
padding: 10px;
background-color: @al;
text-color: @ac;
font: "Iosevka Nerd Font 10";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ prompt, entry ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 12px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 8;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 10px;
padding: 2px 10px 10px 10px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px;
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
border: 0px;
}
element-text {
background-color: transparent;
text-color: inherit;
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
}
element selected {
background-color: @ac;
text-color: @bg;
border: 0px 0px 0px 0px;
border-radius: 12px;
border-color: @ac;
}

View file

@ -0,0 +1,25 @@
/* Confirm Dialog */
@import "colors.rasi"
* {
background-color: @bg;
text-color: @fg;
font: "Iosevka Nerd Font 10";
}
window {
width: 230px;
padding: 20px;
border: 0px;
border-radius: 20px;
border-color: @ac;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
entry {
expand: true;
text-color: @ac;
}

View file

@ -0,0 +1,127 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Iosevka Nerd Font 10";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px;
border-color: @ac;
border-radius: 20px;
width: 460px;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
prompt {
enabled: true;
padding: 10px;
background-color: @al;
text-color: @fg;
}
textbox-prompt-colon {
padding: 10px 5px 10px 15px;
font: "Iosevka Nerd Font 10";
background-color: @al;
text-color: @ac;
expand: false;
str: "直";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ textbox-prompt-colon, prompt ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 12px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 8;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 10px;
padding: 2px 10px 10px 10px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px 8px 8px -10px;
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
border: 0px;
}
element-text {
background-color: transparent;
text-color: inherit;
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
}
element selected {
background-color: @ac;
text-color: @bg;
border: 0px 0px 0px 0px;
border-radius: 12px;
border-color: @ac;
}

View file

@ -0,0 +1,127 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Iosevka Nerd Font 10";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px;
border-color: @ac;
border-radius: 20px;
width: 460px;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
prompt {
enabled: true;
padding: 10px;
background-color: @al;
text-color: @fg;
}
textbox-prompt-colon {
padding: 10px 5px 10px 15px;
font: "Iosevka Nerd Font 10";
background-color: @al;
text-color: @ac;
expand: false;
str: "";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ textbox-prompt-colon, prompt ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 12px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 5;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 10px;
padding: 2px 10px 10px 10px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px 8px 8px -16px;
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
border: 0px;
}
element-text {
background-color: transparent;
text-color: inherit;
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
}
element selected {
background-color: @ac;
text-color: @bg;
border: 0px 0px 0px 0px;
border-radius: 12px;
border-color: @ac;
}

View file

@ -0,0 +1,127 @@
/*
*
* Author : Aditya Shakya
* Mail : adi1090x@gmail.com
* Github : @adi1090x
* Twitter : @adi1090x
*
*/
configuration {
font: "Iosevka Nerd Font 10";
show-icons: true;
icon-theme: "Papirus";
display-drun: "";
drun-display-format: "{name}";
disable-history: false;
fullscreen: false;
hide-scrollbar: true;
sidebar-mode: false;
}
@import "colors.rasi"
window {
transparency: "real";
background-color: @bg;
text-color: @fg;
border: 0px;
border-color: @ac;
border-radius: 20px;
width: 460px;
location: southwest;
x-offset: 25px;
y-offset: -95px;
}
prompt {
enabled: true;
padding: 10px;
background-color: @al;
text-color: @fg;
}
textbox-prompt-colon {
padding: 10px 10px 10px 15px;
font: "Iosevka Nerd Font 10";
background-color: @al;
text-color: @ac;
expand: false;
str: "";
}
entry {
background-color: @al;
text-color: @ac;
placeholder-color: @ac;
expand: true;
horizontal-align: 0;
placeholder: "Search...";
padding: 10px 10px 10px 0px;
border-radius: 0px;
blink: true;
}
inputbar {
children: [ textbox-prompt-colon, entry ];
background-color: @al;
text-color: @fg;
expand: false;
border: 0px 0px 1px 0px;
border-radius: 12px;
border-color: @ac;
spacing: 0px;
}
listview {
background-color: @al;
padding: 0px;
columns: 1;
lines: 5;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @al;
border: 0px;
border-radius: 0px;
border-color: @ac;
children: [ inputbar, listview ];
spacing: 10px;
padding: 2px 10px 10px 10px;
}
element {
background-color: @al;
text-color: @fg;
orientation: horizontal;
border-radius: 0px;
padding: 8px 8px 8px -16px;
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
border: 0px;
}
element-text {
background-color: transparent;
text-color: inherit;
expand: true;
horizontal-align: 0;
vertical-align: 0.5;
margin: 0px 2.5px 0px 2.5px;
}
element selected {
background-color: @ac;
text-color: @bg;
border: 0px 0px 0px 0px;
border-radius: 12px;
border-color: @ac;
}

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
SDIR="$HOME/.config/polybar/pwidgets/scripts"
# Launch Rofi
MENU="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p '' \
-theme $SDIR/rofi/styles.rasi \
<<< " Default| Nord| Gruvbox| Dark| Cherry| White| Black|")"
case "$MENU" in
*Default) "$SDIR"/styles.sh --default ;;
*Nord) "$SDIR"/styles.sh --nord ;;
*Gruvbox) "$SDIR"/styles.sh --gruvbox ;;
*Dark) "$SDIR"/styles.sh --dark ;;
*Cherry) "$SDIR"/styles.sh --cherry ;;
*White) "$SDIR"/styles.sh --white ;;
*Black) "$SDIR"/styles.sh --black ;;
esac

View file

@ -0,0 +1,78 @@
#!/usr/bin/env bash
# Color files
PFILE="$HOME/.config/polybar/pwidgets/colors.ini"
RFILE="$HOME/.config/polybar/pwidgets/scripts/rofi/colors.rasi"
# Change colors
change_color() {
# polybar
sed -i -e "s/bg = #.*/bg = #FF${BG}/g" $PFILE
sed -i -e "s/fg = #.*/fg = #FF${FG}/g" $PFILE
sed -i -e "s/fga = #.*/fga = #FF${RFG}/g" $PFILE
sed -i -e "s/ac = #.*/ac = #FF${AC}/g" $PFILE
# rofi
cat > $RFILE <<- EOF
/* colors */
* {
al: #00000000;
bg: #${BG}FF;
fg: #${RFG}FF;
ac: #${AC}FF;
}
EOF
polybar-msg cmd restart
}
if [[ $1 = "--default" ]]; then
BG="212B30"
FG="C4C7C5"
RFG="C4C7C5"
AC="51B4FF"
change_color
elif [[ $1 = "--nord" ]]; then
BG="3B4252"
FG="E5E9F0"
RFG="E5E9F0"
AC="A3BE8C"
change_color
elif [[ $1 = "--gruvbox" ]]; then
BG="282828"
FG="EBDBB2"
RFG="EBDBB2"
AC="FB4934"
change_color
elif [[ $1 = "--dark" ]]; then
BG="141C21"
FG="f5f5f5"
RFG="f5f5f5"
AC="FFE744"
change_color
elif [[ $1 = "--cherry" ]]; then
BG="1F1626"
FG="FFFFFF"
RFG="FFFFFF"
AC="D94084"
change_color
elif [[ $1 = "--white" ]]; then
BG="FFFFFF"
FG="FFFFFF"
RFG="454545"
AC="1565C0"
change_color
elif [[ $1 = "--black" ]]; then
BG="0a0a0a"
FG="0a0a0a"
RFG="a0a0a0"
AC="40D8EB"
change_color
else
cat <<- _EOF_
No option specified, Available options:
--default --nord --gruvbox --dark --cherry
--white --black
_EOF_
fi