Compare commits
7
Commits
58f70553b8
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fb8d3dfee | ||
|
|
1038662ee1 | ||
|
|
233ca9e7fd | ||
|
|
4e92d7a755 | ||
|
|
9fbe6646be | ||
|
|
a640b0d742 | ||
|
|
dbd9880ddd |
+498
-5
@@ -8,7 +8,7 @@
|
||||
"all"
|
||||
],
|
||||
"showOnLastDisplay": true,
|
||||
"position": 1,
|
||||
"position": 2,
|
||||
"mode": "compact",
|
||||
"taskbarAlign": "center",
|
||||
"widgetExpansion": "popout",
|
||||
@@ -82,6 +82,136 @@
|
||||
"all"
|
||||
],
|
||||
"showOnLastDisplay": true,
|
||||
"leftWidgets": [
|
||||
{
|
||||
"id": "launcherButton",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "workspaceSwitcher",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "focusedWindow",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"centerWidgets": [
|
||||
"music",
|
||||
"clock",
|
||||
"weather"
|
||||
],
|
||||
"rightWidgets": [
|
||||
{
|
||||
"id": "systemTray",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "vpn",
|
||||
"enabled": true
|
||||
},
|
||||
"keyboard_layout_name",
|
||||
"clipboard",
|
||||
"cpuUsage",
|
||||
"memUsage",
|
||||
"notificationButton",
|
||||
{
|
||||
"id": "battery",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "controlCenterButton",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"spacing": 4,
|
||||
"innerPadding": 4,
|
||||
"bottomGap": 0,
|
||||
"transparency": 1,
|
||||
"widgetTransparency": 1,
|
||||
"squareCorners": false,
|
||||
"noBackground": false,
|
||||
"gothCornersEnabled": false,
|
||||
"gothCornerRadiusOverride": false,
|
||||
"gothCornerRadiusValue": 12,
|
||||
"borderEnabled": false,
|
||||
"borderColor": "surfaceText",
|
||||
"borderOpacity": 1,
|
||||
"borderThickness": 1,
|
||||
"fontScale": 1,
|
||||
"autoHide": false,
|
||||
"autoHideDelay": 250,
|
||||
"openOnOverview": false,
|
||||
"visible": true,
|
||||
"popupGapsAuto": true,
|
||||
"popupGapsManual": 4,
|
||||
"followInterfaceStyle": true,
|
||||
"widgetFollowInterfaceStyle": true,
|
||||
"dot": false,
|
||||
"island": true,
|
||||
"islandFloating": false,
|
||||
"islandPlacement": "free",
|
||||
"islandOuterGap": 0,
|
||||
"islandAlongOffset": 0,
|
||||
"islandReserveThickness": 41,
|
||||
"islandRouteLauncher": "follow",
|
||||
"islandRouteControlCenter": "follow",
|
||||
"islandInteractionMode": "hybrid",
|
||||
"islandChargingPulse": true,
|
||||
"hoverPopouts": false,
|
||||
"hoverPopoutDelay": 200,
|
||||
"islandHomeLayout": [
|
||||
{
|
||||
"id": "workspaces",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "media",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "clock",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "weather",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "status",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "volume",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "brightness",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "notifications",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "privacy",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": "tray",
|
||||
"enabled": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bar1793185825664",
|
||||
"name": "Bar 2",
|
||||
"enabled": false,
|
||||
"position": 1,
|
||||
"screenPreferences": [
|
||||
"all"
|
||||
],
|
||||
"showOnLastDisplay": true,
|
||||
"leftWidgets": [
|
||||
"launcherButton",
|
||||
"workspaceSwitcher",
|
||||
@@ -127,7 +257,88 @@
|
||||
"popupGapsAuto": true,
|
||||
"popupGapsManual": 4,
|
||||
"followInterfaceStyle": true,
|
||||
"widgetFollowInterfaceStyle": true
|
||||
"widgetFollowInterfaceStyle": true,
|
||||
"islandFloating": false,
|
||||
"islandPlacement": "free",
|
||||
"islandOuterGap": 0,
|
||||
"islandAlongOffset": 0,
|
||||
"islandReserveThickness": 41,
|
||||
"islandRouteLauncher": "follow",
|
||||
"islandRouteControlCenter": "follow",
|
||||
"islandInteractionMode": "hybrid",
|
||||
"islandChargingPulse": true,
|
||||
"hoverPopouts": false,
|
||||
"hoverPopoutDelay": 200,
|
||||
"hideOnLastDisplay": false
|
||||
},
|
||||
{
|
||||
"id": "dot1793185921302",
|
||||
"name": "Dot",
|
||||
"enabled": false,
|
||||
"position": 0,
|
||||
"screenPreferences": [
|
||||
"all"
|
||||
],
|
||||
"showOnLastDisplay": true,
|
||||
"leftWidgets": [
|
||||
"launcherButton",
|
||||
"workspaceSwitcher",
|
||||
"focusedWindow"
|
||||
],
|
||||
"centerWidgets": [
|
||||
"music",
|
||||
"clock",
|
||||
"weather"
|
||||
],
|
||||
"rightWidgets": [
|
||||
"systemTray",
|
||||
"privacyIndicator",
|
||||
"vpn",
|
||||
"keyboard_layout_name",
|
||||
"clipboard",
|
||||
"cpuUsage",
|
||||
"cpuTemp",
|
||||
"memUsage",
|
||||
"notificationButton",
|
||||
"battery",
|
||||
"controlCenterButton"
|
||||
],
|
||||
"spacing": 4,
|
||||
"innerPadding": 4,
|
||||
"bottomGap": 0,
|
||||
"transparency": 0.95,
|
||||
"widgetTransparency": 1,
|
||||
"squareCorners": false,
|
||||
"noBackground": false,
|
||||
"gothCornersEnabled": false,
|
||||
"gothCornerRadiusOverride": false,
|
||||
"gothCornerRadiusValue": 12,
|
||||
"borderEnabled": false,
|
||||
"borderColor": "surfaceText",
|
||||
"borderOpacity": 1,
|
||||
"borderThickness": 1,
|
||||
"fontScale": 1,
|
||||
"autoHide": false,
|
||||
"autoHideDelay": 250,
|
||||
"openOnOverview": false,
|
||||
"visible": true,
|
||||
"popupGapsAuto": true,
|
||||
"popupGapsManual": 4,
|
||||
"followInterfaceStyle": false,
|
||||
"widgetFollowInterfaceStyle": true,
|
||||
"dot": true,
|
||||
"island": false,
|
||||
"islandFloating": false,
|
||||
"islandPlacement": "free",
|
||||
"islandOuterGap": 0,
|
||||
"islandAlongOffset": 0,
|
||||
"islandReserveThickness": 41,
|
||||
"islandRouteLauncher": "follow",
|
||||
"islandRouteControlCenter": "follow",
|
||||
"islandInteractionMode": "hybrid",
|
||||
"islandChargingPulse": true,
|
||||
"hoverPopouts": false,
|
||||
"hoverPopoutDelay": 200
|
||||
}
|
||||
],
|
||||
"configVersion": 42,
|
||||
@@ -135,8 +346,11 @@
|
||||
"fontFamily": "JetBrains Mono Medium",
|
||||
"audioVisualizerEnabled": true,
|
||||
"scrollTitleEnabled": true,
|
||||
"dashOptions": {},
|
||||
"batteryChargeLimit": 80,
|
||||
"dashOptions": {
|
||||
"wallpaper": {
|
||||
"panelColumns": 5
|
||||
}
|
||||
},
|
||||
"controlCenterColumns": 9,
|
||||
"controlCenterWidgets": [
|
||||
{
|
||||
@@ -269,5 +483,284 @@
|
||||
"monoFontFamily": "JetBrains Mono",
|
||||
"displayFontFamily": "JetBrains Mono",
|
||||
"fontWeight": 300,
|
||||
"fontScale": 1
|
||||
"fontScale": 1,
|
||||
"currentThemeName": "pink",
|
||||
"wallpaperFillMode": "Fill",
|
||||
"connectedFrameBarStyleBackups": {},
|
||||
"frameEnabled": false,
|
||||
"dashCards": [
|
||||
{
|
||||
"id": "clock",
|
||||
"w": 2,
|
||||
"h": 1,
|
||||
"col": 0,
|
||||
"row": 0
|
||||
},
|
||||
{
|
||||
"id": "weather",
|
||||
"w": 1,
|
||||
"h": 1,
|
||||
"col": 2,
|
||||
"row": 0
|
||||
},
|
||||
{
|
||||
"id": "notifications",
|
||||
"w": 3,
|
||||
"h": 5,
|
||||
"col": 3,
|
||||
"row": 0
|
||||
},
|
||||
{
|
||||
"id": "calendar",
|
||||
"w": 3,
|
||||
"h": 3,
|
||||
"col": 0,
|
||||
"row": 1
|
||||
},
|
||||
{
|
||||
"id": "media",
|
||||
"w": 3,
|
||||
"h": 1,
|
||||
"col": 0,
|
||||
"row": 4
|
||||
}
|
||||
],
|
||||
"builtInPluginSettings": {
|
||||
"dms_qr_generator": {
|
||||
"trigger": "qrg"
|
||||
},
|
||||
"dms_power": {
|
||||
"trigger": "pw"
|
||||
},
|
||||
"dms_clipboard_search": {
|
||||
"trigger": "cb"
|
||||
},
|
||||
"dms_settings_search": {
|
||||
"trigger": "?"
|
||||
}
|
||||
},
|
||||
"launcherStyle": "island",
|
||||
"dankLauncherV2Size": "compact",
|
||||
"appLauncherGridColumns": 4,
|
||||
"spotlightSectionViewModes": {
|
||||
"apps": "grid"
|
||||
},
|
||||
"dankLauncherV2BorderEnabled": false,
|
||||
"dankLauncherV2BorderThickness": 5,
|
||||
"dankLauncherV2BorderColor": "surfaceText",
|
||||
"rememberLastQuery": true,
|
||||
"bluetoothMprisEnabled": true,
|
||||
"dashTabs": [
|
||||
{
|
||||
"id": "wallpaper",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "overview",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "media",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "weather",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "wellbeing",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": "notifications",
|
||||
"enabled": false
|
||||
}
|
||||
],
|
||||
"desktopWidgetInstances": [],
|
||||
"notificationPopupPosition": -1,
|
||||
"notificationFocusedMonitor": false,
|
||||
"notificationOverlayEnabled": true,
|
||||
"notificationCompactMode": false,
|
||||
"osdPosition": 5,
|
||||
"networkPreference": "auto",
|
||||
"avatarRing": "none",
|
||||
"lockScreenWidgetInstances": [
|
||||
{
|
||||
"id": "lock_clock",
|
||||
"widgetType": "desktopClock",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"style": "expressive",
|
||||
"transparency": 0,
|
||||
"weight": 0,
|
||||
"twoTone": true,
|
||||
"showDate": false,
|
||||
"showDigitalSeconds": false,
|
||||
"showAnalogNumbers": false,
|
||||
"showAnalogSeconds": true,
|
||||
"autoPosition": true,
|
||||
"colorMode": "default",
|
||||
"customColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_date",
|
||||
"widgetType": "lockDate",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"format": "short",
|
||||
"colorMode": "default",
|
||||
"customColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_auth",
|
||||
"widgetType": "lockAuth",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"style": "expressive",
|
||||
"profileVisibility": "always",
|
||||
"passwordVisibility": "always"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_notifications",
|
||||
"widgetType": "lockNotifications",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"mode": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_status",
|
||||
"widgetType": "lockStatus",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"showMediaPlayer": true,
|
||||
"showWeather": true,
|
||||
"background": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_power",
|
||||
"widgetType": "lockPower",
|
||||
"enabled": false,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"shape": "round"
|
||||
}
|
||||
}
|
||||
],
|
||||
"greeterWidgetInstances": [
|
||||
{
|
||||
"id": "lock_clock",
|
||||
"widgetType": "desktopClock",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"style": "expressive",
|
||||
"transparency": 0,
|
||||
"weight": 0,
|
||||
"twoTone": true,
|
||||
"showDate": false,
|
||||
"showDigitalSeconds": false,
|
||||
"showAnalogNumbers": false,
|
||||
"showAnalogSeconds": true,
|
||||
"autoPosition": true,
|
||||
"colorMode": "default",
|
||||
"customColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_date",
|
||||
"widgetType": "lockDate",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"format": "short",
|
||||
"colorMode": "default",
|
||||
"customColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_auth",
|
||||
"widgetType": "lockAuth",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"style": "expressive",
|
||||
"profileVisibility": "always",
|
||||
"passwordVisibility": "always"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_status",
|
||||
"widgetType": "lockStatus",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"showMediaPlayer": true,
|
||||
"showWeather": true,
|
||||
"background": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "lock_power",
|
||||
"widgetType": "lockPower",
|
||||
"enabled": false,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true,
|
||||
"shape": "round"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "greeter_session",
|
||||
"widgetType": "greeterSession",
|
||||
"enabled": true,
|
||||
"config": {
|
||||
"displayPreferences": [
|
||||
"all"
|
||||
],
|
||||
"syncPositionAcrossScreens": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -99,19 +99,23 @@ color7 #a9b1d6
|
||||
color15 #c0caf5
|
||||
|
||||
# ---------- Shortcuts ----------
|
||||
# Plain Ctrl+C / Ctrl+V: Ctrl+C copies when text is selected, otherwise it is the usual interrupt (SIGINT)
|
||||
map ctrl+c copy_or_interrupt
|
||||
map ctrl+v paste_from_clipboard
|
||||
map ctrl+shift+t new_tab_with_cwd
|
||||
map ctrl+shift+enter launch --location=vsplit --cwd=current
|
||||
map ctrl+alt+enter launch --location=hsplit --cwd=current
|
||||
map ctrl+shift+left neighboring_window left
|
||||
map ctrl+shift+right neighboring_window right
|
||||
map ctrl+shift+up neighboring_window up
|
||||
map ctrl+shift+down neighboring_window down
|
||||
# Tabs: Ctrl+Shift+Left/Right (kitty default). Splits: Ctrl+Alt+arrows
|
||||
map ctrl+shift+left previous_tab
|
||||
map ctrl+shift+right next_tab
|
||||
map ctrl+alt+left neighboring_window left
|
||||
map ctrl+alt+right neighboring_window right
|
||||
map ctrl+alt+up neighboring_window up
|
||||
map ctrl+alt+down neighboring_window down
|
||||
map ctrl+shift+z toggle_layout stack
|
||||
map ctrl+shift+equal change_font_size current +1.0
|
||||
map ctrl+shift+minus change_font_size current -1.0
|
||||
map ctrl+shift+0 change_font_size current 0
|
||||
map ctrl+shift+alt+left previous_tab
|
||||
map ctrl+shift+alt+right next_tab
|
||||
map ctrl+shift+f show_scrollback
|
||||
map ctrl+shift+o kitten hints --type path --program -
|
||||
map ctrl+shift+e kitten hints --type url
|
||||
|
||||
+1
-4
@@ -216,9 +216,6 @@ include ~/.config/sway/config.d/*.conf
|
||||
|
||||
|
||||
|
||||
input "type:keyboard" {
|
||||
xkb_layout "us,ru"
|
||||
xkb_options "grp:alt_shift_toggle,grp_led:scroll"
|
||||
}
|
||||
# Keyboard, touchpad: see config.d/07-input.conf
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Mouse sensitivity: -1 (slowest) .. 1 (fastest), 0 is default. Touchpad is set in 10-appearance.conf
|
||||
input type:pointer {
|
||||
pointer_accel -0.5
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
# Input devices: edit freely. install.sh --layouts "us,de" rewrites the keyboard line.
|
||||
# Keep a Latin layout FIRST: the hotkeys are bound with --to-code and work on the other layouts too.
|
||||
input "type:keyboard" {
|
||||
xkb_layout "us,ru"
|
||||
xkb_options "grp:alt_shift_toggle,grp_led:scroll"
|
||||
}
|
||||
|
||||
input type:touchpad {
|
||||
tap enabled
|
||||
tap_button_map lrm
|
||||
natural_scroll enabled
|
||||
dwt enabled
|
||||
middle_emulation enabled
|
||||
}
|
||||
|
||||
# Mouse / touchpad speed (-1 slowest .. 1 fastest) goes into your own config.d/99-personal.conf
|
||||
@@ -32,14 +32,6 @@ exec_always sh -c 'pkill -x nm-applet; exec nm-applet --indicator'
|
||||
bindsym --to-code $mod+Shift+x exec ~/.config/sway/lock.sh
|
||||
|
||||
# Touchpad
|
||||
input type:touchpad {
|
||||
tap enabled
|
||||
tap_button_map lrm
|
||||
natural_scroll enabled
|
||||
dwt enabled
|
||||
middle_emulation enabled
|
||||
pointer_accel 0.3
|
||||
}
|
||||
|
||||
# Window rules
|
||||
for_window [app_id="pavucontrol|nm-connection-editor|blueman-manager"] floating enable, resize set 700 500, border pixel 2
|
||||
|
||||
@@ -29,6 +29,7 @@ for_window [app_id="firefox"] inhibit_idle fullscreen
|
||||
for_window [app_id="mpv"] floating enable, dim_inactive 0
|
||||
|
||||
# Rice helpers
|
||||
bindsym --to-code $mod+o exec nautilus --new-window
|
||||
bindsym --to-code $mod+F1 exec ~/.config/sway/cheatsheet.sh
|
||||
# Performance mode: toggle blur + shadows
|
||||
bindsym --to-code $mod+Shift+b blur toggle; shadows toggle
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# DankMaterialShell: bar, launcher, control center, notifications (replaces waybar/swaync/rofi launcher)
|
||||
exec_always sh -c 'pgrep -x dms >/dev/null || exec dms run'
|
||||
|
||||
# First login on a new machine: wallpaper + monitor layout (does nothing when already set up)
|
||||
exec ~/.config/sway/firstrun.sh
|
||||
|
||||
# Hotkeys: $mod+d launcher, $mod+n control center, $mod+Shift+n notifications, $mod+Shift+p power menu (set in config / config.d)
|
||||
bindsym --to-code $mod+Shift+v exec dms ipc call clipboard toggle
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Autostart (xdg-autostart does not run under sway). Delayed so the DMS tray is ready; guarded against duplicates.
|
||||
exec sh -c 'sleep 5; pgrep -f "[n]extcloud.*--background" >/dev/null || flatpak run com.nextcloud.desktopclient.nextcloud --background'
|
||||
exec sh -c 'sleep 5; pgrep -f "[R]emmina.* -i" >/dev/null || flatpak run org.remmina.Remmina -i'
|
||||
exec sh -c 'sleep 8; pgrep -x geary >/dev/null || geary --gapplication-service'
|
||||
+12
-6
@@ -22,6 +22,10 @@ if have dms; then
|
||||
pgrep -x dms >/dev/null && ok "dms is running" || { [ -n "${SWAYSOCK:-}" ] && bad "dms is not running" || warn "dms not running (not in session)"; }
|
||||
else bad "dms not installed"; fi
|
||||
[ -f "$CFG/dms/settings.json" ] && ok "DMS settings present" || warn "no DMS settings yet"
|
||||
if have dms && pgrep -x dms >/dev/null; then
|
||||
w=$(dms ipc call wallpaper get 2>/dev/null | head -1)
|
||||
case $w in /*) ok "wallpaper set in DMS ($(basename "$w"))";; *) warn "no wallpaper chosen in DMS yet (firstrun.sh sets one at the next sway start)";; esac
|
||||
fi
|
||||
|
||||
section "Session / portals"
|
||||
if systemctl --user is-active sway-session.target >/dev/null 2>&1; then ok "sway-session.target active"
|
||||
@@ -37,16 +41,18 @@ fc-list 2>/dev/null | grep -qi "JetBrains Mono" && ok "JetBrains Mono" || bad "J
|
||||
fc-list 2>/dev/null | grep -qiE "Font ?Awesome" && ok "Font Awesome" || warn "Font Awesome missing (some icons)"
|
||||
{ [ -d /usr/share/themes/adw-gtk3-dark ] || [ -d "$HOME/.local/share/themes/adw-gtk3-dark" ]; } && ok "adw-gtk3 theme" || warn "adw-gtk3 theme missing (GTK apps will not follow the palette)"
|
||||
|
||||
section "Terminal and shell tools"
|
||||
for t in kitty zsh tmux git fzf zoxide eza bat fd rg ncdu lazygit; do
|
||||
have "$t" || { [ "$t" = fd ] && have fdfind; } && ok "$t" || warn "$t missing"
|
||||
section "Terminal"
|
||||
have kitty && ok "kitty" || bad "kitty missing"
|
||||
section "Optional shell setup (install.sh --with-shell)"
|
||||
opt() { printf ' \033[2m--\033[0m %s\n' "$*"; }
|
||||
for t in zsh tmux git fzf zoxide eza bat fd rg ncdu lazygit; do
|
||||
if have "$t" || { [ "$t" = fd ] && have fdfind; }; then ok "$t"; else opt "$t not installed (optional)"; fi
|
||||
done
|
||||
[ -d "$HOME/.oh-my-zsh" ] && ok "oh-my-zsh" || warn "oh-my-zsh missing"
|
||||
[ "$(basename "${SHELL:-}")" = zsh ] && ok "login shell is zsh" || warn "login shell is not zsh (run: chsh -s $(command -v zsh || echo /usr/bin/zsh))"
|
||||
[ -d "$HOME/.oh-my-zsh" ] && ok "oh-my-zsh" || opt "oh-my-zsh not installed (optional)"
|
||||
|
||||
section "Per-machine config"
|
||||
[ -f "$CFG/sway/config.d/05-outputs.conf" ] && ok "monitor layout (05-outputs.conf)" || warn "no monitor layout yet: run ~/.config/sway/outputs-setup.sh inside sway"
|
||||
for t in grim swappy jq swaylock swayidle brightnessctl wl-copy notify-send; do have "$t" && ok "$t" || warn "$t missing"; done
|
||||
for t in nautilus grim swappy jq swaylock swayidle brightnessctl wl-copy notify-send; do have "$t" && ok "$t" || warn "$t missing"; done
|
||||
|
||||
printf '\n'; [ "$fails" -eq 0 ] && echo "No failures." || echo "$fails failure(s)."
|
||||
exit "$fails"
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Runs at every sway start; does something only on a fresh machine (idempotent):
|
||||
# - picks the shipped wallpaper in DMS when none is chosen yet
|
||||
# - generates the monitor layout when this machine has none
|
||||
cfg=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
walls=$HOME/.local/share/backgrounds
|
||||
|
||||
# wait until DMS has registered its IPC targets (up to ~40 s)
|
||||
i=0
|
||||
while [ "$i" -lt 40 ]; do
|
||||
dms ipc show 2>/dev/null | grep -q '^target wallpaper' && break
|
||||
i=$((i+1)); sleep 1
|
||||
done
|
||||
cur=$(dms ipc call wallpaper get 2>/dev/null | head -1)
|
||||
|
||||
# DMS prints the path when a wallpaper is set; anything else means "none yet"
|
||||
case "$cur" in
|
||||
/*) ;;
|
||||
*) [ -f "$walls/kitty.jpg" ] && dms ipc call wallpaper set "$walls/kitty.jpg" >/dev/null 2>&1 ;;
|
||||
esac
|
||||
|
||||
# monitor layout (laptop panel left, the rest to the right); the file is per machine
|
||||
[ -e "$cfg/sway/config.d/05-outputs.conf" ] || "$cfg/sway/outputs-setup.sh" --auto >/dev/null 2>&1
|
||||
exit 0
|
||||
@@ -1,31 +1,46 @@
|
||||
# sway-rising
|
||||
|
||||
Монохромный «стеклянный» райс для **SwayFX** на Fedora: blur, скруглённые углы, мягкое свечение у активного окна и **DankMaterialShell** (бар, лаунчер, панель управления с Wi-Fi / Bluetooth / VPN, уведомления, блокировка, обои) поверх sway.
|
||||
«Стеклянный» райс для **Fedora**: матовый blur, скруглённые углы, мягкое свечение у активного окна, **SwayFX** (тайлинг-композитор) и **DankMaterialShell** (бар, лаунчер, панель управления с Wi-Fi / Bluetooth / VPN, уведомления, экран блокировки, обои), терминал **kitty** с красивой палитрой, удобные скриншоты и хоткеи. Ставится одной командой, откатывается одной командой.
|
||||
|
||||
## Что внутри
|
||||
## Установка
|
||||
|
||||
| Путь | Что это |
|
||||
Нужны: Fedora (лучше Workstation), `git`, интернет, `sudo`.
|
||||
|
||||
```sh
|
||||
git clone https://git.ibrash.duckdns.org/aibrash/sway-rising.git sway-rising && cd sway-rising
|
||||
./install.sh --dry-run # необязательно: показать, что будет сделано, ничего не меняя
|
||||
./install.sh
|
||||
```
|
||||
|
||||
Скрипт спросит про два сторонних репозитория (COPR) для SwayFX и DMS и про раскладки клавиатуры, остальное делает сам. Без вопросов: `./install.sh --yes`.
|
||||
|
||||
Перед началом ваши настройки **сохраняются в `~/rice-backup-<дата>`**. Ваши программы, `~/.zshrc`, tmux, ssh и браузер не трогаются.
|
||||
|
||||
Что ставится: сессия sway (`SwayFX`, `sway-systemd`, порталы), `DankMaterialShell`, kitty, Nautilus, swaylock/swayidle, grim + swappy (скриншоты), шрифты JetBrains Mono и Font Awesome, тема `adw-gtk3`.
|
||||
|
||||
Хочется ещё и zsh с oh-my-zsh, tmux и удобными утилитами (fzf, zoxide, eza, bat, fd, ripgrep, lazygit)? Добавьте `--with-shell`.
|
||||
|
||||
После установки **выйдите и выберите на экране входа сессию «Sway»**. При первом запуске райс сам выберет обои и расставит ваши мониторы (ноутбук слева, внешние справа, масштаб подбирается по разрешению).
|
||||
|
||||
Если на машине стоит Fedora Sway Spin, в ней есть обычный `sway`, который конфликтует с SwayFX: скрипт предупредит и подскажет команду `sudo dnf remove sway sway-config-fedora`.
|
||||
|
||||
## Настройка под себя
|
||||
|
||||
| Что | Как |
|
||||
|---|---|
|
||||
| `.config/sway/config` | базовый конфиг sway (раскладки us/ru, хоткеи, `--to-code`: хоткеи работают и на русской раскладке) |
|
||||
| `.config/sway/config.d/00-session.conf` | окружение и `sway-session.target`, чтобы работали порталы (демонстрация экрана, диалоги) |
|
||||
| `.config/sway/config.d/05-outputs.conf.example` | пример раскладки мониторов; свой файл создаёт `outputs-setup.sh` |
|
||||
| `.config/sway/config.d/06-mouse.conf` | чувствительность мыши |
|
||||
| `.config/sway/config.d/10-appearance.conf` | цвета рамок и вкладок, отступы, тачпад, правила окон, idle |
|
||||
| `.config/sway/config.d/20-swayfx.conf`, `21-dms-effects.conf` | эффекты SwayFX: blur, тени, скругления, прозрачность; blur для слоёв DMS |
|
||||
| `.config/sway/config.d/30-workflow.conf` | scratchpad-терминал, скриншоты, шпаргалка, режим производительности |
|
||||
| `.config/sway/config.d/50-dms.conf` | запуск DMS, буфер обмена, медиаклавиши (громкость, яркость, плеер) |
|
||||
| `.config/sway/config.d/60-autostart.conf` | автозапуск Nextcloud, Remmina и Geary (xdg-autostart в sway не работает) |
|
||||
| `.config/sway/screenshot.sh` | все режимы скриншотов (см. ниже) |
|
||||
| `.config/sway/{lock,idle,cheatsheet}.sh` | блокировка (DMS, запасной swaylock), swayidle, шпаргалка по хоткеям |
|
||||
| `.config/sway/outputs-setup.sh`, `doctor.sh` | настройка мониторов под новое железо; проверка здоровья системы |
|
||||
| `.config/dms/settings.json` | настройки DMS: виджеты бара (раскладка, VPN, температура, приватность), шрифты, панель управления |
|
||||
| `.config/kitty/kitty.conf` | JetBrains Mono, палитра Tokyo Night, прозрачность, вкладки и сплиты |
|
||||
| `.config/swappy/config` | редактор скриншотов (стрелки, текст, размытие) |
|
||||
| `.config/swaylock/` | запасная блокировка, если DMS не запущен |
|
||||
| `home/.tmux.conf`, `home/.zshrc`, `home/.oh-my-zsh/custom/sysadmin.zsh` | tmux, zsh, алиасы сисадмина; fzf / zoxide / eza подключаются сами |
|
||||
| `wallpapers/` | любимые обои (кладутся в `~/.local/share/backgrounds`, дальше обоями управляет DMS) |
|
||||
| Цвета, шрифты, виджеты бара, прозрачность | интерфейс DMS (значок настроек в панели `Super+N`) |
|
||||
| Обои | интерфейс DMS: Settings → Wallpaper |
|
||||
| Раскладки клавиатуры, тачпад | `~/.config/sway/config.d/07-input.conf` или `./install.sh --layouts "us,de"` |
|
||||
| Мониторы и масштаб | `~/.config/sway/outputs-setup.sh` (с вопросами) или файл `config.d/05-outputs.conf` |
|
||||
| Свои твики (скорость мыши, автозапуск программ) | `~/.config/sway/config.d/99-personal.conf`, пример: `examples/99-personal.conf.example`. Установщик такие файлы **никогда не трогает** |
|
||||
| Хоткеи | `config` и `config.d/30-workflow.conf`; список всех: `Super+F1` |
|
||||
|
||||
Обои, уведомления, панель управления, лаунчер и бар обслуживает DMS. Waybar, swaync, dunst, rofi и сопутствующие скрипты убраны из репозитория.
|
||||
Повторный запуск `./install.sh` безопасен: он обновит райс и заново сделает бэкап, а ваши `07-input.conf`, настройки DMS (`~/.config/dms/settings.json`) и все `99-*.conf` оставит как есть.
|
||||
|
||||
## Откат и диагностика
|
||||
|
||||
- **Вернуть всё как было:** `./install.sh --restore` (берёт самый старый бэкап, то есть состояние до райса; можно указать папку: `--restore ~/rice-backup-...`). Пакеты при этом остаются, убрать их: `sudo dnf remove swayfx dms`.
|
||||
- **Проверка здоровья:** `./install.sh --check` (то же: `~/.config/sway/doctor.sh`) покажет, что установлено и что работает. Диагностика самого DMS: `dms doctor`.
|
||||
|
||||
## Скриншоты
|
||||
|
||||
@@ -49,6 +64,7 @@
|
||||
| `Super+N` | панель управления DMS (Wi-Fi, Bluetooth, VPN, звук, яркость) |
|
||||
| `Super+Shift+N` | центр уведомлений |
|
||||
| `Super+Shift+V` | история буфера обмена |
|
||||
| `Super+O` | файловый менеджер (Nautilus) |
|
||||
| `Super+Shift+Q` | закрыть окно |
|
||||
| `Super+Shift+C` | перезагрузить конфиг |
|
||||
| `Super+Shift+E` / `Super+Shift+P` | меню выключения DMS |
|
||||
@@ -66,37 +82,29 @@
|
||||
| `Super+C` | центрировать плавающее окно |
|
||||
| `Super+R` | режим изменения размера (`H/J/K/L`, `Esc`) |
|
||||
| `Super+S` / `Super+W` / `Super+E` | layout: stacking / tabbed / split |
|
||||
| `Alt+Shift` | переключение раскладки (us / ru); первой в `xkb_layout` должна стоять `us` |
|
||||
| `Alt+Shift` | переключение раскладки; все хоткеи работают на любой раскладке |
|
||||
|
||||
## Новый ноутбук за одну команду (Fedora)
|
||||
## Что внутри
|
||||
|
||||
На свежей Fedora (Workstation или любой вариант с `git`):
|
||||
| Путь | Что это |
|
||||
|---|---|
|
||||
| `install.sh` | установщик (Fedora): пакеты, бэкап, конфиги, `--restore`, `--check`, `--dry-run` |
|
||||
| `.config/sway/config` | базовый конфиг sway; все хоткеи работают и на других раскладках (`bindsym --to-code`) |
|
||||
| `.config/sway/config.d/00-session.conf` | окружение и `sway-session.target`, чтобы работали порталы (демонстрация экрана, диалоги) |
|
||||
| `.config/sway/config.d/05-outputs.conf.example` | пример раскладки мониторов (свой файл создаёт `outputs-setup.sh`) |
|
||||
| `.config/sway/config.d/07-input.conf` | клавиатура и тачпад |
|
||||
| `.config/sway/config.d/10-appearance.conf` | цвета рамок и вкладок, отступы, правила окон, idle |
|
||||
| `.config/sway/config.d/20-swayfx.conf`, `21-dms-effects.conf` | эффекты SwayFX: blur, тени, скругления, прозрачность; blur для слоёв DMS |
|
||||
| `.config/sway/config.d/30-workflow.conf` | scratchpad-терминал, скриншоты, шпаргалка, режим производительности |
|
||||
| `.config/sway/config.d/50-dms.conf` | запуск DMS, буфер обмена, медиаклавиши (громкость, яркость, плеер) |
|
||||
| `.config/sway/screenshot.sh` | все режимы скриншотов (см. ниже) |
|
||||
| `.config/sway/{lock,idle,cheatsheet,firstrun}.sh` | блокировка (DMS, запасной swaylock), swayidle, шпаргалка, первый запуск (обои и мониторы) |
|
||||
| `.config/sway/outputs-setup.sh`, `doctor.sh` | раскладка мониторов под железо; проверка здоровья системы |
|
||||
| `.config/dms/settings.json` | настройки DMS: тема, шрифты, виджеты бара (раскладка, VPN, температура, приватность), панель управления |
|
||||
| `.config/kitty/kitty.conf` | JetBrains Mono, палитра Tokyo Night, прозрачность, вкладки (`Ctrl+Shift+←/→`) и сплиты (`Ctrl+Alt+стрелки`); `Ctrl+C` копирует выделенное (без выделения прерывает), `Ctrl+V` вставляет |
|
||||
| `.config/swappy/config` | редактор скриншотов (стрелки, текст, размытие) |
|
||||
| `.config/swaylock/` | запасная блокировка, если DMS не запущен |
|
||||
| `home/` | только для `--with-shell`: `.zshrc`, `.tmux.conf`, алиасы (`ports`, `jce`, `dnfu`, `tm`) и автоподключение fzf / zoxide / eza |
|
||||
| `wallpapers/` | обои (кладутся в `~/.local/share/backgrounds`, дальше обоями управляет DMS) |
|
||||
| `examples/` | пример личных настроек |
|
||||
|
||||
```sh
|
||||
git clone git@git.ibrash.duckdns.org:aibrash/sway-rising.git && cd sway-rising && ./install.sh
|
||||
```
|
||||
|
||||
Репозиторий клонируется по ssh, поэтому на новой машине сначала нужен ваш ключ (`~/.ssh/id_ed25519`) или ключ, добавленный на git-сервер.
|
||||
|
||||
Скрипт спрашивает подтверждение перед каждым COPR и больше ни о чём не спрашивает. Для полностью автоматического режима: `./install.sh --yes`.
|
||||
|
||||
Что он делает:
|
||||
1. Ставит пакеты через `dnf`: сессия sway (`sway-systemd`, порталы), kitty, swaylock/swayidle, grim, swappy (аннотации скриншотов), шрифты JetBrains Mono и Font Awesome, тема `adw-gtk3`.
|
||||
2. Подключает COPR `swayfx/swayfx` и `avengemedia/dms` и ставит SwayFX и DankMaterialShell.
|
||||
3. Ставит CLI: zsh, tmux, fzf, zoxide, eza, bat, fd, ripgrep, ncdu, fastfetch, lazygit (бинарник с проверкой суммы), клонирует oh-my-zsh с плагинами. Опция `--with-tools` добавляет nmap, tcpdump, mtr, jq, btop, ansible.
|
||||
4. **Делает бэкап** ваших конфигов в `~/rice-backup-<дата>` и копирует конфиги, обои (в `~/.local/share/backgrounds`), tmux и алиасы. Ваш `~/.zshrc` не трогает (его заменит только `--force-shell`).
|
||||
5. Включает тему `adw-gtk3-dark` и проверяет конфиг (`sway -C`).
|
||||
|
||||
После установки: выйти и выбрать на экране входа сессию **Sway**. Внутри сессии один раз выполнить
|
||||
|
||||
```sh
|
||||
~/.config/sway/outputs-setup.sh # раскладка и масштаб мониторов (ноутбук слева, внешний справа)
|
||||
```
|
||||
|
||||
Файл раскладки мониторов намеренно не копируется: на другом железе другие имена выходов. В репозитории лежит только пример `05-outputs.conf.example`.
|
||||
|
||||
Проверка здоровья в любой момент: `./install.sh --check` (то же самое: `~/.config/sway/doctor.sh`). Показывает, что установлено, что работает, а что нет (DMS, порталы, шрифты, инструменты, раскладка мониторов).
|
||||
|
||||
Флаги: `--yes`, `--dry-run` (показать действия, ничего не менять), `--check`, `--no-packages`, `--no-dms`, `--no-shell`, `--with-tools`, `--force-shell`. Можно запускать повторно.
|
||||
|
||||
DMS запускается из `config.d/50-dms.conf`, руками его запускать не нужно. Диагностика самого DMS: `dms doctor`.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Copy to ~/.config/sway/config.d/99-personal.conf. install.sh never touches 99-*.conf files.
|
||||
|
||||
# Mouse / touchpad speed (-1 slowest .. 1 fastest)
|
||||
input type:pointer {
|
||||
pointer_accel -0.5
|
||||
}
|
||||
input type:touchpad {
|
||||
pointer_accel 0.3
|
||||
}
|
||||
|
||||
# Autostart apps (xdg-autostart does not run under sway)
|
||||
# exec sh -c 'sleep 5; command -v nextcloud >/dev/null && nextcloud --background'
|
||||
+92
-41
@@ -1,16 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# sway-rising installer (Fedora): turns a fresh Fedora install into the full rice
|
||||
# (SwayFX + DankMaterialShell, kitty, zsh/tmux, CLI tools, fonts, wallpapers, configs).
|
||||
# sway-rising installer (Fedora): the "glass" look on SwayFX + DankMaterialShell, with kitty,
|
||||
# fonts, wallpaper, hotkeys and screenshots. Your existing configs are backed up first.
|
||||
#
|
||||
# Usage: ./install.sh [options]
|
||||
# -y, --yes do not ask questions (non-interactive)
|
||||
# --dry-run print what would be done, change nothing
|
||||
# --check only run the health check and exit
|
||||
# --restore [DIR] put your old configs back from a backup (default: the OLDEST ~/rice-backup-*, i.e. before the rice)
|
||||
# --layouts L keyboard layouts, e.g. "us,de" (default: ask; "us,ru" with --yes)
|
||||
# --no-packages configs only, skip package installation
|
||||
# --no-dms do not install DankMaterialShell
|
||||
# --no-shell skip zsh / oh-my-zsh / tmux / CLI tools
|
||||
# --with-tools also install sysadmin tools (nmap, tcpdump, mtr, jq, ansible, btop)
|
||||
# --force-shell overwrite an existing ~/.zshrc (the old one is backed up)
|
||||
# --with-shell also install zsh, oh-my-zsh, tmux and CLI tools (fzf, zoxide, eza, ...) with their configs
|
||||
# --force-shell with --with-shell: replace an existing ~/.zshrc (the old one is backed up)
|
||||
# -h, --help
|
||||
set -euo pipefail
|
||||
|
||||
@@ -19,21 +20,27 @@ CFG=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
WALLS=$HOME/.local/share/backgrounds
|
||||
STAMP=$(date +%F-%H%M%S)
|
||||
BACKUP=$HOME/rice-backup-$STAMP
|
||||
n=1; while [ -e "$BACKUP" ]; do n=$((n+1)); BACKUP=$HOME/rice-backup-$STAMP-$n; done # never reuse a backup folder
|
||||
MANAGED_DIRS=(sway swaylock kitty dms swappy) # configs this repo owns
|
||||
PRESERVE=(sway/config.d/07-input.conf dms/settings.json) # meant to be edited by the user: installed only when missing
|
||||
LEGACY_DIRS=(waybar rofi dunst swaync) # older versions of the rice; only backed up
|
||||
|
||||
YES=0; DRY=0; CHECK=0; PACKAGES=1; DMS=1; SHELLSETUP=1; TOOLS=0; FORCE_SHELL=0
|
||||
for a in "$@"; do
|
||||
case $a in
|
||||
YES=0; DRY=0; CHECK=0; RESTORE=0; RESTORE_DIR=""; PACKAGES=1; DMS=1; WITH_SHELL=0; FORCE_SHELL=0; LAYOUTS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-y|--yes) YES=1 ;;
|
||||
--dry-run) DRY=1 ;;
|
||||
--check) CHECK=1 ;;
|
||||
--restore) RESTORE=1; if [ $# -gt 1 ] && [ "${2#-}" = "$2" ]; then RESTORE_DIR=$2; shift; fi ;;
|
||||
--layouts) [ $# -gt 1 ] || { echo "--layouts needs a value" >&2; exit 1; }; LAYOUTS=$2; shift ;;
|
||||
--no-packages) PACKAGES=0 ;;
|
||||
--no-dms) DMS=0 ;;
|
||||
--no-shell) SHELLSETUP=0 ;;
|
||||
--with-tools) TOOLS=1 ;;
|
||||
--with-shell) WITH_SHELL=1 ;;
|
||||
--force-shell) FORCE_SHELL=1 ;;
|
||||
-h|--help) sed -n '2,15p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
||||
*) echo "unknown option: $a (try --help)" >&2; exit 1 ;;
|
||||
*) echo "unknown option: $1 (try --help)" >&2; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
say() { printf '\033[1;37m==>\033[0m %s\n' "$*"; }
|
||||
@@ -47,14 +54,13 @@ NOTES=() # follow-up hints for the user
|
||||
|
||||
# ---------------------------------------------------------------- packages (Fedora names, all verified with dnf)
|
||||
CORE_PKGS=(
|
||||
sway-systemd # session target + env for portals
|
||||
kitty swaylock swayidle grim swappy jq wl-clipboard brightnessctl libnotify
|
||||
pavucontrol network-manager-applet wireplumber pipewire-pulseaudio
|
||||
sway-systemd dbus-tools # session target + env for portals
|
||||
kitty nautilus swaylock swayidle grim swappy jq wl-clipboard brightnessctl libnotify
|
||||
network-manager-applet wireplumber pipewire-pulseaudio
|
||||
xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk
|
||||
jetbrains-mono-fonts fontawesome-6-free-fonts adw-gtk3-theme
|
||||
)
|
||||
SHELL_PKGS=(zsh tmux git curl fzf zoxide eza bat fd-find ripgrep ncdu fastfetch)
|
||||
TOOLS_PKGS=(nmap tcpdump mtr jq btop ansible)
|
||||
|
||||
check_fedora() {
|
||||
local ID="" ID_LIKE=""
|
||||
@@ -89,7 +95,7 @@ install_dms() {
|
||||
else warn "Skipping dms: no bar / control center / notifications will be started."; fi
|
||||
}
|
||||
|
||||
# lazygit is not in Fedora: official release binary, checksum verified
|
||||
# lazygit is not in Fedora: official release binary, checksum verified (only with --with-shell)
|
||||
install_lazygit() {
|
||||
have lazygit && return 0
|
||||
local arch; case $(uname -m) in x86_64) arch=x86_64 ;; aarch64) arch=arm64 ;; *) warn "lazygit: unsupported arch"; return 0 ;; esac
|
||||
@@ -108,7 +114,7 @@ install_lazygit() {
|
||||
rm -rf "$tmp"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- zsh / oh-my-zsh
|
||||
# ---------------------------------------------------------------- zsh / oh-my-zsh (only with --with-shell)
|
||||
install_shell_extras() {
|
||||
local zsh_custom=$HOME/.oh-my-zsh/custom p
|
||||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
@@ -124,54 +130,68 @@ install_shell_extras() {
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- configs
|
||||
choose_layouts() {
|
||||
[ -n "$LAYOUTS" ] && return 0
|
||||
if [ "$YES" = 1 ] || [ ! -t 0 ] || [ "$DRY" = 1 ]; then return 0; fi # keep the shipped "us,ru"
|
||||
read -r -p "Keyboard layouts, comma separated (first one must be Latin) [us,ru]: " LAYOUTS || LAYOUTS=""
|
||||
}
|
||||
|
||||
apply_layouts() {
|
||||
[ -n "$LAYOUTS" ] && [ "$LAYOUTS" != "us,ru" ] || return 0
|
||||
if ! [[ $LAYOUTS =~ ^[a-z0-9_,()-]+$ ]]; then warn "Ignoring odd layout string '$LAYOUTS'"; return 0; fi
|
||||
say "Keyboard layouts: $LAYOUTS"
|
||||
if [ "$DRY" = 1 ]; then echo " [dry-run] set xkb_layout \"$LAYOUTS\" in config.d/07-input.conf"; return 0; fi
|
||||
sed -i "s|xkb_layout \".*\"|xkb_layout \"$LAYOUTS\"|" "$CFG/sway/config.d/07-input.conf"
|
||||
}
|
||||
|
||||
backup_and_copy_configs() {
|
||||
say "Backing up existing configs to $BACKUP"
|
||||
run mkdir -p "$BACKUP"
|
||||
local d
|
||||
for d in sway swaylock kitty dms swappy waybar rofi dunst swaync; do # last four: legacy, only backed up
|
||||
for d in "${MANAGED_DIRS[@]}" "${LEGACY_DIRS[@]}"; do
|
||||
if [ -e "$CFG/$d" ]; then run cp -a "$CFG/$d" "$BACKUP/"; fi
|
||||
done
|
||||
|
||||
say "Copying configs to $CFG"
|
||||
run mkdir -p "$CFG"
|
||||
# the machine-specific monitor layout ships only as 05-outputs.conf.example (see outputs-setup.sh)
|
||||
if [ "$DRY" = 1 ]; then echo " [dry-run] cp -a $REPO/.config/. $CFG/"; else cp -a "$REPO/.config/." "$CFG/"; fi
|
||||
run rm -f "$CFG/sway/config.d/40-bar.conf" # waybar is replaced by DMS; a stale file would start a second bar
|
||||
run mkdir -p "$HOME/Pictures/Screenshots"
|
||||
# files the user is meant to edit (keyboard, DMS theme) are installed only when missing; 99-*.conf are never in the repo
|
||||
local kept=() f tmp
|
||||
tmp=$(mktemp -d)
|
||||
for f in "${PRESERVE[@]}"; do
|
||||
if [ "$DRY" = 0 ] && [ -f "$CFG/$f" ]; then mkdir -p "$tmp/$(dirname "$f")"; cp -a "$CFG/$f" "$tmp/$f"; kept+=("$f"); fi
|
||||
done
|
||||
if [ "$DRY" = 1 ]; then echo " [dry-run] cp -a $REPO/.config/. $CFG/ (keeping existing: ${PRESERVE[*]})"; else cp -a "$REPO/.config/." "$CFG/"; fi
|
||||
for f in "${kept[@]}"; do cp -a "$tmp/$f" "$CFG/$f"; NOTES+=("Kept your existing $f (not overwritten)"); done
|
||||
rm -rf "$tmp"
|
||||
run rm -f "$CFG/sway/config.d/40-bar.conf" # waybar is replaced by DMS; a stale file from an old version would start a second bar
|
||||
if [ "$DRY" = 0 ]; then chmod +x "$CFG"/sway/*.sh 2>/dev/null || true; fi
|
||||
run mkdir -p "$HOME/Pictures/Screenshots"
|
||||
|
||||
if [ -d "$REPO/home" ]; then
|
||||
if [ "$WITH_SHELL" = 1 ] && [ -d "$REPO/home" ]; then
|
||||
say "Copying shell/tmux files into $HOME (existing ones are backed up)"
|
||||
local f
|
||||
while IFS= read -r f; do
|
||||
if [ "$f" = ".zshrc" ] && [ -e "$HOME/.zshrc" ] && [ "$FORCE_SHELL" = 0 ]; then
|
||||
NOTES+=("Your ~/.zshrc was kept. To use the rice's one: ./install.sh --force-shell (the old one is backed up)"); continue
|
||||
NOTES+=("Your ~/.zshrc was kept. To use the rice's one: ./install.sh --with-shell --force-shell (the old one is backed up)"); continue
|
||||
fi
|
||||
if [ -e "$HOME/$f" ]; then run mkdir -p "$BACKUP/$(dirname "$f")"; run cp -a "$HOME/$f" "$BACKUP/$f"; fi
|
||||
run mkdir -p "$HOME/$(dirname "$f")"
|
||||
run cp -a "$REPO/home/$f" "$HOME/$f"
|
||||
done < <(cd "$REPO/home" && find . -type f | sed 's|^\./||')
|
||||
fi
|
||||
|
||||
install_wallpapers
|
||||
}
|
||||
|
||||
# Wallpapers are managed by DMS (Settings > Wallpaper); we only drop the shipped favourites into its folder
|
||||
# Wallpapers are managed by DMS; we only drop the shipped favourites into its folder.
|
||||
# The first sway start (firstrun.sh) picks one in DMS if none is chosen yet.
|
||||
install_wallpapers() {
|
||||
compgen -G "$REPO/wallpapers/*" >/dev/null || return 0
|
||||
say "Copying wallpapers to $WALLS"
|
||||
run mkdir -p "$WALLS"
|
||||
if [ "$DRY" = 1 ]; then echo " [dry-run] cp -n wallpapers/* $WALLS/"; else cp -n "$REPO"/wallpapers/* "$WALLS/"; fi
|
||||
local cur=""
|
||||
if [ -n "${SWAYSOCK:-}" ] && have dms && pgrep -x dms >/dev/null; then cur=$(dms ipc call wallpaper get 2>/dev/null | head -1); fi
|
||||
if [ "$DRY" = 0 ] && [ -n "${SWAYSOCK:-}" ] && pgrep -x dms >/dev/null && [ -z "$cur" ] && [ -f "$WALLS/kitty.jpg" ]; then
|
||||
dms ipc call wallpaper set "$WALLS/kitty.jpg" >/dev/null 2>&1 || true # only when no wallpaper is chosen yet
|
||||
elif [ -z "$cur" ]; then
|
||||
NOTES+=("Wallpaper: pick one in DMS (Super+N > settings > Wallpaper); the shipped ones are in $WALLS")
|
||||
fi
|
||||
}
|
||||
|
||||
# GTK theme: adw-gtk3 (DMS recolors it); only when the user has no choice of their own yet
|
||||
# GTK theme: adw-gtk3 (DMS recolors it)
|
||||
apply_gtk_theme() {
|
||||
have gsettings || return 0
|
||||
[ -d /usr/share/themes/adw-gtk3-dark ] || return 0
|
||||
@@ -183,9 +203,9 @@ setup_outputs() {
|
||||
if [ -e "$CFG/sway/config.d/05-outputs.conf" ]; then say "Monitor layout already configured (05-outputs.conf)"; return 0; fi
|
||||
if [ -n "${SWAYSOCK:-}" ] && [ "$DRY" = 0 ]; then
|
||||
say "Generating the monitor layout"
|
||||
if [ "$YES" = 1 ]; then "$CFG/sway/outputs-setup.sh" --auto || true; else "$CFG/sway/outputs-setup.sh" || true; fi
|
||||
"$CFG/sway/outputs-setup.sh" --auto || true
|
||||
else
|
||||
NOTES+=("Monitors: after logging into sway run ~/.config/sway/outputs-setup.sh (layout and scale for laptop + external screens)")
|
||||
NOTES+=("Monitors: the first sway start generates the layout automatically; fine-tune with ~/.config/sway/outputs-setup.sh")
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -200,40 +220,71 @@ verify() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- restore
|
||||
restore_backup() {
|
||||
local src=$RESTORE_DIR
|
||||
# the oldest backup holds your configs from before the rice; newer ones hold earlier installs of the rice itself
|
||||
[ -n "$src" ] || src=$(ls -d "$HOME"/rice-backup-* 2>/dev/null | sort | head -1 || true)
|
||||
if [ -z "$src" ] || [ ! -d "$src" ]; then warn "No backup found (looked for $HOME/rice-backup-*)"; exit 1; fi
|
||||
say "Restoring from $src"
|
||||
ask "This replaces the rice configs in $CFG with the backed up ones. Continue?" || exit 0
|
||||
local e name d
|
||||
for e in "$src"/* "$src"/.[!.]*; do
|
||||
[ -e "$e" ] || continue
|
||||
name=$(basename "$e")
|
||||
case $name in
|
||||
.*) run cp -a "$e" "$HOME/" ;; # shell/tmux files
|
||||
*) run rm -rf "$CFG/$name"; run cp -a "$e" "$CFG/" ;;
|
||||
esac
|
||||
done
|
||||
for d in "${MANAGED_DIRS[@]}"; do
|
||||
[ -e "$src/$d" ] || NOTES+=("$d had no config before the install, so it was left as is: remove it with rm -rf $CFG/$d")
|
||||
done
|
||||
NOTES+=("Packages are not removed. To drop the rice: sudo dnf remove swayfx dms (then pick your old session at login)")
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- main
|
||||
if [ "$CHECK" = 1 ]; then exec "$REPO/.config/sway/doctor.sh"; fi
|
||||
if [ "$(id -u)" = 0 ]; then warn "Do not run as root; the script uses sudo where needed."; exit 1; fi
|
||||
|
||||
if [ "$RESTORE" = 1 ]; then
|
||||
restore_backup
|
||||
if [ ${#NOTES[@]} -gt 0 ]; then printf '\033[1mNext steps:\033[0m\n'; printf ' - %s\n' "${NOTES[@]}"; fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if check_fedora; then say "Fedora detected"; else
|
||||
warn "This installer is for Fedora. Packages are skipped, configs only."; PACKAGES=0
|
||||
fi
|
||||
[ "$DRY" = 1 ] && say "DRY RUN: nothing will be changed"
|
||||
choose_layouts
|
||||
|
||||
if [ "$PACKAGES" = 1 ]; then
|
||||
say "Installing core packages (${#CORE_PKGS[@]})"
|
||||
dnf_install "${CORE_PKGS[@]}"
|
||||
install_swayfx
|
||||
if [ "$DMS" = 1 ]; then install_dms; fi
|
||||
if [ "$SHELLSETUP" = 1 ]; then
|
||||
if [ "$WITH_SHELL" = 1 ]; then
|
||||
say "Installing shell packages (${#SHELL_PKGS[@]})"
|
||||
dnf_install "${SHELL_PKGS[@]}"
|
||||
install_lazygit
|
||||
fi
|
||||
if [ "$TOOLS" = 1 ]; then say "Installing sysadmin tools"; dnf_install "${TOOLS_PKGS[@]}"; fi
|
||||
fi
|
||||
|
||||
backup_and_copy_configs
|
||||
apply_layouts
|
||||
if [ "$PACKAGES" = 1 ]; then apply_gtk_theme; fi
|
||||
if [ "$SHELLSETUP" = 1 ]; then install_shell_extras; fi
|
||||
if [ "$WITH_SHELL" = 1 ]; then install_shell_extras; fi
|
||||
setup_outputs
|
||||
verify
|
||||
|
||||
echo
|
||||
echo "Backup of your old configs: $BACKUP"
|
||||
echo "Backup of your old configs: $BACKUP (undo with: ./install.sh --restore)"
|
||||
if [ ${#FAILED[@]} -gt 0 ]; then printf '\033[1;33mDid not work:\033[0m\n'; printf ' - %s\n' "${FAILED[@]}"; fi
|
||||
if [ ${#NOTES[@]} -gt 0 ]; then printf '\033[1mNext steps:\033[0m\n'; printf ' - %s\n' "${NOTES[@]}"; fi
|
||||
cat <<EOF
|
||||
|
||||
Health check any time: ./install.sh --check (or ~/.config/sway/doctor.sh)
|
||||
Hotkeys: Super+F1 cheatsheet, Super+D launcher, Super+N control center, Super+Shift+X lock.
|
||||
Hotkeys: Super+F1 cheatsheet, Super+D launcher, Super+N control center, Print screenshot, Super+Shift+X lock.
|
||||
Your own tweaks go into ~/.config/sway/config.d/99-personal.conf (never touched by this script).
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user