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 all 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
2 changes: 2 additions & 0 deletions .config/ags/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { startAutoDarkModeService } from './services/darkmode.js';
import { Bar, BarCornerTopleft, BarCornerTopright } from './modules/bar/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';
import Corner from './modules/screencorners/main.js';
import Crosshair from './modules/crosshair/main.js';
Expand Down Expand Up @@ -42,6 +43,7 @@ startBatteryWarningService().catch(print)
const Windows = () => [
// forMonitors(DesktopBackground),
forMonitors(Crosshair),
forMonitors(Wallselect),
Overview(),
forMonitors(Indicator),
forMonitors(Cheatsheet),
Expand Down
6 changes: 6 additions & 0 deletions .config/ags/modules/.configuration/user_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ let configOptions = {
},
'workspaces': {
'shown': 10,
'style': 'japanese'
},
'wallselect': {
'enabled': true,
'wallpaperFolder': '/Pictures/Wallpapers',
'wallpaperLimit': 100
},
'dock': {
'enabled': false,
Expand Down
29 changes: 26 additions & 3 deletions .config/ags/modules/bar/normal/workspaces_hyprland.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ const getFontWeightName = (weight) => {
}
}

// Number style conversion functions
const numberStyles = {
'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]),
'korean': (n) => n.toString().replace(/[0-9]/g, d => '영일이삼사오육칠팔구'[d]),
'devanagari': (n) => n.toString().replace(/[0-9]/g, d => '०१२३४५६७८९'[d]),
'bengali': (n) => n.toString().replace(/[0-9]/g, d => '০১২৩৪৫৬৭৮৯'[d])
};

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

// Font size = workspace id
const WorkspaceContents = (count = 10) => {
return DrawingArea({
Expand Down Expand Up @@ -165,7 +181,11 @@ const WorkspaceContents = (count = 10) => {
else
cr.setSourceRGBA(inactivecolors.red, inactivecolors.green, inactivecolors.blue, inactivecolors.alpha);

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

const [layoutWidth, layoutHeight] = layout.get_pixel_size();
const x = -workspaceRadius + (workspaceDiameter * i) - (layoutWidth / 2);
const y = (height - layoutHeight) / 2;
Expand All @@ -179,20 +199,23 @@ const WorkspaceContents = (count = 10) => {
}

export default () => EventBox({
onScrollUp: () => Hyprland.messageAsync(`dispatch workspace r-1`).catch(print),
onScrollDown: () => Hyprland.messageAsync(`dispatch workspace r+1`).catch(print),
// onScrollUp: () => Hyprland.messageAsync(`dispatch workspace -1`).catch(print),
// onScrollDown: () => Hyprland.messageAsync(`dispatch workspace +1`).catch(print),
Comment on lines +202 to +203
Copy link
Owner

Choose a reason for hiding this comment

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

Please don't remove workspace scroll

onMiddleClick: () => toggleWindowOnAllMonitors('osk'),
onSecondaryClick: () => App.toggleWindow('overview'),
hexpand:true,
attribute: {
clicked: false,
ws_group: 0,
},
child: Box({
homogeneous: true,
className: 'bar-group-margin',
hexpand:true,
children: [Box({
className: 'bar-group bar-group-standalone bar-group-pad',
css: 'min-width: 2px;',
hexpand:true,
Comment on lines +206 to +218
Copy link
Owner

Choose a reason for hiding this comment

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

what do these hexpand true do?

children: [WorkspaceContents(userOptions.workspaces.shown)],
})]
}),
Expand Down
59 changes: 17 additions & 42 deletions .config/ags/modules/indicators/colorscheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ function calculateSchemeInitIndex(optionsArr, searchValue = 'vibrant') {

const schemeOptionsArr = [
[
{ name: getString('Tonal Spot'), value: 'tonalspot' },
{ name: getString('Fruit Salad'), value: 'fruitsalad' },
{ name: getString('Tonal Spot'), value: 'tonal-spot' },
{ name: getString('Fruit Salad'), value: 'fruit-salad' },
{ name: getString('Fidelity'), value: 'fidelity' },
{ name: getString('Rainbow'), value: 'rainbow' },
],
[
{ name: getString('Neutral'), value: 'neutral' },
{ name: getString('Monochrome'), value: 'monochrome' },
{ name: getString('Expressive'), value: 'expressive' },
{ name: getString('Vibrant'), value: 'vibrant' },
// { name: getString('Vibrant'), value: 'content' },
{ name: getString('Content'), value: 'content' },
],
[
{ name: getString('Vibrant+'), value: 'morevibrant' },
// { name: getString('Vibrant+'), value: 'morevibrant' },
],
//[
// { name: getString('Content'), value: 'content' },
//]
[
]
];

const LIGHTDARK_FILE_LOCATION = `${GLib.get_user_state_dir()}/ags/user/colormode.txt`;
Expand Down Expand Up @@ -133,43 +133,18 @@ const ColorSchemeSettings = () => Widget.Box({
ConfigToggle({
icon: 'border_clear',
name: getString('Transparency'),
desc: getString('Make shell elements transparent'),
desc: getString('Make Everything transparent'),
Copy link
Owner

Choose a reason for hiding this comment

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

everything???

initValue: initTransparencyVal,
onChange: (self, newValue) => {
let 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`]))
.catch(print);
onChange: async (self, newValue) => {
try {
const transparency = newValue == 0 ? "opaque" : "transparent";
await 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`]);
await execAsync(['bash', '-c', `${App.configDir}/scripts/color_generation/applycolor.sh &`]);
} catch (error) {
console.error('Error changing transparency:', error);
}
},
}),
Widget.Box({
tooltipText: getString('Theme GTK apps using accent color\n(drawback: dark/light mode switching requires restart)'),
className: 'txt spacing-h-5 configtoggle-box',
children: [
MaterialIcon('imagesearch_roller', 'norm'),
Widget.Label({
className: 'txt txt-small',
label: getString('Use Gradience'),
}),
Widget.Box({ hexpand: true }),
ConfigMulipleSelection({
hpack: 'center',
vpack: 'center',
optionsArr: [
[{ name: 'Off', value: 0 }, { name: 'On', value: 1 }],
],
initIndex: [-1, -1],
onChange: (value, name) => {
const ADWAITA_BLUE = "#3584E4";
if (value) execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchcolor.sh - --yes-gradience`, `&`])
.catch(print);
else execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchcolor.sh "${ADWAITA_BLUE}" --no-gradience`, `&`])
.catch(print);

},
}),
]
}),
})
]
}),
Widget.Box({
Expand Down
2 changes: 1 addition & 1 deletion .config/ags/modules/indicators/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default (monitor = 0) => Widget.Window({
css: 'min-height: 2px;',
children: [
IndicatorValues(monitor),
MusicControls(),
// MusicControls(),
Copy link
Owner

Choose a reason for hiding this comment

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

just... don't

NotificationPopups(),
ColorScheme(),
]
Expand Down
Loading