forked from Shinonome/dots-hyprland
updaed pywal dependancy added kvantum theming and pywal also changes some configs
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
|
||||
# Starter Config
|
||||
|
||||
if suggestions don't work, first make sure
|
||||
you have TypeScript LSP working in your editor
|
||||
|
||||
if you do not want typechecking only suggestions
|
||||
|
||||
```json
|
||||
// tsconfig.json
|
||||
"checkJs": false
|
||||
```
|
||||
|
||||
types are symlinked to:
|
||||
/usr/share/com.github.Aylur.ags/types
|
||||
@@ -86,14 +86,20 @@ export const BluetoothIndicator = () => Widget.Stack({
|
||||
transition: 'slide_up_down',
|
||||
transitionDuration: userOptions.animations.durationSmall,
|
||||
children: {
|
||||
'false': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_disabled' }),
|
||||
'true': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth' }),
|
||||
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_disabled' }),
|
||||
'enabled': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth' }),
|
||||
'connected': Widget.Label({ className: 'txt-norm icon-material', label: 'bluetooth_connected' }),
|
||||
},
|
||||
setup: (self) => self
|
||||
.hook(Bluetooth, stack => {
|
||||
stack.shown = String(Bluetooth.enabled);
|
||||
})
|
||||
,
|
||||
setup: (self) =>
|
||||
self.hook(Bluetooth, (stack) => {
|
||||
if (!Bluetooth.enabled) {
|
||||
stack.shown = 'disabled';
|
||||
} else if (Bluetooth.connected_devices.length === 0) {
|
||||
stack.shown = 'enabled';
|
||||
} else if (Bluetooth.connected_devices.length > 0) {
|
||||
stack.shown = 'connected';
|
||||
}
|
||||
}),
|
||||
});
|
||||
|
||||
const BluetoothDevices = () => Widget.Box({
|
||||
@@ -158,8 +164,11 @@ const NetworkWifiIndicator = () => Widget.Stack({
|
||||
transition: 'slide_up_down',
|
||||
transitionDuration: userOptions.animations.durationSmall,
|
||||
children: {
|
||||
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'wifi_off' }),
|
||||
'disconnected': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_off' }),
|
||||
'disabled': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_off' }),
|
||||
'disconnected': Widget.Label({
|
||||
className: 'txt-norm icon-material',
|
||||
label: 'signal_wifi_statusbar_not_connected',
|
||||
}),
|
||||
'connecting': Widget.Label({ className: 'txt-norm icon-material', label: 'settings_ethernet' }),
|
||||
'0': Widget.Label({ className: 'txt-norm icon-material', label: 'signal_wifi_0_bar' }),
|
||||
'1': Widget.Label({ className: 'txt-norm icon-material', label: 'network_wifi_1_bar' }),
|
||||
@@ -171,10 +180,11 @@ const NetworkWifiIndicator = () => Widget.Stack({
|
||||
if (!Network.wifi) {
|
||||
return;
|
||||
}
|
||||
if (Network.wifi.internet == 'connected') {
|
||||
if (!Network.wifi.enabled) {
|
||||
stack.shown = 'disabled';
|
||||
} else if (Network.wifi.internet == 'connected') {
|
||||
stack.shown = String(Math.ceil(Network.wifi.strength / 25));
|
||||
}
|
||||
else if (["disconnected", "connecting"].includes(Network.wifi.internet)) {
|
||||
} else if (['disconnected', 'connecting'].includes(Network.wifi.internet)) {
|
||||
stack.shown = Network.wifi.internet;
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -60,7 +60,10 @@ export default (overviewMonitor = 0) => {
|
||||
else if (x < 0) { w = x + w; x = 0; }
|
||||
if (y + h <= 0) x += (Math.floor(y / monitors[monitor].height) * monitors[monitor].height);
|
||||
else if (y < 0) { h = y + h; y = 0; }
|
||||
<<<<<<< HEAD
|
||||
// Prevents throwing an error when multiple monitors are plugged in but only one is enabled (#1047)
|
||||
=======
|
||||
>>>>>>> 1996008 (heda fix)
|
||||
if (monitors.length - 1 < monitor) {
|
||||
monitor = monitors.length - 1;
|
||||
}
|
||||
|
||||
@@ -1,130 +1,307 @@
|
||||
const { GLib } = imports.gi;
|
||||
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
|
||||
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js";
|
||||
import Widget from "resource:///com/github/Aylur/ags/widget.js";
|
||||
import * as Utils from "resource:///com/github/Aylur/ags/utils.js";
|
||||
const { Box, Button, Icon, Label, Scrollable, Slider, Stack } = Widget;
|
||||
const { execAsync, exec } = Utils;
|
||||
import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
|
||||
import { setupCursorHover } from '../../.widgetutils/cursorhover.js';
|
||||
import { ConfigGap, ConfigSpinButton, ConfigToggle } from '../../.commonwidgets/configwidgets.js';
|
||||
import { MaterialIcon } from "../../.commonwidgets/materialicon.js";
|
||||
import { setupCursorHover } from "../../.widgetutils/cursorhover.js";
|
||||
import {
|
||||
ConfigGap,
|
||||
ConfigSpinButton,
|
||||
ConfigToggle,
|
||||
} from "../../.commonwidgets/configwidgets.js";
|
||||
|
||||
const HyprlandToggle = ({ icon, name, desc = null, option, enableValue = 1, disableValue = 0, extraOnChange = () => { } }) => ConfigToggle({
|
||||
// Hyprland config file path
|
||||
const configFile = GLib.get_home_dir() + "/.config/hypr/hyprland/HyprAGS.conf";
|
||||
|
||||
// Ensure the config file exists
|
||||
function ensureConfigFileExists() {
|
||||
if (!GLib.file_test(configFile, GLib.FileTest.EXISTS)) {
|
||||
execAsync(["touch", configFile]).catch((err) =>
|
||||
logError("Error creating config file", err),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to update the config file
|
||||
function updateConfig(option, value) {
|
||||
execAsync([
|
||||
"bash",
|
||||
"-c",
|
||||
`
|
||||
if grep -q "^${option} =" ${configFile}; then
|
||||
sed -i "s/^${option} = .*/${option} = ${value}/" ${configFile}
|
||||
else
|
||||
echo "${option} = ${value}" >> ${configFile}
|
||||
fi
|
||||
`,
|
||||
]).catch((err) => logError("Failed to update config", err));
|
||||
}
|
||||
|
||||
// Toggles for Hyprland settings
|
||||
const HyprlandToggle = ({
|
||||
icon,
|
||||
name,
|
||||
desc = null,
|
||||
option,
|
||||
enableValue = 1,
|
||||
disableValue = 0,
|
||||
extraOnChange = () => {},
|
||||
}) =>
|
||||
ConfigToggle({
|
||||
icon: icon,
|
||||
name: name,
|
||||
desc: desc,
|
||||
initValue: JSON.parse(exec(`hyprctl getoption -j ${option}`))["int"] != 0,
|
||||
onChange: (self, newValue) => {
|
||||
execAsync(['hyprctl', 'keyword', option, `${newValue ? enableValue : disableValue}`]).catch(print);
|
||||
extraOnChange(self, newValue);
|
||||
}
|
||||
});
|
||||
execAsync([
|
||||
"hyprctl",
|
||||
"keyword",
|
||||
option,
|
||||
`${newValue ? enableValue : disableValue}`,
|
||||
])
|
||||
.then(() => {
|
||||
updateConfig(option, newValue ? enableValue : disableValue);
|
||||
extraOnChange(self, newValue);
|
||||
})
|
||||
.catch((err) => logError("Error applying change", err));
|
||||
},
|
||||
});
|
||||
|
||||
const HyprlandSpinButton = ({ icon, name, desc = null, option, ...rest }) => ConfigSpinButton({
|
||||
// SpinButton for numeric settings
|
||||
const HyprlandSpinButton = ({ icon, name, desc = null, option, ...rest }) =>
|
||||
ConfigSpinButton({
|
||||
icon: icon,
|
||||
name: name,
|
||||
desc: desc,
|
||||
initValue: Number(JSON.parse(exec(`hyprctl getoption -j ${option}`))["int"]),
|
||||
initValue: Number(
|
||||
JSON.parse(exec(`hyprctl getoption -j ${option}`))["int"],
|
||||
),
|
||||
onChange: (self, newValue) => {
|
||||
execAsync(['hyprctl', 'keyword', option, `${newValue}`]).catch(print);
|
||||
execAsync(["hyprctl", "keyword", option, `${newValue}`])
|
||||
.then(() => {
|
||||
updateConfig(option, newValue);
|
||||
})
|
||||
.catch((err) => logError("Error applying change", err));
|
||||
},
|
||||
...rest,
|
||||
});
|
||||
});
|
||||
|
||||
const Subcategory = (children) => Box({
|
||||
className: 'margin-left-20',
|
||||
const Subcategory = (children) =>
|
||||
Box({
|
||||
className: "margin-left-20",
|
||||
vertical: true,
|
||||
children: children,
|
||||
})
|
||||
});
|
||||
|
||||
export default (props) => {
|
||||
const ConfigSection = ({ name, children }) => Box({
|
||||
vertical: true,
|
||||
className: 'spacing-v-5',
|
||||
children: [
|
||||
Label({
|
||||
hpack: 'center',
|
||||
className: 'txt txt-large margin-left-10',
|
||||
label: name,
|
||||
const ConfigSection = ({ name, children }) =>
|
||||
Box({
|
||||
vertical: true,
|
||||
className: "spacing-v-5",
|
||||
children: [
|
||||
Label({
|
||||
hpack: "center",
|
||||
className: "txt txt-large margin-left-10",
|
||||
label: name,
|
||||
}),
|
||||
Box({
|
||||
className: "margin-left-10 margin-right-10",
|
||||
vertical: true,
|
||||
children: children,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
const mainContent = Scrollable({
|
||||
vexpand: true,
|
||||
child: Box({
|
||||
vertical: true,
|
||||
className: "spacing-v-10",
|
||||
children: [
|
||||
// Roundings Section
|
||||
ConfigSection({
|
||||
name: getString("Window"),
|
||||
children: [
|
||||
HyprlandSpinButton({
|
||||
icon: "crop_square",
|
||||
name: getString("Window Roundings"),
|
||||
desc: getString(
|
||||
"[Hyprland]\nAdjust the window corner roundings.",
|
||||
),
|
||||
option: "decoration:rounding",
|
||||
minValue: 0,
|
||||
maxValue: 50,
|
||||
step: 1,
|
||||
onChange: (self, newValue) => {
|
||||
updateConfig("decoration:rounding", newValue);
|
||||
},
|
||||
}),
|
||||
Box({
|
||||
className: 'margin-left-10 margin-right-10',
|
||||
vertical: true,
|
||||
children: children,
|
||||
})
|
||||
]
|
||||
})
|
||||
const mainContent = Scrollable({
|
||||
vexpand: true,
|
||||
child: Box({
|
||||
vertical: true,
|
||||
className: 'spacing-v-10',
|
||||
children: [
|
||||
ConfigSection({
|
||||
name: getString('Effects'), children: [
|
||||
ConfigToggle({
|
||||
icon: 'border_clear',
|
||||
name: getString('Transparency'),
|
||||
desc: getString('[AGS]\nMake shell elements transparent\nBlur is also recommended if you enable this'),
|
||||
initValue: exec(`bash -c "sed -n \'2p\' ${GLib.get_user_state_dir()}/ags/user/colormode.txt"`) == "transparent",
|
||||
onChange: (self, newValue) => {
|
||||
const transparency = newValue == 0 ? "opaque" : "transparent";
|
||||
console.log(transparency);
|
||||
execAsync([`bash`, `-c`, `mkdir -p ${GLib.get_user_state_dir()}/ags/user && sed -i "2s/.*/${transparency}/" ${GLib.get_user_state_dir()}/ags/user/colormode.txt`])
|
||||
.then(execAsync(['bash', '-c', `${App.configDir}/scripts/color_generation/switchcolor.sh`]))
|
||||
.catch(print);
|
||||
},
|
||||
}),
|
||||
HyprlandToggle({ icon: 'blur_on', name: getString('Blur'), desc: getString("[Hyprland]\nEnable blur on transparent elements\nDoesn't affect performance/power consumption unless you have transparent windows."), option: "decoration:blur:enabled" }),
|
||||
Subcategory([
|
||||
HyprlandToggle({ icon: 'stack_off', name: getString('X-ray'), desc: getString("[Hyprland]\nMake everything behind a window/layer except the wallpaper not rendered on its blurred surface\nRecommended to improve performance (if you don't abuse transparency/blur) "), option: "decoration:blur:xray" }),
|
||||
HyprlandSpinButton({ icon: 'target', name: getString('Size'), desc: getString('[Hyprland]\nAdjust the blur radius. Generally doesn\'t affect performance\nHigher = more color spread'), option: 'decoration:blur:size', minValue: 1, maxValue: 1000 }),
|
||||
HyprlandSpinButton({ icon: 'repeat', name: getString('Passes'), desc: getString('[Hyprland] Adjust the number of runs of the blur algorithm\nMore passes = more spread and power consumption\n4 is recommended\n2- would look weird and 6+ would look lame.'), option: 'decoration:blur:passes', minValue: 1, maxValue: 10 }),
|
||||
]),
|
||||
ConfigGap({}),
|
||||
HyprlandToggle({
|
||||
icon: 'animation', name: getString('Animations'), desc: getString('[Hyprland] [GTK]\nEnable animations'), option: 'animations:enabled',
|
||||
extraOnChange: (self, newValue) => execAsync(['gsettings', 'set', 'org.gnome.desktop.interface', 'enable-animations', `${newValue}`])
|
||||
}),
|
||||
Subcategory([
|
||||
ConfigSpinButton({
|
||||
icon: 'clear_all',
|
||||
name: getString('Choreography delay'),
|
||||
desc: getString('In milliseconds, the delay between animations of a series'),
|
||||
initValue: userOptions.animations.choreographyDelay,
|
||||
step: 10, minValue: 0, maxValue: 1000,
|
||||
onChange: (self, newValue) => {
|
||||
userOptions.animations.choreographyDelay = newValue
|
||||
},
|
||||
})
|
||||
]),
|
||||
]
|
||||
}),
|
||||
ConfigSection({
|
||||
name: getString('Developer'), children: [
|
||||
HyprlandToggle({ icon: 'speed', name: getString('Show FPS'), desc: getString("[Hyprland]\nShow FPS overlay on top-left corner"), option: "debug:overlay" }),
|
||||
HyprlandToggle({ icon: 'sort', name: getString('Log to stdout'), desc: getString("[Hyprland]\nPrint LOG, ERR, WARN, etc. messages to the console"), option: "debug:enable_stdout_logs" }),
|
||||
HyprlandToggle({ icon: 'motion_sensor_active', name: getString('Damage tracking'), desc: getString("[Hyprland]\nEnable damage tracking\nGenerally, leave it on.\nTurn off only when a shader doesn't work"), option: "debug:damage_tracking", enableValue: 2 }),
|
||||
HyprlandToggle({ icon: 'destruction', name: getString('Damage blink'), desc: getString("[Hyprland] [Epilepsy warning!]\nShow screen damage flashes"), option: "debug:damage_blink" }),
|
||||
]
|
||||
}),
|
||||
]
|
||||
})
|
||||
});
|
||||
const footNote = Box({
|
||||
homogeneous: true,
|
||||
children: [Label({
|
||||
hpack: 'center',
|
||||
className: 'txt txt-italic txt-subtext margin-5',
|
||||
label: getString('Not all changes are saved'),
|
||||
})]
|
||||
})
|
||||
return Box({
|
||||
...props,
|
||||
className: 'spacing-v-5',
|
||||
vertical: true,
|
||||
children: [
|
||||
mainContent,
|
||||
footNote,
|
||||
]
|
||||
});
|
||||
}
|
||||
],
|
||||
}),
|
||||
// Effects Section
|
||||
ConfigSection({
|
||||
name: getString("Effects"),
|
||||
children: [
|
||||
ConfigToggle({
|
||||
icon: "border_clear",
|
||||
name: getString("Transparency"),
|
||||
desc: getString(
|
||||
"[AGS]\nMake shell elements transparent\nBlur is also recommended if you enable this",
|
||||
),
|
||||
initValue:
|
||||
exec(
|
||||
`bash -c "sed -n '2p' ${GLib.get_user_state_dir()}/ags/user/colormode.txt"`,
|
||||
) == "transparent",
|
||||
onChange: (self, newValue) => {
|
||||
const transparency = newValue == 0 ? "opaque" : "transparent";
|
||||
execAsync([
|
||||
`bash`,
|
||||
`-c`,
|
||||
`mkdir -p ${GLib.get_user_state_dir()}/ags/user && sed -i "2s/.*/${transparency}/" ${GLib.get_user_state_dir()}/ags/user/colormode.txt`,
|
||||
])
|
||||
.then(
|
||||
execAsync([
|
||||
"bash",
|
||||
"-c",
|
||||
`${App.configDir}/scripts/color_generation/switchcolor.sh`,
|
||||
]),
|
||||
)
|
||||
.then(() => {
|
||||
if (newValue) {
|
||||
updateConfig("decoration:active_opacity", 0.85);
|
||||
updateConfig("decoration:inactive_opacity", 0.85);
|
||||
} else {
|
||||
updateConfig("decoration:active_opacity", 1);
|
||||
updateConfig("decoration:inactive_opacity", 1);
|
||||
}
|
||||
})
|
||||
.catch(print);
|
||||
},
|
||||
}),
|
||||
HyprlandToggle({
|
||||
icon: "blur_on",
|
||||
name: getString("Blur"),
|
||||
desc: getString(
|
||||
"[Hyprland]\nEnable blur on transparent elements.",
|
||||
),
|
||||
option: "decoration:blur:enabled",
|
||||
}),
|
||||
Subcategory([
|
||||
HyprlandSpinButton({
|
||||
icon: "target",
|
||||
name: getString("Blur Size"),
|
||||
desc: getString("[Hyprland]\nAdjust the blur radius."),
|
||||
option: "decoration:blur:size",
|
||||
minValue: 1,
|
||||
maxValue: 1000,
|
||||
}),
|
||||
HyprlandSpinButton({
|
||||
icon: "repeat",
|
||||
name: getString("Blur Passes"),
|
||||
desc: getString(
|
||||
"[Hyprland]\nAdjust the number of passes for blur.",
|
||||
),
|
||||
option: "decoration:blur:passes",
|
||||
minValue: 1,
|
||||
maxValue: 10,
|
||||
}),
|
||||
]),
|
||||
HyprlandToggle({
|
||||
icon: "auto_fix_high",
|
||||
name: getString("Blur Special"),
|
||||
desc: getString("[Hyprland]\nEnable special blur effects."),
|
||||
option: "decoration:blur:special",
|
||||
}),
|
||||
ConfigGap({}),
|
||||
HyprlandToggle({
|
||||
icon: "animation",
|
||||
name: getString("Animations"),
|
||||
desc: getString("[Hyprland] [GTK]\nEnable animations"),
|
||||
option: "animations:enabled",
|
||||
extraOnChange: (self, newValue) =>
|
||||
execAsync([
|
||||
"gsettings",
|
||||
"set",
|
||||
"org.gnome.desktop.interface",
|
||||
"enable-animations",
|
||||
`${newValue}`,
|
||||
]),
|
||||
}),
|
||||
Subcategory([
|
||||
ConfigSpinButton({
|
||||
icon: "clear_all",
|
||||
name: getString("Choreography delay"),
|
||||
desc: getString(
|
||||
"In milliseconds, the delay between animations of a series",
|
||||
),
|
||||
initValue: userOptions.animations.choreographyDelay,
|
||||
step: 10,
|
||||
minValue: 0,
|
||||
maxValue: 1000,
|
||||
onChange: (self, newValue) => {
|
||||
userOptions.animations.choreographyDelay = newValue;
|
||||
},
|
||||
}),
|
||||
]),
|
||||
],
|
||||
}),
|
||||
// Developer Section
|
||||
ConfigSection({
|
||||
name: getString("Developer"),
|
||||
children: [
|
||||
HyprlandToggle({
|
||||
icon: "speed",
|
||||
name: getString("Show FPS"),
|
||||
desc: getString(
|
||||
"[Hyprland]\nShow FPS overlay on top-left corner.",
|
||||
),
|
||||
option: "debug:overlay",
|
||||
}),
|
||||
HyprlandToggle({
|
||||
icon: "sort",
|
||||
name: getString("Log to stdout"),
|
||||
desc: getString("[Hyprland]\nPrint log messages to console."),
|
||||
option: "debug:enable_stdout_logs",
|
||||
}),
|
||||
HyprlandToggle({
|
||||
icon: "motion_sensor_active",
|
||||
name: getString("Damage Tracking"),
|
||||
desc: getString("[Hyprland]\nEnable damage tracking."),
|
||||
option: "debug:damage_tracking",
|
||||
enableValue: 2,
|
||||
}),
|
||||
HyprlandToggle({
|
||||
icon: "destruction",
|
||||
name: getString("Damage Blink"),
|
||||
desc: getString("[Hyprland]\nShow screen damage flashes."),
|
||||
option: "debug:damage_blink",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
||||
const footNote = Box({
|
||||
homogeneous: true,
|
||||
children: [
|
||||
Label({
|
||||
hpack: "center",
|
||||
className: "txt txt-italic txt-subtext margin-5",
|
||||
label: getString("Not all changes are saved"),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
return Box({
|
||||
...props,
|
||||
className: "spacing-v-5",
|
||||
vertical: true,
|
||||
children: [mainContent, footNote],
|
||||
});
|
||||
};
|
||||
|
||||
// Ensure the config file exists before applying changes
|
||||
ensureConfigFileExists();
|
||||
|
||||
@@ -10,7 +10,7 @@ STATE_DIR="$XDG_STATE_HOME/ags"
|
||||
term_alpha=100 #Set this to < 100 make all your terminals transparent
|
||||
# sleep 0 # idk i wanted some delay or colors dont get applied properly
|
||||
if [ ! -d "$CACHE_DIR"/user/generated ]; then
|
||||
mkdir -p "$CACHE_DIR"/user/generated
|
||||
mkdir -p "$CACHE_DIR"/user/generated
|
||||
fi
|
||||
cd "$CONFIG_DIR" || exit
|
||||
|
||||
@@ -19,9 +19,9 @@ colorstrings=''
|
||||
colorlist=()
|
||||
colorvalues=()
|
||||
|
||||
# wallpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
|
||||
# wallpath_png="$CACHE_DIR/user/generated/hypr/lockscreen.png"
|
||||
# convert "$wallpath" "$wallpath_png"
|
||||
wallpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
|
||||
wallpath_png="$CACHE_DIR/user/generated/hypr/lockscreen.png"
|
||||
convert "$wallpath" "$wallpath_png"
|
||||
# wallpath_png=$(echo "$wallpath_png" | sed 's/\//\\\//g')
|
||||
# wallpath_png=$(sed 's/\//\\\\\//g' <<< "$wallpath_png")
|
||||
|
||||
@@ -38,145 +38,161 @@ transparentize() {
|
||||
}
|
||||
|
||||
get_light_dark() {
|
||||
lightdark=""
|
||||
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
|
||||
echo "" > "$STATE_DIR/user/colormode.txt"
|
||||
else
|
||||
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
|
||||
fi
|
||||
echo "$lightdark"
|
||||
lightdark=""
|
||||
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
|
||||
echo "" >"$STATE_DIR/user/colormode.txt"
|
||||
else
|
||||
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
|
||||
fi
|
||||
echo "$lightdark"
|
||||
}
|
||||
|
||||
apply_fuzzel() {
|
||||
# Check if scripts/templates/fuzzel/fuzzel.ini exists
|
||||
if [ ! -f "scripts/templates/fuzzel/fuzzel.ini" ]; then
|
||||
echo "Template file not found for Fuzzel. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/fuzzel
|
||||
cp "scripts/templates/fuzzel/fuzzel.ini" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
|
||||
done
|
||||
# Check if scripts/templates/fuzzel/fuzzel.ini exists
|
||||
if [ ! -f "scripts/templates/fuzzel/fuzzel.ini" ]; then
|
||||
echo "Template file not found for Fuzzel. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/fuzzel
|
||||
cp "scripts/templates/fuzzel/fuzzel.ini" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
|
||||
done
|
||||
|
||||
cp "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini "$XDG_CONFIG_HOME"/fuzzel/fuzzel.ini
|
||||
cp "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini "$XDG_CONFIG_HOME"/fuzzel/fuzzel.ini
|
||||
}
|
||||
|
||||
apply_term() {
|
||||
# Check if terminal escape sequence template exists
|
||||
if [ ! -f "scripts/templates/terminal/sequences.txt" ]; then
|
||||
echo "Template file not found for Terminal. Skipping that."
|
||||
return
|
||||
# Check if terminal escape sequence template exists
|
||||
if [ ! -f "scripts/templates/terminal/sequences.txt" ]; then
|
||||
echo "Template file not found for Terminal. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/terminal
|
||||
cp "scripts/templates/terminal/sequences.txt" "$CACHE_DIR"/user/generated/terminal/sequences.txt
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/terminal/sequences.txt
|
||||
done
|
||||
|
||||
sed -i "s/\$alpha/$term_alpha/g" "$CACHE_DIR/user/generated/terminal/sequences.txt"
|
||||
|
||||
for file in /dev/pts/*; do
|
||||
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
|
||||
cat "$CACHE_DIR"/user/generated/terminal/sequences.txt >"$file"
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/terminal
|
||||
cp "scripts/templates/terminal/sequences.txt" "$CACHE_DIR"/user/generated/terminal/sequences.txt
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/terminal/sequences.txt
|
||||
done
|
||||
|
||||
sed -i "s/\$alpha/$term_alpha/g" "$CACHE_DIR/user/generated/terminal/sequences.txt"
|
||||
|
||||
for file in /dev/pts/*; do
|
||||
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
|
||||
cat "$CACHE_DIR"/user/generated/terminal/sequences.txt > "$file"
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
apply_hyprland() {
|
||||
# Check if scripts/templates/hypr/hyprland/colors.conf exists
|
||||
if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then
|
||||
echo "Template file not found for Hyprland colors. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/hypr/hyprland
|
||||
cp "scripts/templates/hypr/hyprland/colors.conf" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
|
||||
done
|
||||
# Check if scripts/templates/hypr/hyprland/colors.conf exists
|
||||
if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then
|
||||
echo "Template file not found for Hyprland colors. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/hypr/hyprland
|
||||
cp "scripts/templates/hypr/hyprland/colors.conf" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
|
||||
done
|
||||
|
||||
cp "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf "$XDG_CONFIG_HOME"/hypr/hyprland/colors.conf
|
||||
cp "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf "$XDG_CONFIG_HOME"/hypr/hyprland/colors.conf
|
||||
}
|
||||
|
||||
apply_hyprlock() {
|
||||
# Check if scripts/templates/hypr/hyprlock.conf exists
|
||||
if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then
|
||||
echo "Template file not found for hyprlock. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/hypr/
|
||||
cp "scripts/templates/hypr/hyprlock.conf" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
# Apply colors
|
||||
# sed -i "s/{{ SWWW_WALL }}/${wallpath_png}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
done
|
||||
# Check if scripts/templates/hypr/hyprlock.conf exists
|
||||
if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then
|
||||
echo "Template file not found for hyprlock. Skipping that."
|
||||
return
|
||||
fi
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/hypr/
|
||||
cp "scripts/templates/hypr/hyprlock.conf" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
# Apply colors
|
||||
sed -i "s|path = \$path|path = $wallpath_png|" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
|
||||
cp "$CACHE_DIR"/user/generated/hypr/hyprlock.conf "$XDG_CONFIG_HOME"/hypr/hyprlock.conf
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
|
||||
done
|
||||
|
||||
cp "$CACHE_DIR"/user/generated/hypr/hyprlock.conf "$XDG_CONFIG_HOME"/hypr/hyprlock.conf
|
||||
}
|
||||
|
||||
apply_lightdark() {
|
||||
lightdark=$(get_light_dark)
|
||||
if [ "$lightdark" = "light" ]; then
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
fi
|
||||
lightdark=$(get_light_dark)
|
||||
if [ "$lightdark" = "light" ]; then
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
fi
|
||||
}
|
||||
|
||||
apply_gtk() { # Using gradience-cli
|
||||
usegradience=$(sed -n '4p' "$STATE_DIR/user/colormode.txt")
|
||||
if [[ "$usegradience" = "nogradience" ]]; then
|
||||
rm "$XDG_CONFIG_HOME/gtk-3.0/gtk.css"
|
||||
rm "$XDG_CONFIG_HOME/gtk-4.0/gtk.css"
|
||||
return
|
||||
fi
|
||||
usegradience=$(sed -n '4p' "$STATE_DIR/user/colormode.txt")
|
||||
if [[ "$usegradience" = "nogradience" ]]; then
|
||||
rm "$XDG_CONFIG_HOME/gtk-3.0/gtk.css"
|
||||
rm "$XDG_CONFIG_HOME/gtk-4.0/gtk.css"
|
||||
return
|
||||
fi
|
||||
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/gradience
|
||||
cp "scripts/templates/gradience/preset.json" "$CACHE_DIR"/user/generated/gradience/preset.json
|
||||
# Copy template
|
||||
mkdir -p "$CACHE_DIR"/user/generated/gradience
|
||||
cp "scripts/templates/gradience/preset.json" "$CACHE_DIR"/user/generated/gradience/preset.json
|
||||
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]}/g" "$CACHE_DIR"/user/generated/gradience/preset.json
|
||||
done
|
||||
# Apply colors
|
||||
for i in "${!colorlist[@]}"; do
|
||||
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]}/g" "$CACHE_DIR"/user/generated/gradience/preset.json
|
||||
done
|
||||
|
||||
mkdir -p "$XDG_CONFIG_HOME/presets" # create gradience presets folder
|
||||
gradience-cli apply -p "$CACHE_DIR"/user/generated/gradience/preset.json --gtk both
|
||||
mkdir -p "$XDG_CONFIG_HOME/presets" # create gradience presets folder
|
||||
gradience-cli apply -p "$CACHE_DIR"/user/generated/gradience/preset.json --gtk both
|
||||
|
||||
# And set GTK theme manually as Gradience defaults to light adw-gtk3
|
||||
# (which is unreadable when broken when you use dark mode)
|
||||
lightdark=$(get_light_dark)
|
||||
if [ "$lightdark" = "light" ]; then
|
||||
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark
|
||||
fi
|
||||
# And set GTK theme manually as Gradience defaults to light adw-gtk3
|
||||
# (which is unreadable when broken when you use dark mode)
|
||||
lightdark=$(get_light_dark)
|
||||
if [ "$lightdark" = "light" ]; then
|
||||
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark
|
||||
fi
|
||||
}
|
||||
|
||||
apply_ags() {
|
||||
ags run-js "handleStyles(false);"
|
||||
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
|
||||
ags run-js "handleStyles(false);"
|
||||
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
|
||||
}
|
||||
|
||||
apply_pywal() {
|
||||
# generate pywal colors
|
||||
mkdir -p "$CACHE_DIR"/user/generated/pywal
|
||||
python "$CONFIG_DIR/scripts/color_generation/gen_materialwal.py" # generate wal colors
|
||||
wal -n -f "$CACHE_DIR/user/generated/pywal/pywal.json" --cols16 # apply pywal
|
||||
# apply other scripts
|
||||
sh "$XDG_CONFIG_HOME/pywal/gen-pywal"
|
||||
}
|
||||
|
||||
colornames=$(cat $STATE_DIR/scss/_material.scss | cut -d: -f1)
|
||||
colorstrings=$(cat $STATE_DIR/scss/_material.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
|
||||
apply_qt() {
|
||||
sh "$CONFIG_DIR/scripts/kvantum/materialQT.sh" # generate kvantum theme
|
||||
python "$CONFIG_DIR/scripts/kvantum/changeAwdColors.py" # apply config colors
|
||||
}
|
||||
|
||||
colornames=$(cat "$STATE_DIR"/scss/_material.scss | cut -d: -f1)
|
||||
colorstrings=$(cat "$STATE_DIR"/scss/_material.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
|
||||
IFS=$'\n'
|
||||
colorlist=( $colornames ) # Array of color names
|
||||
colorvalues=( $colorstrings ) # Array of color values
|
||||
colorlist=($colornames) # Array of color names
|
||||
colorvalues=($colorstrings) # Array of color values
|
||||
|
||||
apply_ags &
|
||||
apply_hyprland &
|
||||
apply_hyprlock &
|
||||
apply_lightdark &
|
||||
apply_gtk &
|
||||
apply_qt &
|
||||
apply_pywal &
|
||||
apply_fuzzel &
|
||||
apply_term &
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import json
|
||||
import re
|
||||
import os
|
||||
import argparse
|
||||
|
||||
def parse_scss_file(file_path):
|
||||
scss_colors = {}
|
||||
with open(file_path, 'r') as file:
|
||||
for line in file:
|
||||
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line)
|
||||
if match:
|
||||
scss_colors[match.group(1)] = match.group(2)
|
||||
return scss_colors
|
||||
|
||||
def scss_to_pywal(scss_file, output_file='pywal_colors.json'):
|
||||
scss_colors = parse_scss_file(scss_file)
|
||||
|
||||
pywal_colors = {
|
||||
"special": {
|
||||
"background": scss_colors["background"],
|
||||
"foreground": scss_colors["onBackground"],
|
||||
"cursor": scss_colors["onBackground"]
|
||||
},
|
||||
"colors": {
|
||||
"color0": scss_colors["term0"],
|
||||
"color1": scss_colors["term1"],
|
||||
"color2": scss_colors["term2"],
|
||||
"color3": scss_colors["term3"],
|
||||
"color4": scss_colors["term4"],
|
||||
"color5": scss_colors["term5"],
|
||||
"color6": scss_colors["term6"],
|
||||
"color7": scss_colors["term7"],
|
||||
"color8": scss_colors["term8"],
|
||||
"color9": scss_colors["term9"],
|
||||
"color10": scss_colors["term10"],
|
||||
"color11": scss_colors["term11"],
|
||||
"color12": scss_colors["term12"],
|
||||
"color13": scss_colors["term13"],
|
||||
"color14": scss_colors["term14"],
|
||||
"color15": scss_colors["term15"]
|
||||
}
|
||||
}
|
||||
|
||||
# Write the Pywal colors to a JSON file
|
||||
with open(output_file, 'w') as file:
|
||||
json.dump(pywal_colors, file, indent=4)
|
||||
|
||||
print(f"Pywal colors have been saved to {output_file}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Hardcode the file paths
|
||||
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss')
|
||||
output_file = os.path.expanduser('~/.cache/ags/user/generated/pywal/pywal.json')
|
||||
|
||||
scss_to_pywal(scss_file, output_file)
|
||||
|
||||
@@ -4,36 +4,36 @@ XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
|
||||
|
||||
switch() {
|
||||
imgpath=$1
|
||||
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
|
||||
cursorposx=$(hyprctl cursorpos -j | jq '.x' 2>/dev/null) || cursorposx=960
|
||||
cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1")
|
||||
cursorposy=$(hyprctl cursorpos -j | jq '.y' 2>/dev/null) || cursorposy=540
|
||||
cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1")
|
||||
cursorposy_inverted=$((screensizey - cursorposy))
|
||||
imgpath=$1
|
||||
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
|
||||
cursorposx=$(hyprctl cursorpos -j | jq '.x' 2>/dev/null) || cursorposx=960
|
||||
cursorposx=$(bc <<<"scale=0; ($cursorposx - $screenx) * $scale / 1")
|
||||
cursorposy=$(hyprctl cursorpos -j | jq '.y' 2>/dev/null) || cursorposy=540
|
||||
cursorposy=$(bc <<<"scale=0; ($cursorposy - $screeny) * $scale / 1")
|
||||
cursorposy_inverted=$((screensizey - cursorposy))
|
||||
|
||||
if [ "$imgpath" == '' ]; then
|
||||
echo 'Aborted'
|
||||
exit 0
|
||||
fi
|
||||
if [ "$imgpath" == '' ]; then
|
||||
echo 'Aborted'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ags run-js "wallpaper.set('')"
|
||||
# sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
|
||||
swww img "$imgpath" --transition-step 100 --transition-fps 120 \
|
||||
--transition-type grow --transition-angle 30 --transition-duration 1 \
|
||||
--transition-pos "$cursorposx, $cursorposy_inverted"
|
||||
# ags run-js "wallpaper.set('')"
|
||||
# sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
|
||||
swww img "$imgpath" --transition-step 100 --transition-fps 120 \
|
||||
--transition-type grow --transition-angle 30 --transition-duration 1 \
|
||||
--transition-pos "$cursorposx, $cursorposy_inverted"
|
||||
}
|
||||
|
||||
if [ "$1" == "--noswitch" ]; then
|
||||
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
|
||||
# imgpath=$(ags run-js 'wallpaper.get(0)')
|
||||
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
|
||||
# imgpath=$(ags run-js 'wallpaper.get(0)')
|
||||
elif [[ "$1" ]]; then
|
||||
switch "$1"
|
||||
switch "$1"
|
||||
else
|
||||
# Select and set image (hyprland)
|
||||
# Select and set image (hyprland)
|
||||
|
||||
cd "$(xdg-user-dir PICTURES)" || return 1
|
||||
switch "$(yad --width 1200 --height 800 --file --add-preview --large-preview --title='Choose wallpaper')"
|
||||
cd "$(xdg-user-dir PICTURES)" || return 1
|
||||
switch "$(yad --width 1200 --height 800 --file --add-preview --large-preview --title='Choose wallpaper')"
|
||||
fi
|
||||
|
||||
# Generate colors for ags n stuff
|
||||
|
||||
@@ -38,9 +38,9 @@ env_editor_confirm() {
|
||||
fi
|
||||
}
|
||||
|
||||
NOTIFY=no
|
||||
CURSOR=
|
||||
FREEZE=
|
||||
NOTIFY=yes
|
||||
CURSOR=no
|
||||
FREEZE=yes
|
||||
WAIT=no
|
||||
SCALE=
|
||||
HYPRPICKER_PID=-1
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
import re
|
||||
import os
|
||||
|
||||
def read_scss(file_path):
|
||||
"""Reads an SCSS file and returns a dictionary of color variables."""
|
||||
colors = {}
|
||||
with open(file_path, 'r') as file:
|
||||
for line in file:
|
||||
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line.strip())
|
||||
if match:
|
||||
variable_name, color = match.groups()
|
||||
colors[variable_name] = color
|
||||
return colors
|
||||
|
||||
def update_svg_colors(svg_path, old_to_new_colors, output_path):
|
||||
"""
|
||||
Updates the colors in an SVG file based on the provided color map.
|
||||
|
||||
:param svg_path: Path to the SVG file.
|
||||
:param old_to_new_colors: Dictionary mapping old colors to new colors.
|
||||
:param output_path: Path to save the updated SVG file.
|
||||
"""
|
||||
# Read the SVG content
|
||||
with open(svg_path, 'r') as file:
|
||||
svg_content = file.read()
|
||||
|
||||
# Replace old colors with new colors
|
||||
for old_color, new_color in old_to_new_colors.items():
|
||||
svg_content = re.sub(old_color, new_color, svg_content, flags=re.IGNORECASE)
|
||||
|
||||
# Write the updated SVG content to the output file
|
||||
with open(output_path, 'w') as file:
|
||||
file.write(svg_content)
|
||||
|
||||
print(f"SVG colors have been updated and saved to {output_path}!")
|
||||
|
||||
def main():
|
||||
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss') # Hardcoded path to the SCSS file
|
||||
svg_path = os.path.expanduser('~/.config/Kvantum/Colloid/Colloid.svg') # Hardcoded path to the input SVG file
|
||||
output_path = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.svg') # Hardcoded path to the output SVG file
|
||||
|
||||
# Read colors from the SCSS file
|
||||
color_data = read_scss(scss_file)
|
||||
|
||||
# Specify the old colors and map them to new colors from the SCSS file
|
||||
old_to_new_colors = {
|
||||
#'#cccccc': color_data['surfaceDim'], # Map old SVG color to new SCSS color
|
||||
#'#666666': color_data['surfaceDim'],
|
||||
'#3c84f7': color_data['primary'],
|
||||
#'#5a5a5a': color_data['neutral_paletteKeyColor'],
|
||||
'#000000': color_data['shadow'],
|
||||
'#f04a50': color_data['error'],
|
||||
'#4285f4': color_data['primaryFixedDim'],
|
||||
'#f2f2f2': color_data['background'],
|
||||
#'#dfdfdf': color_data['surfaceContainerLow'],
|
||||
'#ffffff': color_data['background'],
|
||||
'#1e1e1e': color_data['onPrimaryFixed'],
|
||||
#'#b6b6b6': color_data['surfaceContainer'],
|
||||
'#333': color_data['inverseSurface'],
|
||||
'#212121': color_data['onSecondaryFixed'],
|
||||
'#5b9bf8': color_data['secondaryContainer'],
|
||||
'#26272a': color_data['term7'],
|
||||
#'#b3b3b3': color_data['surfaceBright'],
|
||||
#'#b74aff': color_data['tertiary'],
|
||||
#'#989898': color_data['surfaceContainerHighest'],
|
||||
#'#c1c1c1': color_data['surfaceContainerHigh'],
|
||||
'#444444': color_data['onBackground'],
|
||||
'#333333': color_data['onPrimaryFixed'],
|
||||
}
|
||||
|
||||
# Update the SVG colors
|
||||
update_svg_colors(svg_path, old_to_new_colors, output_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import re
|
||||
import os
|
||||
|
||||
def read_scss(file_path):
|
||||
"""Reads an SCSS file and returns a dictionary of color variables."""
|
||||
colors = {}
|
||||
with open(file_path, 'r') as file:
|
||||
for line in file:
|
||||
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line.strip())
|
||||
if match:
|
||||
variable_name, color = match.groups()
|
||||
colors[variable_name] = color
|
||||
return colors
|
||||
|
||||
def update_svg_colors(svg_path, old_to_new_colors, output_path):
|
||||
"""
|
||||
Updates the colors in an SVG file based on the provided color map.
|
||||
|
||||
:param svg_path: Path to the SVG file.
|
||||
:param old_to_new_colors: Dictionary mapping old colors to new colors.
|
||||
:param output_path: Path to save the updated SVG file.
|
||||
"""
|
||||
# Read the SVG content
|
||||
with open(svg_path, 'r') as file:
|
||||
svg_content = file.read()
|
||||
|
||||
# Replace old colors with new colors
|
||||
for old_color, new_color in old_to_new_colors.items():
|
||||
svg_content = re.sub(old_color, new_color, svg_content, flags=re.IGNORECASE)
|
||||
|
||||
# Write the updated SVG content to the output file
|
||||
with open(output_path, 'w') as file:
|
||||
file.write(svg_content)
|
||||
|
||||
print(f"SVG colors have been updated and saved to {output_path}!")
|
||||
|
||||
def main():
|
||||
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss') # Hardcoded path to the SCSS file
|
||||
svg_path = os.path.expanduser('~/.config/Kvantum/Colloid/ColloidDark.svg') # Hardcoded path to the input SVG file
|
||||
output_path = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.svg') # Hardcoded path to the output SVG file
|
||||
|
||||
# Read colors from the SCSS file
|
||||
color_data = read_scss(scss_file)
|
||||
|
||||
# Specify the old colors and map them to new colors from the SCSS file
|
||||
old_to_new_colors = {
|
||||
#'#525252': color_data['surfaceDim'], # Map old SVG color to new SCSS color
|
||||
#'#666666': color_data['surfaceDim'],
|
||||
'#31363b': color_data['background'],
|
||||
#'#eff0f1': color_data['neutral_paletteKeyColor'],
|
||||
'#000000': color_data['shadow'],
|
||||
'#5b9bf8': color_data['primary'],
|
||||
'#93cee9': color_data['onSecondaryContainer'],
|
||||
'#3daee9': color_data['secondary'],
|
||||
#'#fff': color_data['term10'],
|
||||
#'#5a5a5a': color_data['surfaceVariant'],
|
||||
#'#acb1bc': color_data['onPrimaryFixed'],
|
||||
'#ffffff': color_data['term11'],
|
||||
'#5a616e': color_data['surfaceVariant'],
|
||||
'#f04a50': color_data['error'],
|
||||
'#4285f4': color_data['secondary'],
|
||||
'#242424': color_data['background'],
|
||||
'#2c2c2c': color_data['background'],
|
||||
#'#dfdfdf': color_data['onSurfaceVariant'],
|
||||
#'#646464': color_data['surfaceContainerHighest'],
|
||||
#'#989898': color_data['surfaceContainerHigh'],
|
||||
#'#c1c1c1': color_data['primaryFixedDim'],
|
||||
'#1e1e1e': color_data['background'],
|
||||
'#3c3c3c': color_data['background'],
|
||||
'#26272a': color_data['surfaceBright'],
|
||||
'#000000': color_data['shadow'],
|
||||
'#b74aff': color_data['tertiary'],
|
||||
#'#b6b6b6': color_data['onSurfaceVariant'],
|
||||
'#1a1a1a': color_data['background'],
|
||||
'#333': color_data['term0'],
|
||||
'#212121': color_data['background'],
|
||||
}
|
||||
|
||||
# Update the SVG colors
|
||||
update_svg_colors(svg_path, old_to_new_colors, output_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import re
|
||||
import os
|
||||
|
||||
def get_colors_from_scss(scss_file):
|
||||
colors = {}
|
||||
with open(scss_file, 'r') as file:
|
||||
for line in file:
|
||||
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line)
|
||||
if match:
|
||||
colors[match.group(1)] = match.group(2)
|
||||
return colors
|
||||
|
||||
def update_config_colors(config_file, colors, mappings):
|
||||
with open(config_file, 'r') as file:
|
||||
config_content = file.read()
|
||||
|
||||
for key, variable in mappings.items():
|
||||
if variable in colors:
|
||||
color = colors[variable]
|
||||
pattern = rf'({key}=)#?\w+\b'
|
||||
new_line = f'\\1{color}'
|
||||
if re.search(pattern, config_content):
|
||||
config_content = re.sub(pattern, new_line, config_content)
|
||||
else:
|
||||
config_content += f"\n{key}={color}"
|
||||
|
||||
with open(config_file, 'w') as file:
|
||||
file.write(config_content)
|
||||
|
||||
if __name__ == "__main__":
|
||||
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss')
|
||||
config_file = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.kvconfig') # Replace with the actual path to your config file
|
||||
|
||||
# Define your mappings here
|
||||
mappings = {
|
||||
'window.color': 'background',
|
||||
'base.color': 'background',
|
||||
'alt.base.color': 'background',
|
||||
'button.color': 'surfaceContainer',
|
||||
'light.color': 'surfaceContainerLow',
|
||||
'mid.light.color': 'surfaceContainer',
|
||||
'dark.color': 'surfaceContainerHighest',
|
||||
'mid.color': 'surfaceContainerHigh',
|
||||
'highlight.color': 'primary',
|
||||
'inactive.highlight.color': 'primary',
|
||||
'text.color': 'onBackground',
|
||||
'window.text.color': 'onBackground',
|
||||
'button.text.color': 'onBackground',
|
||||
'disabled.text.color': 'onBackground',
|
||||
'tooltip.text.color': 'onBackground',
|
||||
'highlight.text.color': 'onSurface',
|
||||
'link.color': 'tertiary',
|
||||
'link.visited.color': 'tertiaryFixed',
|
||||
'progress.indicator.text.color': 'onBackground',
|
||||
'text.normal.color': 'onBackground',
|
||||
'text.focus.color': 'onBackground',
|
||||
'text.press.color': 'onsecondarycontainer',
|
||||
'text.toggle.color': 'onsecondarycontainer',
|
||||
'text.disabled.color': 'surfaceDim',
|
||||
|
||||
|
||||
# Add more mappings as needed
|
||||
}
|
||||
|
||||
colors = get_colors_from_scss(scss_file)
|
||||
update_config_colors(config_file, colors, mappings)
|
||||
print("Config colors updated successfully!")
|
||||
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
|
||||
CACHE_DIR="$XDG_CACHE_HOME/ags"
|
||||
STATE_DIR="$XDG_STATE_HOME/ags"
|
||||
|
||||
get_light_dark() {
|
||||
lightdark=""
|
||||
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
|
||||
echo "" >"$STATE_DIR/user/colormode.txt"
|
||||
else
|
||||
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
|
||||
fi
|
||||
echo "$lightdark"
|
||||
}
|
||||
|
||||
apply_qt() {
|
||||
# Check if the theme exists
|
||||
FOLDER_PATH="$XDG_CONFIG_HOME/Kvantum/Colloid/"
|
||||
|
||||
if [ ! -d "$FOLDER_PATH" ]; then
|
||||
# Send a notification
|
||||
notify-send "Colloid-kde theme required" " The folder '$FOLDER_PATH' does not exist."
|
||||
exit 1 # Exit the function if the folder does not exist
|
||||
fi
|
||||
|
||||
lightdark=$(get_light_dark)
|
||||
if [ "$lightdark" = "light" ]; then
|
||||
# apply ligght colors
|
||||
cp "$XDG_CONFIG_HOME/Kvantum/Colloid/Colloid.kvconfig" "$XDG_CONFIG_HOME/Kvantum/MaterialAdw/MaterialAdw.kvconfig"
|
||||
python "$CONFIG_DIR/scripts/kvantum/adwsvg.py"
|
||||
|
||||
else
|
||||
#apply dark colors
|
||||
cp "$XDG_CONFIG_HOME/Kvantum/Colloid/ColloidDark.kvconfig" "$XDG_CONFIG_HOME/Kvantum/MaterialAdw/MaterialAdw.kvconfig"
|
||||
python "$CONFIG_DIR/scripts/kvantum/adwsvgDark.py"
|
||||
fi
|
||||
}
|
||||
|
||||
apply_qt
|
||||
@@ -4,6 +4,18 @@ general {
|
||||
col.active_border = rgba({{ $onSurface }}39)
|
||||
col.inactive_border = rgba({{ $outline }}30)
|
||||
}
|
||||
group {
|
||||
col.border_active = rgba({{ $onSurface }}39)
|
||||
col.border_inactive = rgba({{ $outline }}30)
|
||||
|
||||
groupbar {
|
||||
col.active = rgba({{ $background }}FF)
|
||||
col.inactive = rgba({{ $outline }}50)
|
||||
scrolling = true
|
||||
font_size = 11
|
||||
text_color = rgba({{ $onBackground }}FF)
|
||||
}
|
||||
}
|
||||
|
||||
misc {
|
||||
background_color = rgba({{ $surface }}FF)
|
||||
@@ -31,4 +43,4 @@ plugin {
|
||||
}
|
||||
}
|
||||
|
||||
windowrulev2 = bordercolor rgba({{ $primary }}AA) rgba({{ $primary }}77),pinned:1
|
||||
windowrulev2 = bordercolor rgba({{ $primary }}AA) rgba({{ $primary }}77),pinned:1
|
||||
|
||||
@@ -1,90 +1,97 @@
|
||||
# $text_color = rgba({{ $onBackground }}FF)
|
||||
# $entry_background_color = rgba({{ $background }}11)
|
||||
# $entry_border_color = rgba({{ $outline }}55)
|
||||
# $entry_color = rgba({{ $onSurfaceVariant }}FF)
|
||||
$text_color = rgba(FFFFFFFF)
|
||||
$entry_background_color = rgba(33333311)
|
||||
$entry_border_color = rgba(3B3B3B55)
|
||||
$entry_color = rgba(FFFFFFFF)
|
||||
#hyprlock config
|
||||
|
||||
$text_color = rgba({{ $term3 }}FF)
|
||||
$text_key_color = rgba({{ $term1 }}FF)
|
||||
$text_status_color = rgba({{ $tertiary }}FF)
|
||||
$base_color = rgba({{ $term0 }}FF)
|
||||
|
||||
$font_family = Rubik Light
|
||||
$font_family_clock = Rubik Light
|
||||
$font_family_clock = Geist Mono 10
|
||||
$font_family_date = JetBrainsMono Nerd Font 10
|
||||
$font_material_symbols = Material Symbols Rounded
|
||||
|
||||
general {
|
||||
#hide cursor
|
||||
hide_cursor = true
|
||||
}
|
||||
|
||||
background {
|
||||
# color = rgba({{ $surfaceContainerLowest }}FF)
|
||||
color = rgba(000000FF)
|
||||
# path = {{ SWWW_WALL }}
|
||||
# path = screenshot
|
||||
# blur_size = 5
|
||||
# blur_passes = 4
|
||||
}
|
||||
input-field {
|
||||
monitor =
|
||||
size = 250, 50
|
||||
outline_thickness = 2
|
||||
dots_size = 0.1
|
||||
dots_spacing = 0.3
|
||||
outer_color = $entry_border_color
|
||||
inner_color = $entry_background_color
|
||||
font_color = $entry_color
|
||||
# fade_on_empty = true
|
||||
path = $path # only png supported for now
|
||||
# color = $color1
|
||||
|
||||
position = 0, 20
|
||||
halign = center
|
||||
valign = center
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_size = 4
|
||||
blur_passes = 3 # 0 disables blurring
|
||||
noise = 0.0117
|
||||
contrast = 1.3000 # Vibrant!!!
|
||||
brightness = 0.8000
|
||||
vibrancy = 0.2100
|
||||
vibrancy_darkness = 0.0
|
||||
}
|
||||
|
||||
label { # Clock
|
||||
# Hours
|
||||
label {
|
||||
monitor =
|
||||
text = $TIME
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"
|
||||
color = $text_color
|
||||
font_size = 65
|
||||
font_size = 112
|
||||
font_family = $font_family_clock
|
||||
shadow_passes = 3
|
||||
shadow_size = 4
|
||||
|
||||
position = 0, 300
|
||||
position = 0, 220
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label { # Greeting
|
||||
monitor =
|
||||
text = hi $USER !!!
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 20
|
||||
font_family = $font_family
|
||||
|
||||
position = 0, 240
|
||||
# Minutes
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"
|
||||
color = $text_key_color
|
||||
font_size = 112
|
||||
font_family = $font_family_clock
|
||||
shadow_passes = 3
|
||||
shadow_size = 4
|
||||
|
||||
position = 0, 80
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label { # lock icon
|
||||
monitor =
|
||||
text = lock
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 21
|
||||
font_family = $font_material_symbols
|
||||
|
||||
position = 0, 65
|
||||
# Today
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:18000000] echo "<b><big> "$(date +'%A')" </big></b>"
|
||||
<<<<<<< HEAD
|
||||
color = rgba(FFFFFF80)
|
||||
=======
|
||||
color = rgba({{ $primaryContainer }}FF)
|
||||
>>>>>>> parent of 1a3fa77... heda hau fixed
|
||||
font_size = 22
|
||||
font_family = $font_family_date
|
||||
|
||||
position = 0, -20
|
||||
halign = center
|
||||
valign = bottom
|
||||
valign = center
|
||||
}
|
||||
label { # "locked" text
|
||||
monitor =
|
||||
text = locked
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 14
|
||||
font_family = $font_family
|
||||
|
||||
position = 0, 45
|
||||
# Week
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:18000000] echo "<b> "$(date +'%d %b')" </b>"
|
||||
<<<<<<< HEAD
|
||||
color = rgba(FFFFFF80)
|
||||
=======
|
||||
color = rgba({{ $primaryContainer }}FF)
|
||||
>>>>>>> parent of 1a3fa77... heda hau fixed
|
||||
font_size = 18
|
||||
font_family = $font_family_date
|
||||
|
||||
position = 0, -50
|
||||
halign = center
|
||||
valign = bottom
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Status
|
||||
@@ -92,11 +99,33 @@ label { # Status
|
||||
text = cmd[update:5000] ${XDG_CONFIG_HOME:-$HOME/.config}/hypr/hyprlock/status.sh
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
color = $text_status_color
|
||||
font_size = 14
|
||||
font_family = $font_family
|
||||
|
||||
position = 30, -30
|
||||
halign = left
|
||||
valign = top
|
||||
}
|
||||
position = -30, 30
|
||||
halign = right
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 230, 50
|
||||
outline_thickness = 1
|
||||
|
||||
dots_size = 0.24 # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.64 # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true
|
||||
# dots_rouding = 1
|
||||
|
||||
rounding = 28
|
||||
outer_color = $text_key_color
|
||||
inner_color = $base_color
|
||||
font_color = $text_color
|
||||
fade_on_empty = true
|
||||
placeholder_text = <i>Password...</i> # Text rendered in the input box when it's empty.
|
||||
|
||||
position = 0, 120
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"lib": [
|
||||
"ES2022"
|
||||
],
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"baseUrl": ".",
|
||||
"typeRoots": [
|
||||
"./types"
|
||||
],
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/share/com.github.Aylur.ags/types
|
||||
Reference in New Issue
Block a user