Initial commit
This commit is contained in:
commit
3d0f689542
19 changed files with 807 additions and 0 deletions
14
rofi/index.nix
Normal file
14
rofi/index.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.callPackage ./power.nix { })
|
||||
];
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
theme = "nord";
|
||||
};
|
||||
home.file.".config/rofi/nord.rasi" = {
|
||||
source = ./nord.rasi;
|
||||
};
|
||||
}
|
142
rofi/nord.rasi
Normal file
142
rofi/nord.rasi
Normal file
|
@ -0,0 +1,142 @@
|
|||
/**
|
||||
* Nordic rofi theme
|
||||
* Adapted by undiabler <undiabler@gmail.com>
|
||||
*
|
||||
* Nord Color palette imported from https://www.nordtheme.com/
|
||||
*
|
||||
*/
|
||||
|
||||
configuration {
|
||||
|
||||
font: "Noto Sans Mono 12";
|
||||
width: 30;
|
||||
line-margin: 10;
|
||||
lines: 6;
|
||||
columns: 2;
|
||||
|
||||
display-ssh: "";
|
||||
display-run: "";
|
||||
display-drun: "";
|
||||
display-window: "";
|
||||
display-combi: "";
|
||||
show-icons: true;
|
||||
}
|
||||
|
||||
* {
|
||||
nord0: #2e3440;
|
||||
nord1: #3b4252;
|
||||
nord2: #434c5e;
|
||||
nord3: #4c566a;
|
||||
|
||||
nord4: #d8dee9;
|
||||
nord5: #e5e9f0;
|
||||
nord6: #eceff4;
|
||||
|
||||
nord7: #8fbcbb;
|
||||
nord8: #88c0d0;
|
||||
nord9: #81a1c1;
|
||||
nord10: #5e81ac;
|
||||
nord11: #bf616a;
|
||||
|
||||
nord12: #d08770;
|
||||
nord13: #ebcb8b;
|
||||
nord14: #a3be8c;
|
||||
nord15: #b48ead;
|
||||
|
||||
foreground: @nord9;
|
||||
backlight: #ccffeedd;
|
||||
background-color: transparent;
|
||||
|
||||
highlight: underline bold #eceff4;
|
||||
|
||||
transparent: rgba(46,52,64,0);
|
||||
}
|
||||
|
||||
window {
|
||||
location: center;
|
||||
anchor: center;
|
||||
transparency: "screenshot";
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
border-radius: 0px;
|
||||
|
||||
background-color: @transparent;
|
||||
spacing: 0;
|
||||
children: [mainbox];
|
||||
orientation: horizontal;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
spacing: 0;
|
||||
children: [ inputbar, message, listview ];
|
||||
}
|
||||
|
||||
message {
|
||||
color: @nord0;
|
||||
padding: 5;
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
background-color: @nord7;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
color: @nord6;
|
||||
padding: 11px;
|
||||
background-color: #3b4252;
|
||||
|
||||
border: 0px;
|
||||
border-radius: 6px 6px 0px 0px;
|
||||
border-color: @nord10;
|
||||
}
|
||||
|
||||
entry, prompt, case-indicator {
|
||||
text-font: inherit;
|
||||
text-color:inherit;
|
||||
}
|
||||
|
||||
prompt {
|
||||
margin: 0px 0.3em 0em 0em ;
|
||||
}
|
||||
|
||||
listview {
|
||||
padding: 8px;
|
||||
border-radius: 0px 0px 6px 6px;
|
||||
border-color: @nord10;
|
||||
border: 0;
|
||||
background-color: rgba(46,52,64,0.9);
|
||||
dynamic: false;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 3px;
|
||||
vertical-align: 0.5;
|
||||
border-radius: 4px;
|
||||
background-color: transparent;
|
||||
color: @foreground;
|
||||
text-color: rgb(216, 222, 233);
|
||||
}
|
||||
|
||||
element selected.normal {
|
||||
background-color: @nord7;
|
||||
text-color: #2e3440;
|
||||
}
|
||||
|
||||
element-text, element-icon {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 6px;
|
||||
color: @foreground;
|
||||
horizontal-align: 0.5;
|
||||
|
||||
border: 2px 0px 2px 2px;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
border-color: @foreground;
|
||||
}
|
||||
|
||||
button selected normal {
|
||||
border: 2px 0px 2px 2px;
|
||||
border-color: @foreground;
|
||||
}
|
9
rofi/power.nix
Normal file
9
rofi/power.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ substituteAll }:
|
||||
|
||||
substituteAll {
|
||||
name = "rofi-power";
|
||||
src = ./power.sh;
|
||||
|
||||
dir = "bin";
|
||||
isExecutable = true;
|
||||
}
|
33
rofi/power.sh
Normal file
33
rofi/power.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
POWER_OFF=" Power Off"
|
||||
REBOOT=" Reboot"
|
||||
SUSPEND=" Suspend"
|
||||
LOG_OUT=" Log out"
|
||||
|
||||
chosen=`printf "%s\n%s\n%s\n%s" "$POWER_OFF" "$REBOOT" "$SUSPEND" "$LOG_OUT" | rofi -dmenu -i -p ""`
|
||||
|
||||
case "$chosen" in
|
||||
$POWER_OFF) action="power off" ;;
|
||||
$REBOOT) action="reboot" ;;
|
||||
$SUSPEND) action="suspend" ;;
|
||||
$LOG_OUT) action="log out" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
||||
confirm=`printf "Yes, %s" "$action"`
|
||||
sure=`printf "%s\nNo, cancel" "$confirm" | rofi -dmenu -i -p "Are you sure"`
|
||||
|
||||
if [[ $sure != $confirm ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $chosen != $SUSPEND ]]; then
|
||||
sh /home/elnu/scripts/graceful-shutdown/graceful_shutdown.sh
|
||||
fi
|
||||
|
||||
case "$chosen" in
|
||||
$POWER_OFF) sudo poweroff ;;
|
||||
$REBOOT) sudo reboot ;;
|
||||
$SUSPEND) sudo systemctl suspend ;;
|
||||
$LOG_OUT) i3-msg exit ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue