Skip to content

Commit 1a560d0

Browse files
committed
refactor(home-manager): migrate to xdg.configFile and improve configurations
- Updated all file paths to use `xdg.configFile` for better XDG compliance - Enhanced Rofi theme with Dracula color palette and improved styling - Simplified Swaylock configuration by removing unnecessary packages - Refactored Sway and Kitty configurations for clarity and maintainability - Improved Mako notification settings with urgency-specific border colors
1 parent 6272f57 commit 1a560d0

File tree

7 files changed

+101
-82
lines changed

7 files changed

+101
-82
lines changed

home-manager/programs/kitty/default.nix

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,9 @@
6565
};
6666
};
6767

68-
home.file.".config/kitty/emacsclient_transparent.conf" = {
69-
text = ''
70-
# メインのKitty設定を読み込む(キーバインドなど共通設定が必要な場合)
68+
xdg.configFile = {
69+
".config/kitty/emacsclient_transparent.conf".text = ''
7170
include ~/.config/kitty/kitty.conf
72-
73-
# 背景の透過度を設定 (0.0: 完全透明, 1.0: 完全不透明)
7471
background_opacity 0.8
7572
'';
7673
};
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{ pkgs }:
22
{
3-
home.file.".config/rofi/themes/dracula.rasi".source = ./themes/dracula.rasi;
3+
xdg.configFile = {
4+
"rofi/themes/dracula.rasi".source = ./themes/dracula.rasi;
5+
};
6+
47
programs.rofi = {
58
enable = pkgs.stdenv.isLinux;
9+
theme = "dracula";
610
font = "HackGenNerd 16";
711
plugins = with pkgs; [
812
rofi-calc
913
rofi-power-menu
1014
];
1115

12-
pass = {
13-
enable = pkgs.stdenv.isLinux;
14-
stores = [ "$HOME/ghq/github.com/takeokunn/private/password-store" ];
15-
};
16-
1716
extraConfig = {
1817
modi = "window,run,drun";
1918
show-icons = true;
@@ -23,16 +22,7 @@
2322
display-run = " Run";
2423
display-drun = " Application";
2524
display-filebrowser = " Filebrowser";
26-
# timeout = {
27-
# action = "kb-cancel";
28-
# delay = 60;
29-
# };
30-
# filebrowser = {
31-
# directory = "$HOME";
32-
# directories-first = true;
33-
# sorting-method = "name";
34-
# };
25+
disable-history= false;
3526
};
36-
theme = "dracula";
3727
};
3828
}

home-manager/programs/rofi/themes/dracula.rasi

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
/*Dracula theme based on the Purple official rofi theme*/
2-
3-
configuration {
4-
show-icons: true;
5-
display-drun: "";
6-
disable-history: false;
7-
}
8-
91
* {
2+
/* Dracula theme colour palette */
3+
drac-bgd: #282a36;
4+
drac-cur: #44475a;
5+
drac-fgd: #f8f8f2;
6+
drac-cmt: #6272a4;
7+
drac-cya: #8be9fd;
8+
drac-grn: #50fa7b;
9+
drac-ora: #ffb86c;
10+
drac-pnk: #ff79c6;
11+
drac-pur: #bd93f9;
12+
drac-red: #ff5555;
13+
drac-yel: #f1fa8c;
14+
1015
font: "Jetbrains Mono 12";
11-
foreground: #f8f8f2;
12-
background-color: #282a36;
13-
active-background: #6272a4;
14-
urgent-background: #ff5555;
15-
urgent-foreground: #282a36;
16+
17+
foreground: @drac-fgd;
18+
background-color: @drac-bgd;
19+
active-background: @drac-pnk;
20+
urgent-background: @drac-red;
21+
urgent-foreground: @drac-bgd;
22+
1623
selected-background: @active-background;
1724
selected-urgent-background: @urgent-background;
1825
selected-active-background: @active-background;
1926
separatorcolor: @active-background;
20-
bordercolor: @active-background;
27+
bordercolor: #6272a4;
2128
}
2229

2330
#window {
@@ -27,18 +34,22 @@ configuration {
2734
border-color: @bordercolor;
2835
padding: 15;
2936
}
37+
3038
#mainbox {
3139
border: 0;
3240
padding: 0;
3341
}
42+
3443
#message {
3544
border: 0px;
3645
border-color: @separatorcolor;
37-
padding: 1px;
46+
padding: 1px ;
3847
}
48+
3949
#textbox {
4050
text-color: @foreground;
4151
}
52+
4253
#listview {
4354
fixed-height: 0;
4455
border: 0px;
@@ -47,86 +58,106 @@ configuration {
4758
scrollbar: false;
4859
padding: 2px 0px 0px ;
4960
}
61+
5062
#element {
5163
border: 0;
5264
padding: 3px ;
5365
}
66+
5467
#element.normal.normal {
5568
background-color: @background-color;
5669
text-color: @foreground;
5770
}
71+
5872
#element.normal.urgent {
5973
background-color: @urgent-background;
6074
text-color: @urgent-foreground;
6175
}
76+
6277
#element.normal.active {
6378
background-color: @active-background;
64-
text-color: @foreground;
79+
text-color: @background-color;
6580
}
81+
6682
#element.selected.normal {
6783
background-color: @selected-background;
6884
text-color: @foreground;
6985
}
86+
7087
#element.selected.urgent {
7188
background-color: @selected-urgent-background;
7289
text-color: @foreground;
7390
}
91+
7492
#element.selected.active {
7593
background-color: @selected-active-background;
76-
text-color: @foreground;
94+
text-color: @background-color;
7795
}
96+
7897
#element.alternate.normal {
7998
background-color: @background-color;
8099
text-color: @foreground;
81100
}
101+
82102
#element.alternate.urgent {
83103
background-color: @urgent-background;
84104
text-color: @foreground;
85105
}
106+
86107
#element.alternate.active {
87108
background-color: @active-background;
88109
text-color: @foreground;
89110
}
111+
90112
#scrollbar {
91113
width: 2px ;
92114
border: 0;
93115
handle-width: 8px ;
94116
padding: 0;
95117
}
118+
96119
#sidebar {
97120
border: 2px dash 0px 0px ;
98121
border-color: @separatorcolor;
99122
}
123+
100124
#button.selected {
101125
background-color: @selected-background;
102126
text-color: @foreground;
103127
}
128+
104129
#inputbar {
105130
spacing: 0;
106131
text-color: @foreground;
107132
padding: 1px ;
108133
}
134+
109135
#case-indicator {
110136
spacing: 0;
111137
text-color: @foreground;
112138
}
139+
113140
#entry {
114141
spacing: 0;
115-
text-color: @foreground;
142+
text-color: @drac-cya;
116143
}
144+
117145
#prompt {
118146
spacing: 0;
119-
text-color: @foreground;
147+
text-color: @drac-grn;
120148
}
149+
121150
#inputbar {
122151
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
123152
}
153+
124154
#textbox-prompt-colon {
125155
expand: false;
126156
str: ">";
127157
margin: 0px 0.3em 0em 0em ;
128-
text-color: @foreground;
158+
text-color: @drac-pur;
129159
}
160+
130161
element-text, element-icon {
131162
background-color: inherit;
132163
text-color: inherit;

home-manager/programs/sway/default.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
home.file = {
3-
".config/sway/wallpaper.png".source = ./wallpaper.png;
4-
".config/sway/config".source = ./config;
5-
".config/sway/ime.sh" = {
2+
xdg.configFile = {
3+
"sway/wallpaper.png".source = ./wallpaper.png;
4+
"sway/config".source = ./config;
5+
"sway/ime.sh" = {
66
source = ./ime.sh;
77
executable = true;
88
};
9-
".config/sway/emacs-ime.sh" = {
9+
"sway/emacs-ime.sh" = {
1010
source = ./emacs-ime.sh;
1111
executable = true;
1212
};
13-
".config/sway/config.d/" = {
13+
"sway/config.d/" = {
1414
source = ./config.d;
1515
recursive = true;
1616
};

home-manager/programs/sway/emacs-ime.sh

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@ TEMP_FILE=$(mktemp)
44

55
# Kittyを起動し、専用の設定ファイルを適用し、タイトルを設定
66
# -c は --config の短縮形
7-
kitty -c ~/.config/kitty/emacsclient_transparent.conf --title "Temporary Editor" sh -c "
8-
emacsclient -c --eval \
9-
\"(progn
10-
(setq initial-buffer-choice nil)
11-
(let ((file \"$TEMP_FILE\"))
12-
(find-file file)
13-
(add-hook 'after-save-hook
14-
(lambda ()
15-
(when (eq (buffer-file-name) file)
16-
(with-current-buffer (current-buffer)
17-
(shell-command-on-region (point-min) (point-max) \"wl-copy\"))))
18-
nil 'local)
19-
(add-hook 'kill-buffer-hook
20-
(lambda ()
21-
(when (eq (buffer-file-name) file)
22-
(delete-file file)
23-
(message \"Temporary file deleted: %s\" file)
24-
(delete-frame))))
25-
))
26-
\""
7+
kitty \
8+
-c ~/.config/kitty/emacsclient_transparent.conf \
9+
--title "Temporary Editor" \
10+
sh -c "
11+
emacsclient -c --eval \
12+
\"(progn
13+
(setq initial-buffer-choice nil)
14+
(let ((file \"$TEMP_FILE\"))
15+
(find-file file)
16+
(add-hook 'after-save-hook
17+
(lambda ()
18+
(when (eq (buffer-file-name) file)
19+
(with-current-buffer (current-buffer)
20+
(shell-command-on-region (point-min) (point-max) \"wl-copy\"))))
21+
nil 'local)
22+
(add-hook 'kill-buffer-hook
23+
(lambda ()
24+
(when (eq (buffer-file-name) file)
25+
(delete-file file)
26+
(message \"Temporary file deleted: %s\" file)
27+
(delete-frame))))
28+
))
29+
\"
30+
"

home-manager/programs/swaylock/default.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{ lib, pkgs }:
22
{
3-
home.packages = with pkgs; lib.optionals pkgs.stdenv.isLinux [ swayidle ];
4-
53
programs.swaylock = {
64
enable = pkgs.stdenv.isLinux;
75
settings = {

home-manager/services/mako/default.nix

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
{
33
services.mako = {
44
enable = pkgs.stdenv.isLinux;
5-
settings = {
6-
backgroundColor = "#282a36";
7-
textColor = "#44475a";
8-
borderColor = "#282a36";
9-
};
10-
# settings = ''
11-
# [urgency=low]
12-
# border-color=#282a36
5+
extraConfig = ''
6+
background-color=#282a36
7+
text-color=#44475a
8+
border-color=#282a36
139
14-
# [urgency=normal]
15-
# border-color=#f1fa8c
10+
[urgency=low]
11+
border-color=#282a36
1612
17-
# [urgency=high]
18-
# border-color=#ff5555
19-
# '';
13+
[urgency=normal]
14+
border-color=#f1fa8c
15+
16+
[urgency=high]
17+
border-color=#ff5555
18+
'';
2019
};
2120
}

0 commit comments

Comments
 (0)