Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appearence Enhancements #1111

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/ags/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { firstRunWelcome, startBatteryWarningService } from './services/messages
import { startAutoDarkModeService } from './services/darkmode.js';
// Widgets
import { Bar, BarCornerTopleft, BarCornerTopright } from './modules/bar/main.js';
// import Cheatsheet from './modules/cheatsheet/main.js';
import Cheatsheet from './modules/cheatsheet/main.js';
// import DesktopBackground from './modules/desktopbackground/main.js';
import Wallselect from './modules/wallselect/main.js'
import Dock from './modules/dock/main.js';
Expand Down Expand Up @@ -46,7 +46,7 @@ const Windows = () => [
forMonitors(Wallselect),
Overview(),
forMonitors(Indicator),
// forMonitors(Cheatsheet),
forMonitors(Cheatsheet),
SideLeft(),
SideRight(),
forMonitors(Osk),
Expand Down
8 changes: 4 additions & 4 deletions .config/ags/modules/bar/normal/workspaces_hyprland.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getFontWeightName = (weight) => {

// Number style conversion functions
const numberStyles = {
'arabic': (n) => n.toString(),
'normal': (n) => n.toString(),
'thai': (n) => n.toString().replace(/[0-9]/g, d => '๐๑๒๓๔๕๖๗๘๙'[d]),
'japanese': (n) => n.toString().replace(/[0-9]/g, d => '〇一二三四五六七八九'[d]),
'chinese': (n) => n.toString().replace(/[0-9]/g, d => '零一二三四五六七八九'[d]),
Expand All @@ -47,8 +47,8 @@ const numberStyles = {
'bengali': (n) => n.toString().replace(/[0-9]/g, d => '০১২৩৪৫৬৭৮৯'[d])
};

const convertNumber = (number, style = 'arabic') => {
const converter = numberStyles[style] || numberStyles.arabic;
const convertNumber = (number, style = 'normal') => {
const converter = numberStyles[style] || numberStyles.normal;
return converter(number);
};

Expand Down Expand Up @@ -182,7 +182,7 @@ const WorkspaceContents = (count = 10) => {
cr.setSourceRGBA(inactivecolors.red, inactivecolors.green, inactivecolors.blue, inactivecolors.alpha);

// Convert number to selected style
const numberStyle = userOptions.workspaces.style || 'arabic';
const numberStyle = userOptions.workspaces.style || 'normal';
const displayNumber = convertNumber(i + offset, numberStyle);
layout.set_text(displayNumber, -1);

Expand Down
4 changes: 2 additions & 2 deletions .config/ags/modules/indicators/colorscheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ const schemeOptionsArr = [
{ name: getString('Neutral'), value: 'neutral' },
{ name: getString('Monochrome'), value: 'monochrome' },
{ name: getString('Expressive'), value: 'expressive' },
{ name: getString('Vibrant'), value: 'content' },
// { name: getString('Vibrant'), value: 'content' },
{ name: getString('Content'), value: 'content' },
],
[
// { name: getString('Vibrant+'), value: 'morevibrant' },
],
[
{ name: getString('Content'), value: 'content' },
]
];

Expand Down
61 changes: 56 additions & 5 deletions .config/ags/modules/wallselect/main.js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to myself: this one imma just run to test, i just know its safe

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as Utils from "resource:///com/github/Aylur/ags/utils.js";
import App from "resource:///com/github/Aylur/ags/app.js";
import userOptions from "../.configuration/user_options.js";
import GLib from 'gi://GLib';
import Gio from 'gi://Gio';
const { Box, Label, EventBox, Scrollable, Button } = Widget;
// Constants
const CONFIG_DIR = GLib.get_home_dir() + '/.config/ags';
Expand All @@ -12,6 +13,55 @@ const THUMBNAIL_DIR = GLib.build_filenamev([WALLPAPER_DIR, "thumbnails"]);
// Cached Variables
let wallpaperPathsPromise = null;
let cachedContent = null;
let fileMonitor = null;

// Initialize file monitoring
const initFileMonitor = () => {
if (fileMonitor) return;

const file = Gio.File.new_for_path(WALLPAPER_DIR);
fileMonitor = file.monitor_directory(Gio.FileMonitorFlags.NONE, null);

fileMonitor.connect('changed', (_, file, otherFile, eventType) => {
const path = file.get_path();
const ext = path.toLowerCase().split('.').pop();
const validExts = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'tga', 'tiff', 'bmp', 'ico'];

// Handle both file creation and deletion
if ((eventType === Gio.FileMonitorEvent.CREATED ||
eventType === Gio.FileMonitorEvent.DELETED) &&
validExts.includes(ext)) {

const action = eventType === Gio.FileMonitorEvent.CREATED ? 'added' : 'deleted';

if (eventType === Gio.FileMonitorEvent.DELETED) {
// Get the thumbnail path
const filename = path.split('/').pop();
const thumbnailPath = GLib.build_filenamev([THUMBNAIL_DIR, filename]);

// Delete the thumbnail if it exists
if (GLib.file_test(thumbnailPath, GLib.FileTest.EXISTS)) {
GLib.unlink(thumbnailPath);
}
}

// Regenerate thumbnails
Utils.execAsync([`bash`, `${CONFIG_DIR}/scripts/generate_thumbnails.sh`])
.then(() => {
// Reset caches
wallpaperPathsPromise = null;
cachedContent = null;

// Refresh UI if visible
if (App.getWindow('wallselect')?.visible) {
App.closeWindow('wallselect');
App.openWindow('wallselect');
}
});
}
});
};


// Wallpaper Button
const WallpaperButton = (path) =>
Expand Down Expand Up @@ -62,13 +112,12 @@ const createContent = async () => {
return cachedContent;

} catch (error) {
console.error("Error creating content:", error);
return Box({
className: "wallpaper-error",
vexpand: true,
hexpand: true,
children: [
Label({ label: "Error loading wallpapers. Check the console for details.", className: "txt-large txt-error", }),
Label({ label: "Error loading wallpapers.", className: "txt-large txt-error", }),
],
});
}
Expand Down Expand Up @@ -112,8 +161,7 @@ const GenerateButton = () => Widget.Button({
cachedContent = null; // Invalidate cache
App.closeWindow('wallselect');
App.openWindow('wallselect');
})
.catch((error) => console.error("Error generating thumbnails:", error));
});
},
});

Expand All @@ -125,6 +173,9 @@ const toggleWindow = () => {
};
export { toggleWindow };

// Initialize monitoring when the module loads
initFileMonitor();

// Main Window
export default () => Widget.Window({
name: "wallselect",
Expand All @@ -142,7 +193,7 @@ export default () => Widget.Window({
Box({
vertical: true,
className: "sidebar-right spacing-v-15",
vpack: "start",
vpack: 'start',
children: [
Box({
className: "wallselect-header",
Expand Down
6 changes: 3 additions & 3 deletions .config/ags/scripts/color_generation/colorgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ materialscheme=""
if [ ! -f $colormodefile ]; then
echo "dark" > $colormodefile
echo "opaque" >> $colormodefile
echo "vibrant" >> $colormodefile
echo "content" >> $colormodefile
elif [[ $(wc -l < $colormodefile) -ne 3 || $(wc -w < $colormodefile) -ne 3 ]]; then
echo "dark" > $colormodefile
echo "opaque" >> $colormodefile
echo "vibrant" >> $colormodefile
echo "content" >> $colormodefile
else
lightdark=$(sed -n '1p' $colormodefile)
transparency=$(sed -n '2p' $colormodefile)
Expand All @@ -53,7 +53,7 @@ if [[ ! "$1" = "#"* ]]; then # this is an image
echo "$1" > "$STATE_DIR/user/current_wallpaper.txt"
fi

matugen image "$1" -m "$lightdark" -t "scheme-$materialscheme"
matugen image "$1" --mode "$lightdark" -t "scheme-$materialscheme"
# Apply the generated colors if --apply flag is set
if [ "$2" = "" ]; then
exit
Expand Down
14 changes: 7 additions & 7 deletions .config/ags/scss/wallselect.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.wallpaper-list {
.preview-box {
min-width: 150px;
min-height: 90px;
min-width: 9.375rem;
min-height: 5.625rem;
background-size: cover;
background-position: center;
border-radius: 8px;
border-radius: 0.5rem;
}

button {
padding: 4px;
margin: 4px;
padding: 0.25rem;
margin: 0.25rem;
}

.scroll-box {
min-height: 110px;
min-height: 6.875rem;
}
}

Expand All @@ -35,7 +35,7 @@

.generate-thumbnails {
padding: 0.5rem 1rem;
border-radius: 9999px;
border-radius: 624.9375rem;
Copy link
Owner

@end-4 end-4 Feb 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not this lmao
if its a circle just leave it as 9999px

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made it w ai lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deepseek aint playin mind games

background-color: $secondaryContainer;
color: $onSecondaryContainer;
margin-right: 0.5rem;
Expand Down
15 changes: 8 additions & 7 deletions .config/anyrun/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* {
all: unset;
font-size: 1.3rem;
font-size: 1.4rem;
}

#window,
Expand Down Expand Up @@ -33,12 +33,12 @@
#match:selected,
#match:hover,
#plugin:hover {
background: #2e3131;
background: #121318;
}

#entry {
background: #0b0f10;
border: 1px solid #0b0f10;
background: #121318;
/* border: 1px solid #8f9099; */
border-radius: 16px;
margin: 0.5rem;
padding: 0.3rem 1rem;
Expand All @@ -59,8 +59,9 @@ list > #plugin:hover {
}

box#main {
background: #0b0f10;
box-shadow: inset 0 0 0 1px #0b0f10, 0 0 0 1px #0b0f10;
border-radius: 24px;
background: #121318;
/* box-shadow: inset 0 0 0 1px #000000, 0 0 0 1px; */
border-radius: 20px;
min-height:30px;
padding: 0.3rem;
}