[WIP]
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
./hyprpaper.nix
|
./hyprpaper.nix
|
||||||
./audio.nix
|
./audio.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
|
./rofi/rofi.nix
|
||||||
../apps/element.nix
|
../apps/element.nix
|
||||||
../apps/eww
|
../apps/eww
|
||||||
./terminal.nix
|
./terminal.nix
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
feh
|
feh
|
||||||
networkmanagerapplet # network control
|
networkmanagerapplet # network control
|
||||||
hyprlock # lock screen
|
hyprlock # lock screen
|
||||||
rofi # launcher
|
|
||||||
swayidle # lock on idle
|
swayidle # lock on idle
|
||||||
swayosd # volume pop-up
|
swayosd # volume pop-up
|
||||||
swaynotificationcenter # notifications
|
swaynotificationcenter # notifications
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
opts = {
|
||||||
|
filetypes = {
|
||||||
|
markdown = false,
|
||||||
|
help = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
18
home-manager/features/rofi/config/powermenu/colors.rasi
Normal file
18
home-manager/features/rofi/config/powermenu/colors.rasi
Normal 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"
|
||||||
12
home-manager/features/rofi/config/powermenu/fonts.rasi
Normal file
12
home-manager/features/rofi/config/powermenu/fonts.rasi
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Aditya Shakya (adi1090x)
|
||||||
|
* Github : @adi1090x
|
||||||
|
*
|
||||||
|
* Fonts
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
* {
|
||||||
|
font: "JetBrains Mono Nerd Font 10";
|
||||||
|
}
|
||||||
112
home-manager/features/rofi/config/powermenu/powermenu.sh
Executable file
112
home-manager/features/rofi/config/powermenu/powermenu.sh
Executable file
@@ -0,0 +1,112 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## Author : Aditya Shakya (adi1090x)
|
||||||
|
## Github : @adi1090x
|
||||||
|
#
|
||||||
|
## Rofi : Power Menu
|
||||||
|
|
||||||
|
## Edited by Periodic
|
||||||
|
|
||||||
|
dir="$(pwd)"
|
||||||
|
|
||||||
|
# CMDs
|
||||||
|
uptime="$(uptime | awk -F ' ' '{print $2}' | sed -e 's/,//g')"
|
||||||
|
host=`hostname`
|
||||||
|
|
||||||
|
# Options
|
||||||
|
shutdown=''
|
||||||
|
reboot=''
|
||||||
|
lock=''
|
||||||
|
suspend=''
|
||||||
|
logout=''
|
||||||
|
yes=''
|
||||||
|
no=''
|
||||||
|
|
||||||
|
# Rofi CMD
|
||||||
|
rofi_cmd() {
|
||||||
|
rofi -dmenu \
|
||||||
|
-p "Uptime: $uptime" \
|
||||||
|
-mesg "Uptime: $uptime" \
|
||||||
|
-theme ${dir}/style.rasi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Confirmation CMD
|
||||||
|
confirm_cmd() {
|
||||||
|
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \
|
||||||
|
-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?' \
|
||||||
|
-theme ${dir}/style.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
|
||||||
|
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
|
||||||
|
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
|
||||||
|
elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then
|
||||||
|
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
|
||||||
|
elif command -v hyprctl &>/dev/null; then
|
||||||
|
hyprctl dispatch 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
|
||||||
|
elif command -v hyprlock &>/dev/null; then
|
||||||
|
hyprlock
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$suspend)
|
||||||
|
run_cmd --suspend
|
||||||
|
;;
|
||||||
|
$logout)
|
||||||
|
run_cmd --logout
|
||||||
|
;;
|
||||||
|
esac
|
||||||
170
home-manager/features/rofi/config/powermenu/style.rasi
Normal file
170
home-manager/features/rofi/config/powermenu/style.rasi
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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"
|
||||||
|
|
||||||
|
/*
|
||||||
|
USE_BUTTONS=YES
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 800px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
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", "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"];
|
||||||
|
}
|
||||||
|
|
||||||
|
dummy {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-radius: 0px;
|
||||||
|
background-color: @urgent;
|
||||||
|
text-color: @background;
|
||||||
|
}
|
||||||
|
prompt {
|
||||||
|
enabled: true;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 0px;
|
||||||
|
background-color: @active;
|
||||||
|
text-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Message -----*****/
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
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.5;
|
||||||
|
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: 5;
|
||||||
|
lines: 1;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 15px;
|
||||||
|
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: 40px 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
font: "feather bold 32";
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.5;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
11
home-manager/features/rofi/rofi.nix
Normal file
11
home-manager/features/rofi/rofi.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
rofi
|
||||||
|
];
|
||||||
|
|
||||||
|
home.file.".config/rofi" = {
|
||||||
|
source = ./config;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user