-
-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy path.joyfuld
executable file
·333 lines (281 loc) · 15.2 KB
/
.joyfuld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
#!/usr/bin/env sh
# The Joyful Desktop universal environment variables.
# https://github.com/owl4ce/dotfiles
# SPDX-License-Identifier: ISC
# Sequential tests 322 times, calculated fastest with Debian Almquist shell 0.0075s.
# https://i.imgur.com/ENZ6ocw.png
# shellcheck disable=SC2034,SC2166
# How to restart UI?
# Just switch modes or right-click on the desktop or press: [super] + [shift] + [R].
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Appearance options ~ Needs restart UI ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# ????_ART_TINT2_GLYPH || Th?m? panel button glyphs, copy-paste from `gucharmap`. #
# ||---------------------------------------------------------#
# ????_???_*_* || Partial user interface colors. Just custom by yourself. #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# >~~~~~~~~< Color template, your changeable variable names and values. >~~~~~~~~< #
COL_WHITE='#f9f9f9' # White
COL_RED_MAGENTA='#f48ee8' # Red mix Magenta
COL_RED='#fa74b2' # Red
COL_RED_VIOLET='#e88ef4' # Red mix Violet
COL_BLUE='#63c5ea' # Blue
COL_BLUE_VIOLET='#ac8ef4' # Blue mix Violet
COL_GREEN='#44eb9f' # Green
# >~< Don't change the variable name, the value is okay, use comments instead. >~< #
MECH_ART_TINT2_GLYPH='' #
EYEC_ART_TINT2_GLYPH='' #
# >~~~~~~~~~~~~< Mechanical >~~~~~~~~~~~~~~~~~~~~~~~~~~~< Artistic Mode >~~~~~~~~< #
MECH_ART_TINT2_GRAD1="$COL_RED_MAGENTA" # Tint2 button gradient color #1
MECH_ART_TINT2_GRAD2="$COL_RED" # Tint2 button gradient color #2
MECH_ART_ROFI_ACCNT1="$MECH_ART_TINT2_GRAD1" # Rofi (buttons) accent color #1
MECH_ART_ROFI_ACCNT2="$MECH_ART_TINT2_GRAD2" # Rofi (buttons) accent color #2
MECH_ART_DUNST_SMMRY="$COL_WHITE" # Dunst title / summary color
MECH_ART_DUNST_PRGBR="$MECH_ART_TINT2_GRAD1" # Dunst progress-bar FG color
MECH_ART_OB_MENU_TTL="$MECH_ART_TINT2_GRAD2" # Title color of Openbox menu
MECH_ART_OB_MENU_ITM="$MECH_ART_TINT2_GRAD1" # Items color of Openbox menu
# >~~~~~~~~~~~~< Mechanical >~~~~~~~~~~~~~~~~~~~~~~~~~< Interactive Mode >~~~~~~~< #
MECH_INT_ROFI_ACCNT1="$COL_WHITE" # Rofi (buttons) accent color #1
MECH_INT_ROFI_ACCNT2="$MECH_INT_ROFI_ACCNT1" # Rofi (buttons) accent color #2
MECH_INT_DUNST_SMMRY="$MECH_INT_ROFI_ACCNT2" # Dunst title / summary color
MECH_INT_DUNST_PRGBR="$MECH_INT_ROFI_ACCNT2" # Dunst progress-bar FG color
MECH_INT_OB_MENU_TTL="$MECH_INT_ROFI_ACCNT2" # Title color of Openbox menu
MECH_INT_OB_MENU_ITM="$COL_BLUE" # Items color of Openbox menu
# >~~~~~~~~~~~~~< EyeCandy >~~~~~~~~~~~~~~~~~~~~~~~~~~~~< Artistic Mode >~~~~~~~~< #
EYEC_ART_TINT2_GRAD1="$COL_RED" # Tint2 button gradient color #1
EYEC_ART_TINT2_GRAD2="$COL_RED_VIOLET" # Tint2 button gradient color #2
EYEC_ART_ROFI_ACCNT1="$EYEC_ART_TINT2_GRAD1" # Rofi (buttons) accent color #1
EYEC_ART_ROFI_ACCNT2="$EYEC_ART_TINT2_GRAD2" # Rofi (buttons) accent color #2
EYEC_ART_DUNST_SMMRY="$COL_BLUE" # Dunst title / summary color
EYEC_ART_DUNST_PRGBR="$EYEC_ART_TINT2_GRAD1" # Dunst progress-bar FG color
EYEC_ART_OB_MENU_TTL="$EYEC_ART_DUNST_SMMRY" # Title color of Openbox menu
EYEC_ART_OB_MENU_ITM="$EYEC_ART_TINT2_GRAD1" # Items color of Openbox menu
# >~~~~~~~~~~~~~< EyeCandy >~~~~~~~~~~~~~~~~~~~~~~~~~~< Interactive Mode >~~~~~~~< #
EYEC_INT_ROFI_ACCNT1="$COL_RED" # Rofi (buttons) accent color #1
EYEC_INT_ROFI_ACCNT2="$COL_RED_VIOLET" # Rofi (buttons) accent color #2
EYEC_INT_DUNST_SMMRY="$EYEC_INT_ROFI_ACCNT2" # Dunst title / summary color
EYEC_INT_DUNST_PRGBR="$COL_GREEN" # Dunst progress-bar FG color
EYEC_INT_OB_MENU_TTL="$EYEC_INT_ROFI_ACCNT1" # Title color of Openbox menu
EYEC_INT_OB_MENU_ITM="$EYEC_INT_ROFI_ACCNT2" # Items color of Openbox menu
# >~~~~~~~~~~~~~< 0 to 100 >~~~~~~~~~~~~~~~~~~~~~~~~~~~< Opacity Levels >~~~~~~~~< #
DUNST_OPACITY='97'
ROFI_OPACITY='97'
URXVT_OPACITY='97'
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Dunst notification and URxvt URL-launcher options ~ Needs restart UI ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
WEB_BROWSER='your_web_browser'
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Tint2 panel executor options for Interactive Mode ~ Auto-load ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# IFACE_ET || Ethernet interface, run `ifconfig` or `ip link` to see. #
# IFACE_WL || Wireless interface, run `ifconfig` or `ip link` to see. #
# ||---------------------------------------------------------#
# TEMP_DEV || Temperature device, see "/sys/devices/virtual/thermal". #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
IFACE_ET='enp4s0'
IFACE_WL='wlan0'
TEMP_DEV='thermal_zone0'
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Screenshot options ~ Auto-load ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# SS_SAVE || Save screenshots? If not then it's copied to clipboard. #
# SS_SVDIR || Directory to save screenshots, "$SS_SVDIR/Screenshots". #
# SS_CP2CLP || Copy to clipboard? Automatically 'yes' if SS_SAVE='no'. #
# SS_POINTER || Capture cursor (known as "pointer") in the screenshots? #
# SS_QUALITY || 0-100, high value means high size with low compression. #
# ||---------------------------------------------------------#
# SS_USE_FRAME || Use frame in the selection (or draw) mode? (MacOS-like) #
# SS_FRAME_COLOR || Hexa, RGBA supports. Fill 'auto' to use dominant color. #
# SS_FRAME_PADDING || Any number value, frame-padding in pixel for all sides. #
# SS_FRAME_S_OPACITY || 0-100, shadows opacity, high value means thick shadows. #
# ||---------------------------------------------------------#
# SS_COUNTDOWN_SECONDS || Any number value, how long (seconds) to capture screen. #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
SS_SAVE='yes' # Universal or all modes
SS_SVDIR="${HOME}/Pictures" # Universal or all modes
SS_CP2CLP='yes' # Universal or all modes
SS_POINTER='no' # Universal or all modes
SS_QUALITY='100' # Universal or all modes
SS_USE_FRAME='yes' # Selection or draw mode
SS_FRAME_COLOR='auto' #434c5e better for Mech BG # Selection or draw mode w frame
SS_FRAME_PADDING='15' # Selection or draw mode w frame
SS_FRAME_S_OPACITY='25' # Selection or draw mode w frame
SS_COUNTDOWN_SECONDS='5' # Countdown timer or delay mode
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Display brightness and audio-volume steps level options ~ Auto-load ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# AUDIO_DEVICE || Run `aplay -L` for available PCMs or leave it blank. #
# AUDIO_VOLUME_STEPS || 0-100, this is real value, without audio boost 100+. #
# ||---------------------------------------------------------#
# BRIGHTNESS_DEVICE || Run `brightnessctl -l` for available or leave it blank. #
# BRIGHTNESS_STEPS || 0-100, this is percentage of value with specific range. #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
AUDIO_DEVICE='pulse'
AUDIO_VOLUME_STEPS='5'
BRIGHTNESS_DEVICE=''
BRIGHTNESS_STEPS='5'
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Ncmpcpp album-art options ~ Auto-load ~ #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# NCMPCPP_AA_BACKEND || Details about supported image backend described below. #
# || *) Only supports 'w3m' and 'pixbuf' TE image backends. #
# || *) Both backends on `rxvt-unicode` works like a charm. #
# || *) 'pixbuf' backend is not portable, so may not works. #
# ||---------------------------------------------------------#
# NCMPCPP_AA_NICENESS || 0-19 or leave it blank, it reduces CPU% of 'w3m' loop. #
# ||---------------------------------------------------------#
# NCMPCPP_{,S}AA_LAUNC* || Override ncmpcpp and single album-art geometry pixels. #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
NCMPCPP_AA_BACKEND='w3m'
NCMPCPP_AA_NICENESS='19'
NCMPCPP_AA_LAUNCHER_GEOMETRY='84x13'
NCMPCPP_SAA_LAUNCHER_GEOMETRY='47x18'
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# The following are owl4ce/dotfiles environment variables which called in "*.sh". #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# Doesn't affect to all files. For example "*.tint2rc", "rc.xml", "schema.pl", .. #
# are use absolute path and hardcoded. The shell-scripts are executed by shebang. #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
# ATTENTION: Don't change or re-arrange these variables unless you know !!! (^w^) #
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
siq()
{
while IFS='"' read -r KEY VAL _; do
case "${KEY%%\ *}" in
"${1}") echo "$VAL"
break
;;
esac
done <"${2}"
}
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
OB_MARGIN='10'
MECH_GTK='Fleon'
EYEC_GTK='Sweetly'
MECH_ICON='Papirus-Dark-Custom'
EYEC_ICON='Papirus-Custom'
LIBS_PATH=" \
/usr/lib \
/usr/lib64 \
/usr/libexec \
/usr/libexec64 \
/usr/local/lib \
/usr/local/lib64 \
/usr/local/libexec \
/usr/local/libexec64 \
${HOME}/.nix-profile/lib \
${HOME}/.nix-profile/lib64 \
${HOME}/.nix-profile/libexec \
${HOME}/.nix-profile/libexec64 "
CONFIG_DIR="${HOME}/.config"
ICONS_DIR="${HOME}/.icons"
SCRIPTS_DIR="${HOME}/.scripts"
THEMES_DIR="${HOME}/.themes"
WALLPAPERS_DIR="${HOME}/.wallpapers"
TMP_DIR='/tmp'
DUNST_DIR="${CONFIG_DIR}/dunst"
MPD_DIR="${CONFIG_DIR}/mpd"
MPD_SCRIPTS_DIR="${MPD_DIR}/scripts"
NCMPCPP_DIR="${CONFIG_DIR}/ncmpcpp"
OB_DIR="${CONFIG_DIR}/openbox"
JOYD_DIR="${OB_DIR}/joyful-desktop"
ROFI_DIR="${CONFIG_DIR}/rofi"
ROFI_THEMES_DIR="${ROFI_DIR}/themes"
ROFI_COLORSCHEMES_DIR="${ROFI_THEMES_DIR}/colorschemes"
TINT2_DIR="${CONFIG_DIR}/tint2"
GLADIENT_ICON_DIR="${ICONS_DIR}/Gladient"
OB_BUTTON_STYLE_DIR="${THEMES_DIR}/Joyful.OBB"
MECH_OB_THEME_DIR="${THEMES_DIR}/${MECH_GTK}/openbox-3"
EYEC_OB_THEME_DIR="${THEMES_DIR}/${EYEC_GTK}/openbox-3"
GTK3_CONFIG="${CONFIG_DIR}/gtk-3.0/settings.ini"
MPD_CONFIG="${MPD_DIR}/mpd.conf"
OB_CONFIG="${OB_DIR}/rc.xml"
OB_TRAY="${OB_DIR}/tray"
MODE_FILE="${JOYD_DIR}/db.mode.joy"
THEME_FILE="${JOYD_DIR}/db.theme.joy"
ROFI_CONFIG="${ROFI_DIR}/config.rasi"
ROFI_SHARED_CONFIG="${ROFI_THEMES_DIR}/shared.rasi"
APPS_FILE="${SCRIPTS_DIR}/db.apps.joy"
GTK2_CONFIG="${HOME}/.gtkrc-2.0"
XRESOURCES_CONFIG="${HOME}/.Xresources"
CHK_MPD_PORT="$(siq 'port' "$MPD_CONFIG")"
CHK_MPD_MUSIC_DIR="$(siq 'music_directory' "$MPD_CONFIG")"
CHK_THEME="$(siq 'current_theme' "$MODE_FILE")"
CHK_MODE="$(siq 'current_mode' "$MODE_FILE")"
CHK_PANEL_ORT="$(siq 'panel_orientation.artistic' "$MODE_FILE")"
CHK_PANEL_ORT_V="$(siq 'vertical_panel.artistic' "$MODE_FILE")"
CHK_PANEL_ORT_H="$(siq 'horizontal_panel.artistic' "$MODE_FILE")"
CHK_OB_BUTTON_STYLE="$(siq "ob_button_style.${CHK_THEME}.${CHK_MODE}" "$THEME_FILE")"
CHK_OB_BUTTON_LOC="$(siq "ob_button_location.${CHK_THEME}.${CHK_MODE}" "$THEME_FILE")"
CHK_WALLPAPER="$(siq "wallpaper.${CHK_THEME}.${CHK_MODE}" "$THEME_FILE")"
CHK_WALLPAPER_DIR="${WALLPAPERS_DIR}/${CHK_THEME}"
LOGOUT_ICON="${GLADIENT_ICON_DIR}/logout.png"
MUSIC_ICON="${GLADIENT_ICON_DIR}/music.png"
SCREENSHOT_ICON="${GLADIENT_ICON_DIR}/screenshot.png"
TERMINAL_ICON="${GLADIENT_ICON_DIR}/terminal.png"
WALLPAPER_ICON="${GLADIENT_ICON_DIR}/wallpaper.png"
MPD_NOTIFY_AA_IMG="${TMP_DIR}/mpd.notify.album-art.png"
NCMPCPP_AA_IMG="${TMP_DIR}/ncmpcpp.album-art.png"
NCMPCPP_AA_PID="${NCMPCPP_AA_IMG%.*}.pid"
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-#
alias joyd_mpd_notifier='${MPD_SCRIPTS_DIR}/mpd-notifier.sh'
alias joyd_mpd_notify_albumart='${MPD_SCRIPTS_DIR}/notify.album-art.sh'
alias joyd_layout_set='${JOYD_DIR}/layout-set.sh'
alias joyd_terminal_set='${JOYD_DIR}/terminal-set.sh'
alias joyd_theme_set='${JOYD_DIR}/theme-set.sh'
alias joyd_toggle_mode='${JOYD_DIR}/toggle-mode.sh'
alias joyd_user_interface_set='${JOYD_DIR}/user-interface-set.sh'
alias joyd_launch_apps='${SCRIPTS_DIR}/launch-apps.sh'
alias joyd_music_controller='${SCRIPTS_DIR}/music-controller.sh'
alias joyd_screenshot_countdown='${SCRIPTS_DIR}/screenshot-countdown.sh'
alias joyd_screenshot_screen='${SCRIPTS_DIR}/screenshot-screen.sh'
alias joyd_screenshot_selection='${SCRIPTS_DIR}/screenshot-selection.sh'
joyd_cross_variables()
{
UCTM="$(tr '[:lower:]' '[:upper:]' <<- VAR
${CHK_THEME} ####### ${CHK_MODE}
VAR
)"
CUT4="$(printf '%.4s\n' "${UCTM%%\ #######\ *}")"
CUT3="$(printf '%.3s\n' "${UCTM##*\ #######\ }")"
eval "GTK_T=\"\$${CUT4}_GTK\"
ICON_T=\"\$${CUT4}_ICON\"
OBT_D=\"\$${CUT4}_OB_THEME_DIR\"
OBT_IT=\"\$${CUT4}_${CUT3}_OB_MENU_ITM\"
OBT_TT=\"\$${CUT4}_${CUT3}_OB_MENU_TTL\"
ROFI_A1=\"\$${CUT4}_${CUT3}_ROFI_ACCNT1\"
ROFI_A2=\"\$${CUT4}_${CUT3}_ROFI_ACCNT2\"
DUNST_FG=\"\$${CUT4}_${CUT3}_DUNST_SMMRY\"
DUNST_PB=\"\$${CUT4}_${CUT3}_DUNST_PRGBR\"
TINT2_G1=\"\$${CUT4}_${CUT3}_TINT2_GRAD1\"
TINT2_G2=\"\$${CUT4}_${CUT3}_TINT2_GRAD2\"
TINT2_SB=\"\$${CUT4}_${CUT3}_TINT2_GLYPH\""
}
joyd_gtk_live_reload()
{
[ -n "${2}" -a -x "$(command -v xsettingsd)" ] || return ${?}
{
xsettingsd -c /dev/stdin <<- CFG
Net/IconThemeName "${2}"
Net/ThemeName "${1}"
CFG
} &
{ sleep 2s; killall -9 xsettingsd -q; } &
}
joyd_tray_programs()
{
[ -n "${1}" ] || return ${?}
grep -Fv '#' "$OB_TRAY" | while IFS= read -r TRAY; do
[ -x "$(command -v "${TRAY%%\ *}")" ] || continue
case "${1}" in
exec) pidof -s "${TRAY%%\ *}" -q \
|| eval "\${TRAY} >/dev/null 2>&1 &"
;;
kill) pidof -s "${TRAY%%\ *}" -q \
&& eval "killall -9 \${TRAY%%\ *} -q &"
;;
esac
done
}
return ${?}