Added type-1 powermenu

This commit is contained in:
adi1090x 2022-08-15 20:58:12 +05:30
parent 13f5d90e0b
commit 04530e3e71
8 changed files with 951 additions and 0 deletions

View File

@ -0,0 +1,110 @@
#!/usr/bin/env bash
## Author : Aditya Shakya (adi1090x)
## Github : @adi1090x
#
## Rofi : Power Menu
#
## Available Styles
#
## style-1 style-2 style-3 style-4 style-5
# Current Theme
dir="$HOME/.config/rofi/powermenu/type-1"
theme='style-1'
# CMDs
uptime="`uptime -p | sed -e 's/up //g'`"
host=`hostname`
# Options
shutdown=' Shutdown'
reboot=' Reboot'
lock=' Lock'
suspend=' Suspend'
logout=' Logout'
yes=' Yes'
no=' No'
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$host" \
-mesg "Uptime: $uptime" \
-select $lock \
-theme ${dir}/${theme}.rasi
}
# Confirmation CMD
confirm_cmd() {
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 250px;}' \
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
-theme-str 'listview {columns: 2; lines: 1;}' \
-theme-str 'element-text {horizontal-align: 0.5;}' \
-theme-str 'textbox {horizontal-align: 0.5;}' \
-dmenu \
-p 'Confirmation' \
-mesg 'Are you Sure?' \
-select $yes \
-theme ${dir}/${theme}.rasi
}
# Ask for confirmation
confirm_exit() {
echo -e "$yes\n$no" | confirm_cmd
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
}
# Execute Command
run_cmd() {
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
if [[ $1 == '--shutdown' ]]; then
systemctl poweroff
elif [[ $1 == '--reboot' ]]; then
systemctl reboot
elif [[ $1 == '--suspend' ]]; then
mpc -q pause
amixer set Master mute
systemctl suspend
elif [[ $1 == '--logout' ]]; then
if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then
openbox --exit
elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then
bspc quit
elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then
i3-msg exit
fi
fi
else
exit 0
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$shutdown)
run_cmd --shutdown
;;
$reboot)
run_cmd --reboot
;;
$lock)
if [[ -x '/usr/bin/betterlockscreen' ]]; then
betterlockscreen -l
elif [[ -x '/usr/bin/i3lock' ]]; then
i3lock
fi
;;
$suspend)
run_cmd --suspend
;;
$logout)
run_cmd --logout
;;
esac

View File

@ -0,0 +1,18 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Colors
*
* Available Colors Schemes
*
* adapta catppuccin everforest navy paper
* arc cyberpunk gruvbox nord solarized
* black dracula lovelace onedark yousai
*
**/
/* Import color-scheme from `colors` directory */
@import "~/.config/rofi/colors/onedark.rasi"

View File

@ -0,0 +1,12 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Fonts
*
**/
* {
font: "JetBrains Mono Nerd Font 10";
}

View File

@ -0,0 +1,161 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Rofi Theme File
* Rofi Version: 1.7.3
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 400px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 12px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 10px 14px;
border-radius: 10px;
background-color: @urgent;
text-color: @background;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 10px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 10px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
placeholder-color: @foreground;
blink: true;
markup: true;
}
error-message {
padding: 10px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 5;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 10px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@ -0,0 +1,161 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Rofi Theme File
* Rofi Version: 1.7.3
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 500px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 2px solid;
border-radius: 20px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 15px;
margin: 0px;
padding: 30px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 15px;
margin: 0px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 12px 16px;
border-radius: 100%;
background-color: @urgent;
text-color: @background;
}
prompt {
enabled: true;
padding: 12px;
border-radius: 100%;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 12px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
placeholder-color: @foreground;
blink: true;
markup: true;
}
error-message {
padding: 12px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 5;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 12px;
border: 0px solid;
border-radius: 100%;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@ -0,0 +1,161 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Rofi Theme File
* Rofi Version: 1.7.3
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 350px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 1px solid;
border-radius: 0px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 8px;
margin: 0px;
padding: 8px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 8px;
margin: 0px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 8px 12px;
border-radius: 0px;
background-color: @urgent;
text-color: @background;
}
prompt {
enabled: true;
padding: 8px;
border-radius: 0px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 8px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
placeholder-color: @foreground;
blink: true;
markup: true;
}
error-message {
padding: 8px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 5;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 8px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@ -0,0 +1,161 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Rofi Theme File
* Rofi Version: 1.7.3
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 500px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 30px 10px 30px 10px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 15px;
margin: 0px;
padding: 30px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 15px;
margin: 0px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 10px 14px;
border-radius: 15px 10px 15px 10px;
background-color: @urgent;
text-color: @background;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 10px 15px 10px 15px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 15px 10px 15px 10px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
placeholder-color: @foreground;
blink: true;
markup: true;
}
error-message {
padding: 10px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 1;
lines: 5;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 15px 10px 15px 10px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

View File

@ -0,0 +1,167 @@
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Rofi Theme File
* Rofi Version: 1.7.3
**/
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
@import "shared/fonts.rasi"
/*****----- Main Window -----*****/
window {
/* properties for window widget */
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 605px;
x-offset: 0px;
y-offset: 0px;
/* properties for all widgets */
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 4px;
border-color: @selected;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 20px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", dummy, "prompt"];
}
dummy {
background-color: transparent;
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 10px 14px;
border-radius: 4px;
background-color: @urgent;
text-color: @background;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 4px;
background-color: @active;
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 4px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
placeholder-color: @foreground;
blink: true;
markup: true;
}
error-message {
padding: 10px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 5;
lines: 1;
cycle: true;
dynamic: true;
scrollbar: false;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
spacing: 0px;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 4px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
cursor: pointer;
}
element-text {
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element selected.normal {
border: 0px 2px 0px 2px;
border-radius: 4px;
background-color: var(selected);
text-color: var(background);
}