mirror of
				https://github.com/smartfrigde/armcord.git
				synced 2024-08-14 23:56:58 +00:00 
			
		
		
		
	2.4 Update
Canary
This commit is contained in:
		
						commit
						df5403c1c8
					
				
					 4 changed files with 47 additions and 30 deletions
				
			
		
							
								
								
									
										16
									
								
								main.js
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								main.js
									
										
									
									
									
								
							|  | @ -2,9 +2,17 @@ | |||
| const { app, BrowserWindow, session, Tray, Menu } = require("electron"); | ||||
| const path = require("path"); | ||||
| const contextMenu = require("electron-context-menu"); | ||||
| const os = require("os"); | ||||
| require("v8-compile-cache"); | ||||
| require("./utils/updater"); | ||||
| 
 | ||||
| if (os.type() == 'Linux'){ | ||||
|   var iconformat = __dirname + "/discord.png"  | ||||
| } else { //test this 
 | ||||
|   console.log("Running Non-Linux") | ||||
|   var iconformat = __dirname + "/discord.ico"; | ||||
| } | ||||
| 
 | ||||
| contextMenu({ | ||||
|   prepend: (defaultActions, parameters, browserWindow) => [ | ||||
|     { | ||||
|  | @ -21,7 +29,7 @@ function createWindow() { | |||
|   mainWindow = new BrowserWindow({ | ||||
|     width: 800, | ||||
|     height: 600, | ||||
|     icon: __dirname + "/discord.png", | ||||
|     icon: iconformat, | ||||
|     title: "ArmCord", | ||||
|     frame: false, | ||||
|     webPreferences: { | ||||
|  | @ -31,7 +39,7 @@ function createWindow() { | |||
|     }, | ||||
|   }); | ||||
| 
 | ||||
|   var appIcon = new Tray(__dirname + "/discord.ico"); | ||||
|   var appIcon = new Tray(iconformat); | ||||
|   mainWindow.webContents.userAgent = | ||||
|     "Mozilla/5.0 (X12; FreeBSD x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
 | ||||
|   mainWindow.loadFile("index.html"); | ||||
|  | @ -106,6 +114,10 @@ app.whenReady().then(() => { | |||
|         // Approves the permissions request
 | ||||
|         callback(true); | ||||
|       } | ||||
|       if (!url.startsWith("discord://")) { | ||||
|         // Denies the permissions request
 | ||||
|         return callback(false); | ||||
|       } | ||||
|     }); | ||||
|   app.on("activate", function () { | ||||
|     // On macOS it's common to re-create a window in the app when the
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| { | ||||
|   "name": "armcord", | ||||
|   "version": "2.3.3", | ||||
|   "version": "2.4.0", | ||||
|   "description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.", | ||||
|   "main": "main.js", | ||||
|   "scripts": { | ||||
|  |  | |||
							
								
								
									
										15
									
								
								preload.js
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								preload.js
									
										
									
									
									
								
							|  | @ -1,9 +1,9 @@ | |||
| const customTitlebar = require('custom-electron-titlebar') | ||||
| const customTitlebar = require("custom-electron-titlebar"); | ||||
| const electronLocalshortcut = require("electron-localshortcut"); | ||||
| const { remote } = require("electron"); | ||||
| const ArmCord = require("./utils/ArmCord.js") | ||||
| const ArmCord = require("./utils/ArmCord.js"); | ||||
| 
 | ||||
| window.addEventListener('DOMContentLoaded', () => { | ||||
| window.addEventListener("DOMContentLoaded", () => { | ||||
|   new customTitlebar.Titlebar({ | ||||
|     backgroundColor: customTitlebar.Color.fromHex("#202225"), | ||||
|     menu: false, | ||||
|  | @ -17,12 +17,12 @@ electronLocalshortcut.register(currentWindow, "F12", () => { | |||
|     currentWindow.webContents.openDevTools(); | ||||
|   }); | ||||
|   electronLocalshortcut.register(currentWindow, "F1", () => { | ||||
|   require("shell").openExternal("https://support.discord.com/") | ||||
|     require("shell").openExternal("https://support.discord.com/"); | ||||
|   }); | ||||
|   electronLocalshortcut.register(currentWindow, "F2", () => { | ||||
|   window.location.href = "https://discord.com/invite/F25bc4RYDt" | ||||
|     window.location.href = "https://discord.com/invite/F25bc4RYDt"; | ||||
|   }); | ||||
| require("./utils/capturer.js") | ||||
|   require("./utils/capturer.js"); | ||||
| 
 | ||||
|   ArmCord.addStyle(` | ||||
| @import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); | ||||
|  | @ -79,6 +79,7 @@ div.menubar[role="menubar"] { | |||
| } | ||||
| `);
 | ||||
| 
 | ||||
| 
 | ||||
| ArmCord.addStyle(`.info-1VyQPT:last-child:before {
 | ||||
|   content: "ArmCord Version: ` + ArmCord.Version + `"; | ||||
|   height: auto; | ||||
|  | @ -87,5 +88,7 @@ ArmCord.addStyle(`.info-1VyQPT:last-child:before { | |||
|   color: var(--text-muted); | ||||
|   font-size: 12px; | ||||
|   text-transform: none; | ||||
| 
 | ||||
| }`);
 | ||||
| }) | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,13 +1,15 @@ | |||
| exports.Version = "DevBuild"; | ||||
| 
 | ||||
| exports.Version = "2.4"; | ||||
| 
 | ||||
| exports.addStyle = function (styleString) { | ||||
|  const style = document.createElement('style'); | ||||
|   const style = document.createElement("style"); | ||||
|   style.textContent = styleString; | ||||
|   document.head.append(style); | ||||
| }; | ||||
| 
 | ||||
| exports.addScript = function (scriptString) { | ||||
|   var script = document.createElement('script'); | ||||
|   var script = document.createElement("script"); | ||||
|   script.textContent = scriptString; | ||||
|   document.body.append(script); | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue