Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobuxstation committed Mar 13, 2024
1 parent 9c09746 commit 74b5d8e
Show file tree
Hide file tree
Showing 6 changed files with 3,560 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: 2.1

jobs:
build_linux_image:
docker:
- image: ubuntu:latest
steps:
- checkout
- run:
name: Install Dependencies
command: |
apt-get update && apt-get install -y debootstrap squashfs-tools xorriso grub-pc-bin grub-efi-amd64-bin mtools node
- run:
name: Prepare the Chroot Environment
command: |
debootstrap --arch=amd64 focal ubuntu-chroot http://archive.ubuntu.com/ubuntu/
mount -t proc /proc ubuntu-chroot/proc
mount -o bind /dev ubuntu-chroot/dev
mount -o bind /sys ubuntu-chroot/sys
- run:
name: Install Xorg and Minimal Dependencies
command: |
chroot ubuntu-chroot /bin/bash -c "apt-get update && apt-get install -y xorg openbox"
- run:
name: Download and Set Up Electron AppImage
command: |
git clone https://github.com/Qrodex/SkoopinOS
cd SkoopinOS
npm install
npm run build
chmod +x ubuntu-chroot/root/dist/SkoopinOS.AppImage
- run:
name: Configure Autostart
command: |
echo '#!/bin/bash' > ubuntu-chroot/etc/init.d/start-electron-app
echo 'startx /root/SkoopinOS.AppImage -- -nocursor' >> ubuntu-chroot/etc/init.d/start-electron-app
chmod +x ubuntu-chroot/etc/init.d/start-electron-app
ln -s /etc/init.d/start-electron-app ubuntu-chroot/etc/rc2.d/S99startelectronapp
- run:
name: Create the SquashFS Filesystem and ISO as before
command: |
# Follow previous steps to create filesystem.squashfs, then iso
- store_artifacts:
path: ubuntu-electron.iso
destination: ubuntu-electron.iso

run_virtual_machine:
docker:
- image: ubuntu:latest
steps:
- checkout
- run:
name: Start Virtual Machine
background: true
command: |
qemu-system-x86_64 -enable-kvm -m 2048 -cdrom ubuntu-electron.iso -vnc :0 -daemonize
sleep 10 # Wait for VM to boot
- run:
name: Start x11vnc Server
command: |
x11vnc -display :0 -rfbport 5900 -bg -forever
workflows:
version: 2
build_and_deploy:
jobs:
- build_linux_image
- run_virtual_machine:
requires:
- build_linux_image
filters:
branches:
only: master # Example: Run on the master branch
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
background-image: url("https://source.unsplash.com/1600x900/?landscape");
background-size: cover;
overflow: hidden;
background-color: black;
}

* {
Expand Down
48 changes: 48 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const electron = require('electron')
const { app, BrowserWindow, ipcMain, ipcRenderer, screen } = require("electron");
const fs = require('fs');
const path = require('path');
var win

function createWindow() {
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
win = new BrowserWindow({
icon: './costume2.png',
autoHideMenuBar: true,
width: width,
height: height,
webPreferences: {
enableRemoteModule: true,
nodeIntegration: true,
devTools: true,
contextIsolation: false,
nodeIntegrationInSubFrames: true,
nodeIntegrationInWorker: true,
webviewTag: true
}
})
win.loadFile('index.html')
}

app.whenReady().then(() => {
createWindow()
screen.on('display-metrics-changed', (event, display, changedMetrics) => {
if (changedMetrics.size && !currentScreenSize.equals(changedMetrics.size)) {
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
win.setSize(width, height)
console.log('resized')
}
});
});

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
Loading

0 comments on commit 74b5d8e

Please sign in to comment.