feat: integrate system config

This commit is contained in:
2023-12-23 00:34:40 +01:00
parent f082d6eb65
commit 044e96eda4
140 changed files with 638 additions and 229 deletions

View File

@@ -0,0 +1,2 @@
# scripts folder
- For ARM devices, you have to compile C++ files yourself.

View File

@@ -0,0 +1,58 @@
import { Service, Utils } from '../imports.js';
const { exec, execAsync } = Utils;
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
class BrightnessService extends Service {
static {
Service.register(
this,
{ 'screen-changed': ['float'], },
{ 'screen-value': ['float', 'rw'], },
);
}
_screenValue = 0;
// the getter has to be in snake_case
get screen_value() { return this._screenValue; }
// the setter has to be in snake_case too
set screen_value(percent) {
percent = clamp(percent, 0, 1);
this._screenValue = percent;
Utils.execAsync(`brightnessctl s ${percent * 100}% -q`)
.then(() => {
// signals has to be explicity emitted
this.emit('screen-changed', percent);
this.notify('screen-value');
// or use Service.changed(propName: string) which does the above two
// this.changed('screen');
})
.catch(print);
}
constructor() {
super();
const current = Number(exec('brightnessctl g'));
const max = Number(exec('brightnessctl m'));
this._screenValue = current / max;
}
// overwriting connectWidget method, let's you
// change the default event that widgets connect to
connectWidget(widget, callback, event = 'screen-changed') {
super.connectWidget(widget, callback, event);
}
}
// the singleton instance
const service = new BrightnessService();
// make it global for easy use with cli
globalThis.brightness = service;
// export to use in other modules
export default service;

View File

@@ -0,0 +1,101 @@
export function getCalendarLayout(d, highlight) {
if (!d) d = new Date();
var calendar = [...Array(6)].map(() => Array(7));
var today = [...Array(6)].map(() => Array(7));
const year = d.getFullYear();
const month = d.getMonth() + 1;
const day = d.getDate();
const weekdayOfMonthFirst = new Date(`${year}-${month}-01`).getDay();
const leapYear = (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0));
const daysInMonth = (((month <= 7 && month % 2 == 1) || (month >= 8 && month % 2 == 0)) ? 31 : ((month == 2 && leapYear) ? 29 : ((month == 2 && !leapYear) ? 28 : 30)));
const daysInNextMonth = ((month == 1 && leapYear) ? 29 : ((month == 1 && !leapYear) ? 28 : ((month == 7 || month == 12) ? 31 : (((month <= 6 && month % 2 == 1) || (month >= 8 && month % 2 == 0)) ? 30 : 31))));
const daysInLastMonth = ((month == 3 && leapYear) ? 29 : ((month == 3 && !leapYear) ? 28 : ((month == 1 || month == 8) ? 31 : ((month <= 7 && month % 2 == 1) || (month >= 9 && month % 2 == 0)) ? 30 : 31)));
var monthDiff = (weekdayOfMonthFirst == 0 ? 0 : -1);
var dim = daysInLastMonth;
var toFill = (weekdayOfMonthFirst == 0 ? 1 : (daysInLastMonth + 1 - weekdayOfMonthFirst));
var i = 0, j = 0;
while (i < 6 && j < 7) {
calendar[i][j] = toFill;
if (toFill == day && monthDiff == 0 && highlight) today[i][j] = 1;
else if (monthDiff == 0) today[i][j] = 0;
else today[i][j] = -1;
toFill++;
if (toFill > dim) {
monthDiff++;
if (monthDiff == 0) dim = daysInMonth;
else if (monthDiff == 1) dim = daysInNextMonth;
toFill = 1;
}
j++;
if (j == 7) {
j = 0;
i++;
}
}
var cal = [];
for (var i = 0; i < 6; i++) {
var arr = [];
for (var j = 0; j < 7; j++) {
arr.push({
day: calendar[i][j],
today: today[i][j]
});
}
cal.push(arr);
}
return cal;
}
export default getCalendarLayout;
// export function getCalendarLayout(d, highlight) {
// if (!d) d = new Date();
// var calendar = [...Array(6)].map(() => Array(7));
// var today = [...Array(6)].map(() => Array(7));
// const year = d.getFullYear();
// const month = d.getMonth() + 1;
// const day = d.getDate();
// const weekdayOfMonthFirst = new Date(`${year}-${month}-01`).getDay();
// const leapYear = (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0));
// const daysInMonth = (((month <= 7 && month % 2 == 1) || (month >= 8 && month % 2 == 0)) ? 31 : ((month == 2 && leapYear) ? 29 : ((month == 2 && !leapYear) ? 28 : 30)));
// const daysInNextMonth = ((month == 1 && leapYear) ? 29 : ((month == 1 && !leapYear) ? 28 : ((month == 7 || month == 12) ? 31 : (((month <= 6 && month % 2 == 1) || (month >= 8 && month % 2 == 0)) ? 30 : 31))));
// const daysInLastMonth = ((month == 3 && leapYear) ? 29 : ((month == 3 && !leapYear) ? 28 : ((month == 1 || month == 8) ? 31 : ((month <= 7 && month % 2 == 1) || (month >= 9 && month % 2 == 0)) ? 30 : 31)));
// var monthDiff = (weekdayOfMonthFirst == 1 ? 0 : -1);
// var dim = daysInLastMonth;
// var toFill = (weekdayOfMonthFirst == 1 ? 1 : (weekdayOfMonthFirst == 0 ? (daysInLastMonth - 5) : (daysInLastMonth + 2 - weekdayOfMonthFirst)));
// var i = 0, j = 0;
// while (i < 6 && j < 7) {
// calendar[i][j] = toFill;
// if (toFill == day && monthDiff == 0 && highlight) today[i][j] = 1;
// else if (monthDiff == 0) today[i][j] = 0;
// else today[i][j] = -1;
// toFill++;
// if (toFill > dim) {
// monthDiff++;
// if (monthDiff == 0) dim = daysInMonth;
// else if (monthDiff == 1) dim = daysInNextMonth;
// toFill = 1;
// }
// j++;
// if (j == 7) {
// j = 0;
// i++;
// }
// }
// var cal = [];
// for (var i = 0; i < 6; i++) {
// var arr = [];
// for (var j = 0; j < 7; j++) {
// arr.push({
// day: calendar[i][j],
// today: today[i][j]
// });
// }
// cal.push(arr);
// }
// return cal;
// }
// export default getCalendarLayout;

View File

@@ -0,0 +1,153 @@
#!/usr/bin/env bash
cd "$HOME/.config/ags" || exit
# filelist=$(ls 'images/svg/template/' | grep -v /)
# cat scss/_material.scss
colornames=$(cat scss/_material.scss | cut -d: -f1)
colorstrings=$(cat scss/_material.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
IFS=$'\n'
# filearr=( $filelist ) # Get colors
colorlist=( $colornames ) # Array of color names
colorvalues=( $colorstrings ) # Array of color values
transparentize() {
local hex="$1"
local alpha="$2"
local red green blue
red=$((16#${hex:1:2}))
green=$((16#${hex:3:2}))
blue=$((16#${hex:5:2}))
printf 'rgba(%d, %d, %d, %.2f)\n' "$red" "$green" "$blue" "$alpha"
}
get_light_dark() {
lightdark=""
if [ ! -f ~/.cache/ags/user/colormode.txt ]; then
echo "" > ~/.cache/ags/user/colormode.txt
else
lightdark=$(cat ~/.cache/ags/user/colormode.txt) # either "" or "-l"
fi
echo "$lightdark"
}
# apply_svgs() {
# for i in "${!filearr[@]}"; do # Loop through folders
# colorvalue=$(echo "$colorscss" | grep "${filearr[$i]}" | awk '{print $2}' | cut -d ";" -f1)
# for file in images/svg/template/"${filearr[$i]}"/*; do # Loop through files
# cp "$file" images/svg/
# sed -i "s/black/$colorvalue/g" images/svg/"${file##*/}"
# done
# done
# }
apply_gtklock() {
# Check if scripts/templates/gtklock/main.scss exists
if [ ! -f "scripts/templates/gtklock/main.scss" ]; then
echo "SCSS not found. Fallback to CSS."
else
sassc ~/.config/ags/scripts/templates/gtklock/main.scss ~/.config/gtklock/style.css
return
fi
# Check if scripts/templates/gtklock/style.css exists
if [ ! -f "scripts/templates/gtklock/style.css" ]; then
echo "Template file not found for Gtklock. Skipping that."
return
fi
# Copy template
cp "scripts/templates/gtklock/style.css" "$HOME/.config/gtklock/style.css"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]};/${colorvalues[$i]};/g" "$HOME/.config/gtklock/style.css"
done
}
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
cp "scripts/templates/fuzzel/fuzzel.ini" "$HOME/.config/fuzzel/fuzzel.ini"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]}ff/${colorvalues[$i]#\#}ff/g" "$HOME/.config/fuzzel/fuzzel.ini"
sed -i "s/${colorlist[$i]}cc/${colorvalues[$i]#\#}cc/g" "$HOME/.config/fuzzel/fuzzel.ini"
done
}
apply_foot() {
# Check if scripts/templates/foot/foot.ini exists
if [ ! -f "scripts/templates/foot/foot.ini" ]; then
echo "Template file not found for Foot. Skipping that."
return
fi
# Copy template
cp "scripts/templates/foot/foot.ini" "$HOME/.config/foot/foot.ini"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$HOME/.config/foot/foot.ini" # note: ff because theyre opaque
done
}
apply_hyprland() {
# Check if scripts/templates/hypr/colors.conf exists
if [ ! -f "scripts/templates/hypr/colors.conf" ]; then
echo "Template file not found for Hyprland colors. Skipping that."
return
fi
# Copy template
cp "scripts/templates/hypr/colors.conf" "$HOME/.config/hypr/colors.conf"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/(${colorlist[$i]}/(${colorvalues[$i]#\#}/g" "$HOME/.config/hypr/colors.conf"
done
}
apply_gtk() { # Using gradience-cli
lightdark=$(get_light_dark)
background=$(cat scss/_material.scss | grep "background" | awk '{print $2}' | cut -d ";" -f1)
secondaryContainer=$(cat scss/_material.scss | grep "secondaryContainer" | awk '{print $2}' | cut -d ";" -f1)
window_bg_color=$(transparentize "$background" 0.9)
card_bg_color=$(transparentize "$background" 0.2)
headerbar_border_color=$(transparentize "$secondaryContainer" 0.12)
# Copy template
cp "scripts/templates/gradience/preset_template.json" "scripts/templates/gradience/preset.json"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/\"${colorlist[$i]}\"/\"${colorvalues[$i]}\"/g" "scripts/templates/gradience/preset.json"
done
sed -i "s|\"\$windowBgColor\"|\"$window_bg_color\"|g" "scripts/templates/gradience/preset.json"
sed -i "s|\"\$cardBgColor\"|\"$card_bg_color\"|g" "scripts/templates/gradience/preset.json"
sed -i "s|\"\$headerbarBorderColor\"|\"$headerbar_border_color\"|g" "scripts/templates/gradience/preset.json"
gradience-cli apply -p scripts/templates/gradience/preset.json --gtk both
# Set light/dark preference
# And set GTK theme manually as Gradience defaults to light adw-gtk3
# (which is unreadable when broken when you use dark mode)
if [ "$lightdark" = "-l" ]; then
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
gsettings set org.gnome.desktop.interface gtk-application-prefer-dark-theme false
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3
else
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
gsettings set org.gnome.desktop.interface gtk-application-prefer-dark-theme true
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark
fi
}
# apply_svgs
apply_gtklock
apply_fuzzel
apply_foot
apply_hyprland
apply_gtk

View File

@@ -0,0 +1,55 @@
#!/usr/bin/bash
# check if no arguments
if [ $# -eq 0 ]; then
echo "Usage: colorgen.sh /path/to/image (--apply)"
exit 1
fi
# check if the file ~/.cache/ags/user/colormode.txt exists. if not, create it. else, read it to $lightdark
lightdark=""
if [ ! -f "$HOME/.cache/ags/user/colormode.txt" ]; then
echo "" > "$HOME/.cache/ags/user/colormode.txt"
else
lightdark=$(cat "$HOME/.cache/ags/user/colormode.txt") # either "" or "-l"
fi
# check if the file ~/.cache/ags/user/colorbackend.txt exists. if not, create it. else, read it to $lightdark
backend="material"
if [ ! -f "$HOME/.cache/ags/user/colorbackend.txt" ]; then
echo "material" > "$HOME/.cache/ags/user/colorbackend.txt"
else
backend=$(cat "$HOME/.cache/ags/user/colorbackend.txt") # either "" or "-l"
fi
cd "$HOME/.config/ags/scripts/" || exit
if [ "$backend" = "material" ]; then
color_generation/generate_colors_material.py --path "$1" "$lightdark" > $HOME/.cache/ags/user/generated_colors.txt
if [ "$2" = "--apply" ]; then
cp $HOME/.cache/ags/user/generated_colors.txt "$HOME/.config/ags/scss/_material.scss"
color_generation/applycolor.sh
fi
elif [ "$backend" = "pywal" ]; then
# clear and generate
wal -c
echo wal -i "$1" -n -t -s -e "$lightdark" -q
wal -i "$1" -n -t -s -e $lightdark -q
# copy scss
cp "$HOME/.cache/wal/colors.scss" $HOME/.cache/ags/user/generated_colors.txt
cat color_generation/pywal_to_material.scss >> $HOME/.cache/ags/user/generated_colors.txt
if [ "$2" = "--apply" ]; then
sassc $HOME/.cache/ags/user/generated_colors.txt $HOME/.cache/ags/user/generated_colors_classes.scss --style compact
sed -i "s/ { color//g" $HOME/.cache/ags/user/generated_colors_classes.scss
sed -i "s/\./$/g" $HOME/.cache/ags/user/generated_colors_classes.scss
sed -i "s/}//g" $HOME/.cache/ags/user/generated_colors_classes.scss
if [ "$lightdark" = "-l" ]; then
printf "\n"'$darkmode: false;'"\n" >> $HOME/.cache/ags/user/generated_colors_classes.scss
else
printf "\n"'$darkmode: true;'"\n" >> $HOME/.cache/ags/user/generated_colors_classes.scss
fi
cp $HOME/.cache/ags/user/generated_colors_classes.scss "$HOME/.config/ags/scss/_material.scss"
color_generation/applycolor.sh
fi
fi

View File

@@ -0,0 +1,93 @@
#!/bin/python3
from material_color_utilities_python import *
from pathlib import Path
import sys
import subprocess
img = 0
newtheme=0
if len(sys.argv) > 1 and sys.argv[1] == '--path':
img = Image.open(sys.argv[2])
basewidth = 64
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
img = img.resize((basewidth,hsize),Image.Resampling.LANCZOS)
newtheme = themeFromImage(img)
elif len(sys.argv) > 1 and sys.argv[1] == '--color':
colorstr = sys.argv[2]
newtheme = themeFromSourceColor(argbFromHex(colorstr))
else:
imagePath = subprocess.check_output("swww query | awk -F 'image: ' '{print $2}'", shell=True)
imagePath = imagePath[:-1].decode("utf-8")
img = Image.open(imagePath)
basewidth = 64
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
img = img.resize((basewidth,hsize),Image.Resampling.LANCZOS)
newtheme = themeFromImage(img)
colorscheme=0
if("-l" in sys.argv):
colorscheme = newtheme.get('schemes').get('light')
print('$darkmode: false;')
else:
colorscheme = newtheme.get('schemes').get('dark')
print('$darkmode: true;')
primary = colorscheme.get_primary()
onPrimary = colorscheme.get_onPrimary()
primaryContainer = colorscheme.get_primaryContainer()
onPrimaryContainer = colorscheme.get_onPrimaryContainer()
secondary = colorscheme.get_secondary()
onSecondary = colorscheme.get_onSecondary()
secondaryContainer = colorscheme.get_secondaryContainer()
onSecondaryContainer = colorscheme.get_onSecondaryContainer()
tertiary = colorscheme.get_tertiary()
onTertiary = colorscheme.get_onTertiary()
tertiaryContainer = colorscheme.get_tertiaryContainer()
onTertiaryContainer = colorscheme.get_onTertiaryContainer()
error = colorscheme.get_error()
onError = colorscheme.get_onError()
errorContainer = colorscheme.get_errorContainer()
onErrorContainer = colorscheme.get_onErrorContainer()
background = colorscheme.get_background()
onBackground = colorscheme.get_onBackground()
surface = colorscheme.get_surface()
onSurface = colorscheme.get_onSurface()
surfaceVariant = colorscheme.get_surfaceVariant()
onSurfaceVariant = colorscheme.get_onSurfaceVariant()
outline = colorscheme.get_outline()
shadow = colorscheme.get_shadow()
inverseSurface = colorscheme.get_inverseSurface()
inverseOnSurface = colorscheme.get_inverseOnSurface()
inversePrimary = colorscheme.get_inversePrimary()
print('$primary: ' + hexFromArgb(primary) + ';')
print('$onPrimary: ' + hexFromArgb(onPrimary) + ';')
print('$primaryContainer: ' + hexFromArgb(primaryContainer) + ';')
print('$onPrimaryContainer: ' + hexFromArgb(onPrimaryContainer) + ';')
print('$secondary: ' + hexFromArgb(secondary) + ';')
print('$onSecondary: ' + hexFromArgb(onSecondary) + ';')
print('$secondaryContainer: ' + hexFromArgb(secondaryContainer) + ';')
print('$onSecondaryContainer: ' + hexFromArgb(onSecondaryContainer) + ';')
print('$tertiary: ' + hexFromArgb(tertiary) + ';')
print('$onTertiary: ' + hexFromArgb(onTertiary) + ';')
print('$tertiaryContainer: ' + hexFromArgb(tertiaryContainer) + ';')
print('$onTertiaryContainer: ' + hexFromArgb(onTertiaryContainer) + ';')
print('$error: ' + hexFromArgb(error) + ';')
print('$onError: ' + hexFromArgb(onError) + ';')
print('$errorContainer: ' + hexFromArgb(errorContainer) + ';')
print('$onErrorContainer: ' + hexFromArgb(onErrorContainer) + ';')
print('$colorbarbg: ' + hexFromArgb(background) + ';')
print('$background: ' + hexFromArgb(background) + ';')
print('$onBackground: ' + hexFromArgb(onBackground) + ';')
print('$surface: ' + hexFromArgb(surface) + ';')
print('$onSurface: ' + hexFromArgb(onSurface) + ';')
print('$surfaceVariant: ' + hexFromArgb(surfaceVariant) + ';')
print('$onSurfaceVariant: ' + hexFromArgb(onSurfaceVariant) + ';')
print('$outline: ' + hexFromArgb(outline) + ';')
print('$shadow: ' + hexFromArgb(shadow) + ';')
print('$inverseSurface: ' + hexFromArgb(inverseSurface) + ';')
print('$inverseOnSurface: ' + hexFromArgb(inverseOnSurface) + ';')
print('$inversePrimary: ' + hexFromArgb(inversePrimary) + ';')

View File

@@ -0,0 +1,57 @@
$primary: lighten($color4, 20%);
$onPrimary: darken($color2, 20%);
$primaryContainer: darken($color2, 10%);
$onPrimaryContainer: lighten($color4, 10%);
$secondary: desaturate(lighten($color5, 20%), 20%);
$onSecondary: desaturate(darken($color3, 20%), 20%);
$secondaryContainer: desaturate(darken($color3, 20%), 20%);
$onSecondaryContainer: desaturate(lighten($color5, 20%), 20%);
$tertiary: adjust-hue(lighten($color4, 20%), 30deg);
$onTertiary: adjust-hue(darken($color2, 20%), 30deg);
$tertiaryContainer: adjust-hue(darken($color2, 10%), 30deg);
$tertiaryContainer: adjust-hue(lighten($color4, 10%), 30deg);
$error: #ffb4a9;
$onError: #680003;
$errorContainer: #930006;
$onErrorContainer: #ffb4a9;
$colorbarbg: $color0;
$background: $color0;
$onBackground: $color7;
$surface: $color0;
$onSurface: $color7;
$surfaceVariant: $color1;
$onSurfaceVariant: $color7;
$outline: $color7;
$shadow: #000000;
$inverseSurface: invert($surface);
$inverseOnSurface: invert($onSurface);
$inversePrimary: invert($primary);
.primary { color: $primary; }
.onPrimary { color: $onPrimary; }
.primaryContainer { color: $primaryContainer; }
.onPrimaryContainer { color: $onPrimaryContainer; }
.secondary { color: $secondary; }
.onSecondary { color: $onSecondary; }
.secondaryContainer { color: $secondaryContainer; }
.onSecondaryContainer { color: $onSecondaryContainer; }
.tertiary { color: $tertiary; }
.onTertiary { color: $onTertiary; }
.tertiaryContainer { color: $tertiaryContainer; }
.onTertiaryContainer { color: $tertiaryContainer; }
.error { color: $error; }
.onError { color: $onError; }
.errorContainer { color: $errorContainer; }
.onErrorContainer { color: $onErrorContainer; }
.colorbarbg { color: $colorbarbg; }
.background { color: $background; }
.onBackground { color: $onBackground; }
.surface { color: $surface; }
.onSurface { color: $onSurface; }
.surfaceVariant { color: $surfaceVariant; }
.onSurfaceVariant { color: $onSurfaceVariant; }
.outline { color: $outline; }
.shadow { color: $shadow; }
.inverseSurface { color: $inverseSurface; }
.inverseOnSurface { color: $inverseOnSurface; }
.inversePrimary { color: $inversePrimary; }

View File

@@ -0,0 +1,27 @@
#!/usr/bin/bash
# Switches sww wallpaper
# Requires: coreutils, xrandr, hyprland
# Select and set image (hyprland)
cd "$HOME/Pictures"
imgpath=$(yad --width 1200 --height 800 --file --title='Choose wallpaper')
screensizey=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1)
cursorposx=$(hyprctl cursorpos -j | gojq '.x')
cursorposy=$(hyprctl cursorpos -j | gojq '.y')
cursorposy_inverted=$(( screensizey - cursorposy ))
if [ "$imgpath" == '' ]; then
echo 'Aborted'
exit 0
fi
echo Sending "$imgpath" to swww. Cursor pos: ["$cursorposx, $cursorposy_inverted"] &
# Change swww wallpaper
swww img "$imgpath" --transition-step 100 --transition-fps 60 \
--transition-type grow --transition-angle 30 --transition-duration 1 \
--transition-pos "$cursorposx, $cursorposy_inverted" &
# Generate colors for ags n stuff
"$HOME"/.config/ags/scripts/color_generation/colorgen.sh "${imgpath}" --apply
sassc "$HOME"/.config/ags/scss/main.scss "$HOME"/.config/ags/style.css
ags run-js "App.resetCss(); App.applyCss('${HOME}/.config/ags/style.css');" &

Binary file not shown.

View File

@@ -0,0 +1,79 @@
#include <array>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
#include "nlohmann/json.hpp"
using namespace std;
using json = nlohmann::json;
int workspace_a, workspace_b;
string clients;
json clientjson;
vector<string> windows_a, windows_b;
bool output = false;
string exec(const char* cmd) {
array<char, 128> buffer;
string result;
unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
if (!pipe) {
throw runtime_error("popen() failed!");
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
return result;
}
void tryAddApp(const json& client) {
if (int(client["workspace"]["id"]) == workspace_a)
windows_a.push_back(client["address"]);
else if (int(client["workspace"]["id"]) == workspace_b)
windows_b.push_back(client["address"]);
}
void getApps() {
// Get clients
clients = exec("hyprctl clients -j | gojq -c -M");
clientjson = json::parse(clients);
// Access the values
for (json client : clientjson) {
tryAddApp(client);
}
}
void dumptoWorkspace() {
for (string address : windows_a) {
string cmd = "hyprctl dispatch movetoworkspacesilent " +
to_string(workspace_b) + ",address:" + address;
if (output) cout << cmd << '\n';
exec(&cmd[0]);
}
}
int main(int argc, char* argv[]) {
ios::sync_with_stdio(false);
if (argc < 3) {
cout << "Usage: dumptows [WORKSPACE_NUMBER_1] [WORKSPACE_NUMBER_2]"
<< endl;
return 0;
}
if (argc == 4 && string(argv[3]) == "--output") output = true;
workspace_a = stoi(string(argv[1]));
workspace_b = stoi(string(argv[2]));
if (workspace_a <= 0 || workspace_b <= 0 || workspace_a == workspace_b) {
cout << "Nahhh that's stupid" << endl;
return 0;
}
getApps();
dumptoWorkspace();
}

View File

@@ -0,0 +1,40 @@
import { Service, Utils } from '../imports.js';
const { exec, execAsync } = Utils;
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
class IndicatorService extends Service {
static {
Service.register(
this,
{ 'popup': ['double'], },
);
}
_delay = 1500;
_count = 0;
popup(value) {
this.emit('popup', value);
this._count++;
Utils.timeout(this._delay, () => {
this._count--;
if (this._count === 0)
this.emit('popup', -1);
});
}
connectWidget(widget, callback) {
connect(this, widget, callback, 'popup');
}
}
// the singleton instance
const service = new IndicatorService();
// make it global for easy use with cli
globalThis['indicator'] = service;
// export to use in other modules
export default service;

View File

@@ -0,0 +1,14 @@
#!/usr/bin/bash
cd ~/Videos || exit
if [[ "$(pidof wf-recorder)" == "" ]]; then
notify-send "Starting recording" './recording_'"$(date '+%Y_%m_%_d..%H.%M.%S')"'.mp4' -a 'record-script.sh'
if [[ "$1" == "--sound" ]]; then
wf-recorder -t -f './recording_'"$(date '+%Y_%m_%_d..%H.%M.%S')"'.mp4' --geometry "$(slurp)" --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor
else
wf-recorder -t -f './recording_'"$(date '+%Y_%m_%_d..%H.%M.%S')"'.mp4' --geometry "$(slurp)"
fi
else
/usr/bin/kill --signal SIGINT wf-recorder
notify-send "Recording Stopped" "Stopped" -a 'record-script.sh'
fi

View File

@@ -0,0 +1,107 @@
import { App, Service, Utils, Widget } from '../imports.js';
const { exec, execAsync, CONFIG_DIR } = Utils;
export const deflisten = function (name, command, transformer = (a) => a) {
const { Service } = ags;
const GObject = imports.gi.GObject;
const v = GObject.registerClass(
{
GTypeName: name,
Properties: {
state: GObject.ParamSpec.string(
"state",
"State",
"Read-Write string state.",
GObject.ParamFlags.READWRITE,
""
),
},
Signals: {
[`${name}-changed`]: {},
},
},
class Subclass extends Service {
get state() {
return this._state || "";
}
set state(value) {
this._state = value;
this.emit("changed");
}
get proc() {
return this._proc || null;
}
set proc(value) {
this._proc = value;
}
start = () => {
this.proc = Utils.subprocess(command, (line) => {
this.state = transformer(line);
});
}
stop = () => {
this.proc.force_exit();
this.proc = null;
}
constructor() {
super();
this.proc = Utils.subprocess(command, (line) => {
this.state = transformer(line);
});
}
}
);
class State {
static {
globalThis[name] = this;
}
static instance = new v();
static get state() {
return State.instance.state;
}
static set state(value) {
State.instance.state = value;
}
static start() {
State.instance.start();
}
static stop() {
State.instance.stop();
}
}
return State;
}
export async function switchWall() {
try {
path = exec(`bash -c 'cd ~/Pictures && yad --width 1200 --height 800 --file --title="Choose wallpaper"'`);
screensizey = JSON.parse(exec(`hyprctl monitors -j`))[0]['height'];
cursorposx = exec(`bash -c 'hyprctl cursorpos -j | gojq ".x"'`);
cursorposy = exec(`bash -c 'hyprctl cursorpos -j | gojq ".y"'`);
cursorposy_inverted = screensizey - cursorposy;
// print all those
if (path == '') {
print('Switch wallpaper: Aborted');
return;
}
print(`Sending ${path} to swww. Cursor pos: [${cursorposx}, ${cursorposy_inverted}]`);
exec(`swww img ${path} --transition-step 230 --transition-fps 60 --transition-type grow --transition-angle 30 --transition-duration 1 --transition-pos "${cursorposx}, ${cursorposy_inverted}"`);
exec(CONFIG_DIR + `/scripts/colorgen.sh ${path} --apply`);
imports.scss.scss.setupScss();
} catch (error) {
print(error);
}
}

Binary file not shown.

View File

@@ -0,0 +1,85 @@
#include <array>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
#include "nlohmann/json.hpp"
using namespace std;
using json = nlohmann::json;
int workspace_a, workspace_b;
string clients;
json clientjson;
vector<string> windows_a, windows_b;
bool output = false;
string exec(const char* cmd) {
array<char, 128> buffer;
string result;
unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
if (!pipe) {
throw runtime_error("popen() failed!");
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
return result;
}
void tryAddApp(const json& client) {
if (int(client["workspace"]["id"]) == workspace_a)
windows_a.push_back(client["address"]);
else if (int(client["workspace"]["id"]) == workspace_b)
windows_b.push_back(client["address"]);
}
void getApps() {
// Get clients
clients = exec("hyprctl clients -j | gojq -c -M");
clientjson = json::parse(clients);
// Access the values
for (json client : clientjson) {
tryAddApp(client);
}
}
void swapWorkspaces() {
for (string address : windows_a) {
string cmd = "hyprctl dispatch movetoworkspacesilent " +
to_string(workspace_b) + ",address:" + address;
if (output) cout << cmd << '\n';
exec(&cmd[0]);
}
for (string address : windows_b) {
string cmd = "hyprctl dispatch movetoworkspacesilent " +
to_string(workspace_a) + ",address:" + address;
if (output) cout << cmd << '\n';
exec(&cmd[0]);
}
}
int main(int argc, char* argv[]) {
ios::sync_with_stdio(false);
if (argc < 3) {
cout << "Usage: swapws [WORKSPACE_NUMBER_1] [WORKSPACE_NUMBER_2]"
<< endl;
return 0;
}
if (argc == 4 && string(argv[3]) == "--output") output = true;
workspace_a = stoi(string(argv[1]));
workspace_b = stoi(string(argv[2]));
if (workspace_a <= 0 || workspace_b <= 0 || workspace_a == workspace_b) {
cout << "Nahhh that's stupid" << endl;
return 0;
}
getApps();
swapWorkspaces();
}

View File

@@ -0,0 +1,156 @@
# -*- conf -*-
shell=fish
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
term=xterm-256color
# login-shell=no
# app-id=foot
title=foot
# locked-title=no
font=JetBrainsMono Nerd Font:size=12
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# line-height=<font metrics>
letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# box-drawings-uses-font-glyphs=no
dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
pad=25x25 # optionally append 'center'
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
[bell]
# urgent=no
# notify=no
# command=
# command-focused=no
[scrollback]
lines=10000
# multiplier=3.0
# indicator-position=relative
# indicator-format=
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'
[cursor]
style=beam
# color=111111 dcdccc
color=$background # $onBackground #
# blink=no
beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
# hide-when-typing=no
# alternate-scroll-mode=yes
[colors]
alpha=1
background=$background #
foreground=$onBackground #
regular0=$background #
regular1=$error #
regular2=$inversePrimary #
regular3=$onPrimaryContainer #
regular4=$onPrimaryContainer #
regular5=$onSecondaryContainer #
regular6=$primary #
regular7=$onSurfaceVariant #
bright0=$background #
bright1=$error #
bright2=$inversePrimary #
bright3=$onPrimaryContainer #
bright4=$onPrimaryContainer #
bright5=$onSecondaryContainer #
bright6=$primary #
bright7=$onSurfaceVariant #
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
scrollback-up-page=Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
scrollback-down-page=Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
clipboard-copy=Control+c
clipboard-paste=Control+v
# primary-paste=Shift+Insert
search-start=Control+f
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# show-urls-launch=Control+Shift+u
# show-urls-copy=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-to-word-boundary=Control+w
# extend-to-next-whitespace=Control+Shift+w
# clipboard-paste=Control+v Control+y
# primary-paste=Shift+Insert
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[mouse-bindings]
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-row=BTN_LEFT-3

View File

@@ -0,0 +1,21 @@
font=Lexend
terminal=foot -e
prompt=">> "
layer=overlay
[colors]
background=$backgroundcc
text=$onBackgroundff
selection=$surfaceVariantff
selection-text=$onSurfaceVariantff
border=$surfaceVariantff
match=$primaryff
selection-match=$primaryff
[border]
radius=17
width=2
[dmenu]
exit-immediately-if-empty=yes

View File

@@ -0,0 +1,139 @@
{
"name": "Material-blue-light",
"variables": {
"theme_fg_color": "#AEE5FA",
"theme_text_color": "#AEE5FA",
"theme_bg_color": "#1a1b26",
"theme_base_color": "#1a1b26",
"theme_selected_bg_color": "#AEE5FA",
"theme_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"insensitive_bg_color": "#1a1b26",
"insensitive_fg_color": "rgba(192, 202, 245, 0.5)",
"insensitive_base_color": "#24283b",
"theme_unfocused_fg_color": "#AEE5FA",
"theme_unfocused_text_color": "#c0caf5",
"theme_unfocused_bg_color": "#1a1b26",
"theme_unfocused_base_color": "#1a1b26",
"theme_unfocused_selected_bg_color": "#a9b1d6",
"theme_unfocused_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"unfocused_insensitive_color": "rgba(192, 202, 245, 0.5)",
"borders": "rgba(192, 202, 245, 0.12)",
"unfocused_borders": "rgba(192, 202, 245, 0.12)",
"warning_color": "#FDD633",
"error_color": "#BA1B1B",
"success_color": "#81C995",
"wm_title": "#AEE5FA",
"wm_unfocused_title": "rgba(192, 202, 245, 0.7)",
"wm_highlight": "rgba(192, 202, 245, 0.1)",
"wm_bg": "#1a1b26",
"wm_unfocused_bg": "#1a1b26",
"wm_button_close_icon": "#1a1b26",
"wm_button_close_hover_bg": "#a9b1d6",
"wm_button_close_active_bg": "#c7c7c7",
"content_view_bg": "#1a1b26",
"placeholder_text_color": "silver",
"text_view_bg": "#1d1d1d",
"budgie_tasklist_indicator_color": "#90D1F6",
"budgie_tasklist_indicator_color_active": "#90D1F6",
"budgie_tasklist_indicator_color_active_window": "#999999",
"budgie_tasklist_indicator_color_attention": "#FDD633",
"STRAWBERRY_100": "#FF9262",
"STRAWBERRY_300": "#FF793E",
"STRAWBERRY_500": "#F15D22",
"STRAWBERRY_700": "#CF3B00",
"STRAWBERRY_900": "#AC1800",
"ORANGE_100": "#FFDB91",
"ORANGE_300": "#FFCA40",
"ORANGE_500": "#FAA41A",
"ORANGE_700": "#DE8800",
"ORANGE_900": "#C26C00",
"BANANA_100": "#FFFFA8",
"BANANA_300": "#FFFA7D",
"BANANA_500": "#FFCE51",
"BANANA_700": "#D1A023",
"BANANA_900": "#A27100",
"LIME_100": "#A2F3BE",
"LIME_300": "#8ADBA6",
"LIME_500": "#73C48F",
"LIME_700": "#479863",
"LIME_900": "#1C6D38",
"BLUEBERRY_100": "#94A6FF",
"BLUEBERRY_300": "#6A7CE0",
"BLUEBERRY_500": "#3F51B5",
"BLUEBERRY_700": "#213397",
"BLUEBERRY_900": "#031579",
"GRAPE_100": "#D25DE6",
"GRAPE_300": "#B84ACB",
"GRAPE_500": "#9C27B0",
"GRAPE_700": "#830E97",
"GRAPE_900": "#6A007E",
"COCOA_100": "#9F9792",
"COCOA_300": "#7B736E",
"COCOA_500": "#574F4A",
"COCOA_700": "#463E39",
"COCOA_900": "#342C27",
"SILVER_100": "#EEE",
"SILVER_300": "#CCC",
"SILVER_500": "#AAA",
"SILVER_700": "#888",
"SILVER_900": "#666",
"SLATE_100": "#888",
"SLATE_300": "#666",
"SLATE_500": "#444",
"SLATE_700": "#222",
"SLATE_900": "#111",
"BLACK_100": "#474341",
"BLACK_300": "#403C3A",
"BLACK_500": "#393634",
"BLACK_700": "#33302F",
"BLACK_900": "#2B2928",
"accent_bg_color": "#006874",
"accent_fg_color": "#ffffff",
"accent_color": "#006874",
"destructive_bg_color": "#ba1b1b",
"destructive_fg_color": "#ffffff",
"destructive_color": "#ba1b1b",
"success_bg_color": "#81C995",
"success_fg_color": "rgba(0, 0, 0, 0.87)",
"warning_bg_color": "#FDD633",
"warning_fg_color": "rgba(0, 0, 0, 0.87)",
"error_bg_color": "#ba1b1b",
"error_fg_color": "#ffffff",
"window_bg_color": "rgba(251, 253, 253, 0.90)",
"window_fg_color": "#191c1d",
"view_bg_color": "#fbfdfd",
"view_fg_color": "#191c1d",
"headerbar_bg_color": "mix(@dialog_bg_color, @window_bg_color, 0.5)",
"headerbar_fg_color": "#051f23",
"headerbar_border_color": "rgba(205, 231, 236, 0.12)",
"headerbar_backdrop_color": "@headerbar_bg_color",
"headerbar_shade_color": "rgba(0, 0, 0, 0.09)",
"card_bg_color": "rgba(251, 253, 253, 0.20)",
"card_fg_color": "#051f23",
"card_shade_color": "rgba(0, 0, 0, 0.09)",
"dialog_bg_color": "#cde7ec",
"dialog_fg_color": "#051f23",
"popover_bg_color": "#cde7ec",
"popover_fg_color": "#051f23",
"thumbnail_bg_color": "#1a1b26",
"thumbnail_fg_color": "#AEE5FA",
"shade_color": "rgba(0, 0, 0, 0.36)",
"scrollbar_outline_color": "rgba(0, 0, 0, 0.5)"
},
"palette": {
"blue_": {},
"green_": {},
"yellow_": {},
"orange_": {},
"red_": {},
"purple_": {},
"brown_": {},
"light_": {},
"dark_": {}
},
"custom_css": {
"gtk4": "",
"gtk3": ""
},
"plugins": {}
}

View File

@@ -0,0 +1,139 @@
{
"name": "Material-blue-light",
"variables": {
"theme_fg_color": "#AEE5FA",
"theme_text_color": "#AEE5FA",
"theme_bg_color": "#1a1b26",
"theme_base_color": "#1a1b26",
"theme_selected_bg_color": "#AEE5FA",
"theme_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"insensitive_bg_color": "#1a1b26",
"insensitive_fg_color": "rgba(192, 202, 245, 0.5)",
"insensitive_base_color": "#24283b",
"theme_unfocused_fg_color": "#AEE5FA",
"theme_unfocused_text_color": "#c0caf5",
"theme_unfocused_bg_color": "#1a1b26",
"theme_unfocused_base_color": "#1a1b26",
"theme_unfocused_selected_bg_color": "#a9b1d6",
"theme_unfocused_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"unfocused_insensitive_color": "rgba(192, 202, 245, 0.5)",
"borders": "rgba(192, 202, 245, 0.12)",
"unfocused_borders": "rgba(192, 202, 245, 0.12)",
"warning_color": "#FDD633",
"error_color": "#BA1B1B",
"success_color": "#81C995",
"wm_title": "#AEE5FA",
"wm_unfocused_title": "rgba(192, 202, 245, 0.7)",
"wm_highlight": "rgba(192, 202, 245, 0.1)",
"wm_bg": "#1a1b26",
"wm_unfocused_bg": "#1a1b26",
"wm_button_close_icon": "#1a1b26",
"wm_button_close_hover_bg": "#a9b1d6",
"wm_button_close_active_bg": "#c7c7c7",
"content_view_bg": "#1a1b26",
"placeholder_text_color": "silver",
"text_view_bg": "#1d1d1d",
"budgie_tasklist_indicator_color": "#90D1F6",
"budgie_tasklist_indicator_color_active": "#90D1F6",
"budgie_tasklist_indicator_color_active_window": "#999999",
"budgie_tasklist_indicator_color_attention": "#FDD633",
"STRAWBERRY_100": "#FF9262",
"STRAWBERRY_300": "#FF793E",
"STRAWBERRY_500": "#F15D22",
"STRAWBERRY_700": "#CF3B00",
"STRAWBERRY_900": "#AC1800",
"ORANGE_100": "#FFDB91",
"ORANGE_300": "#FFCA40",
"ORANGE_500": "#FAA41A",
"ORANGE_700": "#DE8800",
"ORANGE_900": "#C26C00",
"BANANA_100": "#FFFFA8",
"BANANA_300": "#FFFA7D",
"BANANA_500": "#FFCE51",
"BANANA_700": "#D1A023",
"BANANA_900": "#A27100",
"LIME_100": "#A2F3BE",
"LIME_300": "#8ADBA6",
"LIME_500": "#73C48F",
"LIME_700": "#479863",
"LIME_900": "#1C6D38",
"BLUEBERRY_100": "#94A6FF",
"BLUEBERRY_300": "#6A7CE0",
"BLUEBERRY_500": "#3F51B5",
"BLUEBERRY_700": "#213397",
"BLUEBERRY_900": "#031579",
"GRAPE_100": "#D25DE6",
"GRAPE_300": "#B84ACB",
"GRAPE_500": "#9C27B0",
"GRAPE_700": "#830E97",
"GRAPE_900": "#6A007E",
"COCOA_100": "#9F9792",
"COCOA_300": "#7B736E",
"COCOA_500": "#574F4A",
"COCOA_700": "#463E39",
"COCOA_900": "#342C27",
"SILVER_100": "#EEE",
"SILVER_300": "#CCC",
"SILVER_500": "#AAA",
"SILVER_700": "#888",
"SILVER_900": "#666",
"SLATE_100": "#888",
"SLATE_300": "#666",
"SLATE_500": "#444",
"SLATE_700": "#222",
"SLATE_900": "#111",
"BLACK_100": "#474341",
"BLACK_300": "#403C3A",
"BLACK_500": "#393634",
"BLACK_700": "#33302F",
"BLACK_900": "#2B2928",
"accent_bg_color": "$primary",
"accent_fg_color": "$onPrimary",
"accent_color": "$primary",
"destructive_bg_color": "$error",
"destructive_fg_color": "$onError",
"destructive_color": "$error",
"success_bg_color": "#81C995",
"success_fg_color": "rgba(0, 0, 0, 0.87)",
"warning_bg_color": "#FDD633",
"warning_fg_color": "rgba(0, 0, 0, 0.87)",
"error_bg_color": "$error",
"error_fg_color": "$onError",
"window_bg_color": "$windowBgColor",
"window_fg_color": "$onBackground",
"view_bg_color": "$surface",
"view_fg_color": "$onSurface",
"headerbar_bg_color": "mix(@dialog_bg_color, @window_bg_color, 0.5)",
"headerbar_fg_color": "$onSecondaryContainer",
"headerbar_border_color": "$headerbarBorderColor",
"headerbar_backdrop_color": "@headerbar_bg_color",
"headerbar_shade_color": "rgba(0, 0, 0, 0.09)",
"card_bg_color": "$cardBgColor",
"card_fg_color": "$onSecondaryContainer",
"card_shade_color": "rgba(0, 0, 0, 0.09)",
"dialog_bg_color": "$secondaryContainer",
"dialog_fg_color": "$onSecondaryContainer",
"popover_bg_color": "$secondaryContainer",
"popover_fg_color": "$onSecondaryContainer",
"thumbnail_bg_color": "#1a1b26",
"thumbnail_fg_color": "#AEE5FA",
"shade_color": "rgba(0, 0, 0, 0.36)",
"scrollbar_outline_color": "rgba(0, 0, 0, 0.5)"
},
"palette": {
"blue_": {},
"green_": {},
"yellow_": {},
"orange_": {},
"red_": {},
"purple_": {},
"brown_": {},
"light_": {},
"dark_": {}
},
"custom_css": {
"gtk4": "",
"gtk3": ""
},
"plugins": {}
}

View File

@@ -0,0 +1,86 @@
// Could just sed but scss is way less hacky
@import '../../../scss/_material.scss'; // Which is ~/.config/ags/scss/_material.scss
* {
all: unset;
border: 0rem;
}
window {
background-color: transparentize($background, 0.9);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
#window-box {
border-radius: 1.5rem;
padding: 1.5rem;
}
#input-label {
font-size: 1.5rem;
color: transparent;
background-color: transparent;
margin: -20rem; // bye bye
}
#input-field {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
caret-color: $onSecondaryContainer;
border-radius: 999px;
font-size: 1.3rem;
padding: 0.341rem 1.364rem;
margin: 0.477rem;
box-shadow: 2px 2px 4px rgba(22, 22, 22, 0.5);
min-height: 2.727rem;
}
#unlock-button {
margin: -20rem; // bye bye
color: transparent;
background-color: transparent;
}
#error-label {
color: $error;
}
#clock-label {
font-family: 'Lexend';
font-size: 6rem;
border-radius: 1.2rem;
padding: 0.5rem;
margin: 0.6rem;
margin-top: -35rem; // higher clock position
color: $onSecondaryContainer;
text-shadow: 1px 1px 2px rgba(22, 22, 30, 0.5);
}
// #user-image {}
// #powerbar-box {}
#poweroff-button,
#reboot-button,,
#suspend-button {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
min-width: 3rem;
min-height: 3rem;
margin: 0.341rem;
border-radius: 9999px;
}
#poweroff-button:hover,
#reboot-button:hover,
#suspend-button:hover {
background-color: mix($secondaryContainer, white, 80%);
}
#poweroff-button:active,
#reboot-button:active,
#suspend-button:active {
background-color: mix($secondaryContainer, white, 70%);
}

View File

@@ -0,0 +1,102 @@
/* Gtklock css */
* {
all: unset;
border: 0px;
}
window {
background: rgba(0, 0, 0, 0.5);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
#window-box {
border-radius: 1.5rem;
padding: 1.5rem;
border: 0px solid black;
}
#input-label {
font-size: 1.5rem;
color: transparent;
background-color: transparent;
margin: -20rem;
}
#input-field {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
caret-color: $onSecondaryContainer;
border-radius: 999px;
font-size: 1.3rem;
padding: 0.341rem 1.364rem;
margin: 0.477rem;
box-shadow: 2px 2px 4px rgba(22, 22, 22, 0.5);
min-height: 2.727rem;
}
#unlock-button {
margin: -20rem;
color: transparent;
background-color: transparent;
}
#error-label {
color: $error;
}
#clock-label {
font-family: 'Lexend';
font-size: 6rem;
border-radius: 1.2rem;
padding: 0.5rem;
margin: 0.6rem;
margin-top: -35rem;
color: $onSecondaryContainer;
text-shadow: 1px 1px 2px rgba(22, 22, 30, 0.5);
}
#user-image {}
#powerbar-box {}
#poweroff-button {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
min-width: 3rem;
min-height: 3rem;
margin: 10px;
border-radius: 99px;
}
#suspend-button {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
min-width: 3rem;
min-height: 3rem;
margin: 10px;
border-radius: 99px;
}
#reboot-button {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
min-width: 3rem;
min-height: 3rem;
margin: 10px;
border-radius: 99px;
}
#poweroff-button:hover,
#reboot-button:hover,
#suspend-button:hover {
background: rgba(200, 200, 200, 0.3);
}
#poweroff-button:active,
#reboot-button:active,
#suspend-button:active {
background: rgba(200, 200, 200, 0.5);
}

View File

@@ -0,0 +1,5 @@
# Auto generated color theme for image at: [Local wallpaper]
general {
col.active_border = rgba($primaryAA) 45deg
col.inactive_border = rgba(555555FF)
}

View File

@@ -0,0 +1,86 @@
const { Gio, Gdk, Gtk } = imports.gi;
import { Service, Utils } from '../imports.js';
const { exec, execAsync } = Utils;
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
function fileExists(filePath) {
let file = Gio.File.new_for_path(filePath);
return file.query_exists(null);
}
class TodoService extends Service {
static {
Service.register(
this,
{ 'updated': [], },
);
}
_todoPath = '';
_todoJson = [];
refresh(value) {
this.emit('updated', value);
}
connectWidget(widget, callback) {
this.connect(widget, callback, 'updated');
}
get todo_json() {
return this._todoJson;
}
add(content) {
this._todoJson.push({ content, done: false });
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this.emit('updated');
}
check(index) {
this._todoJson[index].done = true;
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this.emit('updated');
}
uncheck(index) {
this._todoJson[index].done = false;
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this.emit('updated');
}
remove(index) {
this._todoJson.splice(index, 1);
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this.emit('updated');
}
constructor() {
super();
this._todoPath = `${App.configDir}/../../.cache/ags/user/todo.json`;
if (!fileExists(this._todoPath)) { // No? create file with empty array
Utils.exec(`bash -c 'mkdir -p ~/.cache/ags/user'`);
Utils.exec(`touch ${this._todoPath}`);
Utils.writeFile("[]", this._todoPath).then(() => {
this._todoJson = JSON.parse(Utils.readFile(this._todoPath))
}).catch(print);
}
else {
const fileContents = Utils.readFile(this._todoPath);
this._todoJson = JSON.parse(fileContents);
}
}
}
// the singleton instance
const service = new TodoService();
// make it global for easy use with cli
globalThis.todo = service;
// export to use in other modules
export default service;

View File

@@ -0,0 +1,9 @@
#!/bin/bash
cd ~/.mozilla/firefox/
if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]
then PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep -1 '^Default=1' | grep '^Path' | cut -c6-)
else PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//')
fi
echo "$HOME/.mozilla/firefox/$PROFPATH"