Skip to content

Commit 94b2b10

Browse files
committed
First step towards hypr-config
1 parent 8eed325 commit 94b2b10

34 files changed

+1846
-8
lines changed

Containerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ COPY build_files /
88
# Base Image
99
FROM ${BASE_IMAGE}
1010

11+
# Copy dot_files into the image at /usr/share/binaryos/config
12+
COPY dot_files /usr/share/binaryos/config
13+
1114
## Other possible base images include:
1215
# FROM ghcr.io/ublue-os/bazzite:latest
1316
# FROM ghcr.io/ublue-os/bluefin-dx-nvidia:stable-daily

build_files/binaryos-config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
USER_HOME=$(getent passwd "$USER" | cut -d: -f6)
6+
HYPR_CONFIG_DIR="$USER_HOME/.config/hypr"
7+
HYPR_CONFIG_FILE="$HYPR_CONFIG_DIR/hyprland.conf"
8+
DEFAULT_HYPR_CONFIG_DIR="/usr/share/binaryos/config/hypr"
9+
10+
if [ ! -f "$HYPR_CONFIG_FILE" ]; then
11+
mkdir -p "$HYPR_CONFIG_DIR"
12+
echo "source = $DEFAULT_HYPR_CONFIG_DIR/hyprland.conf" > "$HYPR_CONFIG_FILE"
13+
fi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=BinaryOS Config
3+
After=graphical-session.target
4+
PartOf=hyprland-session.target
5+
6+
[Service]
7+
Type=oneshot
8+
ExecStart=/usr/bin/binaryos-config
9+
10+
[Install]
11+
WantedBy=hyprland-session.target

build_files/build.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,43 @@ set -ouex pipefail
99
# List of rpmfusion packages can be found here:
1010
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1
1111

12-
# hyprland COPR from solopasha
12+
# Compositor / Hyprland Utilities
1313
dnf5 -y copr enable solopasha/hyprland
14-
dnf5 -y install xdg-desktop-portal-hyprland hyprland hyprland-contrib hyprland-plugins hyprpaper hyprpicker hypridle hyprshot hyprlock pyprland waybar-git xdg-desktop-portal-hyprland hyprland-qtutils
14+
dnf5 -y install xdg-desktop-portal-hyprland hyprland hyprland-contrib hyprland-plugins hyprpaper hyprpicker hypridle hyprshot hyprlock pyprland xdg-desktop-portal-hyprland hyprland-qtutils
1515

16-
# Walker
16+
# Remove extra things
17+
# TODO: Figure out what we don't need from solopasha/hyprland
18+
#
19+
# GUI Shell
20+
dnf5 -y copr enable killcrb/ashell
21+
dnf5 -y install ashell
22+
23+
# Application Launcher
1724
dnf5 -y copr enable errornointernet/walker
1825
dnf5 -y install walker
1926
dnf5 -y install elephant
2027

21-
# swayosd
28+
# On Screen Display
2229
dnf5 -y copr enable markupstart/SwayOSD
2330
dnf5 -y install swayosd
2431

25-
# other related packages found in main Fedora repos:
26-
dnf5 -y install mako swaybg
32+
# Desktop Notifications
33+
dnf5 -y install mako
34+
systemctl --global mask mako.service
2735

28-
# Wezterm
36+
# Terminal
2937
dnf5 -y copr enable wezfurlong/wezterm-nightly
3038
dnf5 -y install wezterm
3139

32-
# Neovim
40+
# Editor
3341
dnf5 -y copr enable agriffis/neovim-nightly
3442
dnf5 -y install neovim python3-neovim
3543

44+
# Install binaryos config setup script and service
45+
install -Dm755 /ctx/binaryos-config /usr/bin/binaryos-config
46+
install -Dm644 /ctx/binaryos-config.service /usr/lib/systemd/user/binaryos-config.service
47+
48+
# Enable hyprland config setup service
49+
systemctl --global enable binaryos-config.service
50+
3651
# systemctl enable podman.socket

dot_files/fish/conf.d/hydro.fish

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
status is-interactive || exit
2+
3+
set --global _hydro_git _hydro_git_$fish_pid
4+
5+
function $_hydro_git --on-variable $_hydro_git
6+
commandline --function repaint
7+
end
8+
9+
function _hydro_pwd --on-variable PWD --on-variable hydro_ignored_git_paths --on-variable fish_prompt_pwd_dir_length
10+
set --local git_root (command git --no-optional-locks rev-parse --show-toplevel 2>/dev/null)
11+
set --local git_base (string replace --all --regex -- "^.*/" "" "$git_root")
12+
set --local path_sep /
13+
14+
test "$fish_prompt_pwd_dir_length" = 0 && set path_sep
15+
16+
if set --query git_root[1] && ! contains -- $git_root $hydro_ignored_git_paths
17+
set --erase _hydro_skip_git_prompt
18+
else
19+
set --global _hydro_skip_git_prompt
20+
end
21+
22+
set --global _hydro_pwd (
23+
string replace --ignore-case -- ~ \~ $PWD |
24+
string replace -- "/$git_base/" /:/ |
25+
string replace --regex --all -- "(\.?[^/]{"(
26+
string replace --regex --all -- '^$' 1 "$fish_prompt_pwd_dir_length"
27+
)"})[^/]*/" "\$1$path_sep" |
28+
string replace -- : "$git_base" |
29+
string replace --regex -- '([^/]+)$' "\x1b[1m\$1\x1b[22m" |
30+
string replace --regex --all -- '(?!^/$)/|^$' "\x1b[2m/\x1b[22m"
31+
)
32+
end
33+
34+
function _hydro_postexec --on-event fish_postexec
35+
set --local last_status $pipestatus
36+
set --global _hydro_status "$_hydro_newline$_hydro_color_prompt$hydro_symbol_prompt"
37+
38+
for code in $last_status
39+
if test $code -ne 0
40+
set --global _hydro_status "$_hydro_color_error| "(echo $last_status)" $_hydro_newline$_hydro_color_prompt$_hydro_color_error$hydro_symbol_prompt"
41+
break
42+
end
43+
end
44+
45+
test "$CMD_DURATION" -lt $hydro_cmd_duration_threshold && set _hydro_cmd_duration && return
46+
47+
set --local secs (math --scale=1 $CMD_DURATION/1000 % 60)
48+
set --local mins (math --scale=0 $CMD_DURATION/60000 % 60)
49+
set --local hours (math --scale=0 $CMD_DURATION/3600000)
50+
51+
set --local out
52+
53+
test $hours -gt 0 && set --local --append out $hours"h"
54+
test $mins -gt 0 && set --local --append out $mins"m"
55+
test $secs -gt 0 && set --local --append out $secs"s"
56+
57+
set --global _hydro_cmd_duration "$out "
58+
end
59+
60+
function _hydro_prompt --on-event fish_prompt
61+
set --query _hydro_status || set --global _hydro_status "$_hydro_newline$_hydro_color_prompt$hydro_symbol_prompt"
62+
set --query _hydro_pwd || _hydro_pwd
63+
64+
command kill $_hydro_last_pid 2>/dev/null
65+
66+
set --query _hydro_skip_git_prompt && set $_hydro_git && return
67+
68+
fish --private --command "
69+
set branch (
70+
command git symbolic-ref --short HEAD 2>/dev/null ||
71+
command git describe --tags --exact-match HEAD 2>/dev/null ||
72+
command git rev-parse --short HEAD 2>/dev/null |
73+
string replace --regex -- '(.+)' '@\$1'
74+
)
75+
76+
test -z \"\$$_hydro_git\" && set --universal $_hydro_git \"\$branch \"
77+
78+
! command git diff-index --quiet HEAD 2>/dev/null ||
79+
count (command git ls-files --others --exclude-standard) >/dev/null && set info \"$hydro_symbol_git_dirty\"
80+
81+
for fetch in $hydro_fetch false
82+
command git rev-list --count --left-right @{upstream}...@ 2>/dev/null |
83+
read behind ahead
84+
85+
switch \"\$behind \$ahead\"
86+
case \" \" \"0 0\"
87+
case \"0 *\"
88+
set upstream \" $hydro_symbol_git_ahead\$ahead\"
89+
case \"* 0\"
90+
set upstream \" $hydro_symbol_git_behind\$behind\"
91+
case \*
92+
set upstream \" $hydro_symbol_git_ahead\$ahead $hydro_symbol_git_behind\$behind\"
93+
end
94+
95+
set --universal $_hydro_git \"\$branch\$info\$upstream \"
96+
97+
test \$fetch = true && command git fetch --no-tags 2>/dev/null
98+
end
99+
" &
100+
101+
set --global _hydro_last_pid $last_pid
102+
end
103+
104+
function _hydro_fish_exit --on-event fish_exit
105+
set --erase $_hydro_git
106+
end
107+
108+
function _hydro_uninstall --on-event hydro_uninstall
109+
set --names |
110+
string replace --filter --regex -- "^(_?hydro_)" "set --erase \$1" |
111+
source
112+
functions --erase (functions --all | string match --entire --regex "^_?hydro_")
113+
end
114+
115+
set --global hydro_color_normal (set_color normal)
116+
117+
for color in hydro_color_{pwd,git,error,prompt,duration}
118+
function $color --on-variable $color --inherit-variable color
119+
set --query $color && set --global _$color (set_color $$color)
120+
end && $color
121+
end
122+
123+
function hydro_multiline --on-variable hydro_multiline
124+
if test "$hydro_multiline" = true
125+
set --global _hydro_newline "\n"
126+
else
127+
set --global _hydro_newline ""
128+
end
129+
end && hydro_multiline
130+
131+
set --query hydro_color_error || set --global hydro_color_error $fish_color_error
132+
set --query hydro_symbol_prompt || set --global hydro_symbol_prompt ❱
133+
set --query hydro_symbol_git_dirty || set --global hydro_symbol_git_dirty •
134+
set --query hydro_symbol_git_ahead || set --global hydro_symbol_git_ahead ↑
135+
set --query hydro_symbol_git_behind || set --global hydro_symbol_git_behind ↓
136+
set --query hydro_multiline || set --global hydro_multiline false
137+
set --query hydro_cmd_duration_threshold || set --global hydro_cmd_duration_threshold 1000

dot_files/fish/conf.d/rustup.fish

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "$HOME/.cargo/env.fish"

dot_files/fish/config.fish

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
if status is-interactive
2+
# Commands to run in interactive sessions can go here
3+
4+
# VIM Mode
5+
fish_vi_key_bindings
6+
7+
# Editor
8+
set -gx EDITOR nvim
9+
10+
# Prompt
11+
set --global hydro_multiline true
12+
set --global fish_prompt_pwd_dir_length 100
13+
set --global hydro_color_pwd $fish_color_comment
14+
set --global hydro_color_git $fish_color_operator
15+
set --global hydro_color_error $fish_color_error
16+
set --global hydro_color_prompt $fish_color_command
17+
set --global hydro_color_duration $fish_color_param
18+
19+
# Env Variables
20+
set -Ux GOOGLE_CLOUD_PROJECT ibexio-src
21+
22+
# Path
23+
fish_add_path $HOME/.local/bin
24+
fish_add_path $HOME/.npm-packages/bin
25+
fish_add_path $HOME/.cargo/bin
26+
fish_add_path $HOME/Code/flutter/bin
27+
fish_add_path $HOME/go/bin
28+
29+
# Alias
30+
alias wezterm 'flatpak run org.wezfurlong.wezterm'
31+
end
32+
33+
### bling.fish source start
34+
test -f /usr/share/ublue-os/bluefin-cli/bling.fish && source /usr/share/ublue-os/bluefin-cli/bling.fish
35+
### bling.fish source end

dot_files/fish/fish_variables

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# This file contains fish universal variable definitions.
2+
# VERSION: 3.0
3+
SETUVAR --export EXA_STANDARD_OPTIONS:\x2d\x2dgroup\x1e\x2d\x2dheader\x1e\x2d\x2dgroup\x2ddirectories\x2dfirst\x1e\x2d\x2dicons
4+
SETUVAR --export GOOGLE_CLOUD_PROJECT:ibexio\x2dsrc
5+
SETUVAR __fish_initialized:3800
6+
SETUVAR _hydro_git_1088236:charles\x2dsup\x2d743\x20
7+
SETUVAR _hydro_git_1088826:charles\x2dsup\x2d743\x20
8+
SETUVAR _hydro_git_1090793:charles\x2dsup\x2d743\x20
9+
SETUVAR _hydro_git_11278:charles\x2dsrv\x2d449\u2022\x20
10+
SETUVAR _hydro_git_11288:onboard\x20
11+
SETUVAR _hydro_git_11462:onboard\x20
12+
SETUVAR _hydro_git_121214:charles\x2deng\x2d15\x20
13+
SETUVAR _hydro_git_1602414:charles\x2ddevpod\u2022\x20
14+
SETUVAR _hydro_git_1991287:charles\x2dsup\x2d598\u2022\x20
15+
SETUVAR _hydro_git_222390:charles\x2deng\x2d230\x20
16+
SETUVAR _hydro_git_264321:charles\x2deng\x2d230\u2022\x20
17+
SETUVAR _hydro_git_264428:charles\x2deng\x2d230\u2022\x20
18+
SETUVAR _hydro_git_264643:client\x2dimport\x2dfamily\x20
19+
SETUVAR _hydro_git_27695:charles\x2deng\x2d148\u2022\x20\u21914\x20
20+
SETUVAR _hydro_git_2809224:charles\x2ddevpod\x20
21+
SETUVAR _hydro_git_293996:main\u2022\x20
22+
SETUVAR _hydro_git_294696:main\u2022\x20
23+
SETUVAR _hydro_git_301432:main\x20
24+
SETUVAR _hydro_git_3076414:onboarding\x20
25+
SETUVAR _hydro_git_3115435:onboarding\x20
26+
SETUVAR _hydro_git_31341:charles\x2dsrv\x2d332\x20
27+
SETUVAR _hydro_git_3179190:onboard\u2022\x20
28+
SETUVAR _hydro_git_3188953:onboard\u2022\x20
29+
SETUVAR _hydro_git_3223428:onboard\u2022\x20
30+
SETUVAR _hydro_git_3223609:onboard\u2022\x20
31+
SETUVAR _hydro_git_3223793:onboard\u2022\x20
32+
SETUVAR _hydro_git_3270698:onboard\u2022\x20
33+
SETUVAR _hydro_git_3310547:ai\x2dclient\x2dmatching\u2022\x20
34+
SETUVAR _hydro_git_33114:charles\x2deng\x2d133\u2022\x20
35+
SETUVAR _hydro_git_3347834:\x1d
36+
SETUVAR _hydro_git_343422:main\u2022\x20
37+
SETUVAR _hydro_git_34638:charles\x2deng\x2d133\x20
38+
SETUVAR _hydro_git_34984:ai\x2dcoach\x2dmatching\u2022\x20
39+
SETUVAR _hydro_git_3622049:onboarding\x20
40+
SETUVAR _hydro_git_3743035:onboard\u2022\x20
41+
SETUVAR _hydro_git_3850354:\x1d
42+
SETUVAR _hydro_git_4026738:charles\x2ddev\x2dbashrc\u2022\x20
43+
SETUVAR _hydro_git_4107649:charles\x2dsrv\x2d256\u2022\x20
44+
SETUVAR _hydro_git_4145898:charles\x2dsrv\x2d256\u2022\x20
45+
SETUVAR _hydro_git_4150144:charles\x2dsrv\x2d256\u2022\x20
46+
SETUVAR _hydro_git_4164312:charles\x2dsrv\x2d256\u2022\x20
47+
SETUVAR _hydro_git_43562:ai\x2dcoach\x2dmatching\u2022\x20
48+
SETUVAR _hydro_git_43801:ai\x2dcoach\x2dmatching\u2022\x20
49+
SETUVAR _hydro_git_44056:ai\x2dcoach\x2dmatching\x20
50+
SETUVAR _hydro_git_441742:charles\x2deng\x2d15b\u2022\x20
51+
SETUVAR _hydro_git_455034:charles\x2deng\x2d15b\u2022\x20
52+
SETUVAR _hydro_git_470026:qbo\x20
53+
SETUVAR _hydro_git_724865:charles\x2dsrv\x2d449\u2022\x20
54+
SETUVAR _hydro_git_725109:charles\x2dsrv\x2d449\u2022\x20
55+
SETUVAR _hydro_git_725293:charles\x2dsrv\x2d449\u2022\x20
56+
SETUVAR _hydro_git_8132:master\x20
57+
SETUVAR _hydro_git_9213:onboard\x20
58+
SETUVAR fish_color_autosuggestion:brblack
59+
SETUVAR fish_color_cancel:\x2dr
60+
SETUVAR fish_color_command:blue
61+
SETUVAR fish_color_comment:red
62+
SETUVAR fish_color_cwd:green
63+
SETUVAR fish_color_cwd_root:red
64+
SETUVAR fish_color_end:green
65+
SETUVAR fish_color_error:brred
66+
SETUVAR fish_color_escape:brcyan
67+
SETUVAR fish_color_history_current:\x2d\x2dbold
68+
SETUVAR fish_color_host:normal
69+
SETUVAR fish_color_host_remote:yellow
70+
SETUVAR fish_color_normal:normal
71+
SETUVAR fish_color_operator:brcyan
72+
SETUVAR fish_color_param:cyan
73+
SETUVAR fish_color_quote:yellow
74+
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
75+
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
76+
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
77+
SETUVAR fish_color_status:red
78+
SETUVAR fish_color_user:brgreen
79+
SETUVAR fish_color_valid_path:\x2d\x2dunderline
80+
SETUVAR fish_key_bindings:fish_vi_key_bindings
81+
SETUVAR fish_pager_color_completion:normal
82+
SETUVAR fish_pager_color_description:yellow\x1e\x2di
83+
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
84+
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
85+
SETUVAR fish_pager_color_selected_background:\x2dr
86+
SETUVAR fish_user_paths:/var/home/binarypie/Code/flutter/bin\x1e/var/home/binarypie/\x2ecargo/bin\x1e/var/home/binarypie/\x2elocal/bin

dot_files/fish/fishd.tmp.ehcEoz

Whitespace-only changes.

dot_files/gitui/key_bindings.ron

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Note:
2+
// If the default key layout is lower case,
3+
// and you want to use `Shift + q` to trigger the exit event,
4+
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: "SHIFT")),`
5+
// The Char should be upper case, and the modifier should be set to "SHIFT".
6+
//
7+
// Note:
8+
// find `KeysList` type in src/keys/key_list.rs for all possible keys.
9+
// every key not overwritten via the config file will use the default specified there
10+
(
11+
open_help: Some(( code: F(1), modifiers: "")),
12+
13+
move_left: Some(( code: Char('h'), modifiers: "")),
14+
move_right: Some(( code: Char('l'), modifiers: "")),
15+
move_up: Some(( code: Char('k'), modifiers: "")),
16+
move_down: Some(( code: Char('j'), modifiers: "")),
17+
18+
popup_up: Some(( code: Char('p'), modifiers: "CONTROL")),
19+
popup_down: Some(( code: Char('n'), modifiers: "CONTROL")),
20+
page_up: Some(( code: Char('b'), modifiers: "CONTROL")),
21+
page_down: Some(( code: Char('f'), modifiers: "CONTROL")),
22+
home: Some(( code: Char('g'), modifiers: "")),
23+
end: Some(( code: Char('G'), modifiers: "SHIFT")),
24+
shift_up: Some(( code: Char('K'), modifiers: "SHIFT")),
25+
shift_down: Some(( code: Char('J'), modifiers: "SHIFT")),
26+
27+
edit_file: Some(( code: Char('I'), modifiers: "SHIFT")),
28+
29+
status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")),
30+
31+
diff_reset_lines: Some(( code: Char('u'), modifiers: "")),
32+
diff_stage_lines: Some(( code: Char('s'), modifiers: "")),
33+
34+
stashing_save: Some(( code: Char('w'), modifiers: "")),
35+
stashing_toggle_index: Some(( code: Char('m'), modifiers: "")),
36+
37+
stash_open: Some(( code: Char('l'), modifiers: "")),
38+
39+
abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")),
40+
)

0 commit comments

Comments
 (0)