File tree Expand file tree Collapse file tree 7 files changed +172
-291
lines changed Expand file tree Collapse file tree 7 files changed +172
-291
lines changed Original file line number Diff line number Diff line change 2727 ./p10k/p10k.nix
2828 ./packages # other packages
2929 ./retroarch.nix
30- ./rofi.nix # launcher
30+ ./rofi/rofi .nix # launcher
3131 ./scripts/scripts.nix # personal scripts
3232 ./ssh.nix # ssh config
3333 ./superfile/superfile.nix # terminal file manager
Original file line number Diff line number Diff line change 1- { pkgs , ... } :
2- {
3- home . packages = with pkgs ; [ rofi ] ;
4-
5- xdg . configFile . "rofi/theme.rasi" . text = ''
6- * {
7- bg-col: #1D2021;
8- bg-col-light: #282828;
9- border-col: #A89984;
10- selected-col: #3C3836;
11- green: #98971A;
12- fg-col: #FBF1C7;
13- fg-col2: #EBDBB2;
14- grey: #BDAE93;
15- highlight: @green;
16- }
17- '' ;
18-
19- xdg . configFile . "rofi/config.rasi" . text = ''
20- configuration{
1+ configuration{
212 modi: "run,drun,window";
223 lines: 5;
234 cycle: false;
125106 button selected {
126107 background-color: @bg-col;
127108 text-color: @green;
128- }
129- '' ;
130- }
109+ }
Original file line number Diff line number Diff line change 1+ @theme "theme"
2+
3+ configuration {
4+ show-icons: false;
5+ font: "Maple Mono Bold 24";
6+ }
7+
8+ window {
9+ /* properties for window widget */
10+ width: 500px;
11+ location: center;
12+ anchor: center;
13+
14+ margin: 0px;
15+ padding: 0px;
16+
17+ border: 2px solid;
18+ border-radius: 0px;
19+ border-color: @border-col;
20+
21+ background-color: @bg-col;
22+ }
23+
24+ mainbox {
25+ enabled: true;
26+
27+ border: 0px solid;
28+ border-radius: 0px;
29+ border-color: @selected-col;
30+
31+ background-color: inherit;
32+
33+ children: [ "listview" ];
34+ }
35+
36+ listview {
37+ enabled: true;
38+
39+ lines: 1;
40+ columns: 5;
41+
42+ cycle: true;
43+ dynamic: true;
44+ scrollbar: false;
45+ layout: vertical;
46+ reverse: false;
47+ fixed-height: true;
48+ fixed-columns: true;
49+
50+ spacing: 0px;
51+
52+ border: inherit;
53+ border-radius: inherit;
54+ border-color: inherit;
55+
56+ text-color: @fg-col;
57+ background-color: transparent;
58+ }
59+
60+ element {
61+ enabled: true;
62+
63+ spacing: 0px;
64+ padding: 28px 0px;
65+
66+ border: inherit;
67+ border-radius: inherit;
68+ border-color: inherit;
69+
70+ background-color: inherit;
71+ text-color: @fg-col;
72+ cursor: pointer;
73+ }
74+
75+ element-text {
76+ vertical-align: 0.5;
77+ horizontal-align: 0.5;
78+
79+ font: inherit;
80+ text-color: inherit;
81+
82+ background-color: transparent;
83+ cursor: inherit;
84+ }
85+
86+ element selected.normal {
87+ background-color: @selected-col;
88+ }
Original file line number Diff line number Diff line change 1+ { pkgs , ... } :
2+ {
3+ home . packages = with pkgs ; [ rofi ] ;
4+
5+ xdg . configFile . "rofi/theme.rasi" . source = ./theme.rasi ;
6+ xdg . configFile . "rofi/config.rasi" . source = ./config.rasi ;
7+
8+ xdg . configFile . "rofi/powermenu-theme.rasi" . source = ./powermenu-theme.rasi ;
9+ }
Original file line number Diff line number Diff line change 1+ * {
2+ bg-col: #1D2021;
3+ bg-col-light: #282828;
4+ border-col: #A89984;
5+ selected-col: #3C3836;
6+ green: #98971A;
7+ fg-col: #FBF1C7;
8+ fg-col2: #EBDBB2;
9+ grey: #BDAE93;
10+ highlight: @green;
11+ }
Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /usr/bin/env bash
22
3- rofi -show p -modi p:' rofi-power-menu' -theme-str ' window {width: 10em; height: 15em;} listview {lines: 5;}'
3+ shutdown=' '
4+ reboot=' '
5+ lock=' '
6+ suspend=' '
7+
8+ yes=' ✔'
9+ no=' ✘'
10+
11+ theme=" $HOME /.config/rofi/powermenu-theme.rasi"
12+
13+ rofi_cmd () {
14+ rofi -dmenu -theme ${theme}
15+ }
16+
17+ run_rofi () {
18+ echo -e " $shutdown \n$reboot \n$lock \n$suspend \n$no " | rofi_cmd
19+ }
20+
21+ confirm_cmd () {
22+ rofi -theme-str ' window {width: 200px;}' \
23+ -theme-str ' listview { columns: 2; }' \
24+ -dmenu -theme ${theme}
25+ }
26+
27+ rofi_confirm () {
28+ echo -e " $yes \n$no " | confirm_cmd
29+ }
30+
31+ run_cmd () {
32+ selected=" $( rofi_confirm) "
33+ if [[ " $selected " == " $yes " ]]; then
34+ if [[ $1 == ' --shutdown' ]]; then
35+ systemctl poweroff
36+ elif [[ $1 == ' --reboot' ]]; then
37+ systemctl reboot
38+ elif [[ $1 == ' --suspend' ]]; then
39+ systemctl suspend
40+ fi
41+ else
42+ exit 0
43+ fi
44+ }
45+
46+ chosen=" $( run_rofi) "
47+ case ${chosen} in
48+ $shutdown )
49+ run_cmd --shutdown
50+ ;;
51+ $reboot )
52+ run_cmd --reboot
53+ ;;
54+ $lock )
55+ sleep 0.1
56+ swaylock
57+ ;;
58+ $suspend )
59+ sleep 0.1
60+ run_cmd --suspend
61+ ;;
62+ esac
You can’t perform that action at this time.
0 commit comments