Skip to content

Commit

Permalink
Merge pull request #21 from dumbasPL/linux-support
Browse files Browse the repository at this point in the history
Linux support
  • Loading branch information
dumbasPL authored Sep 1, 2022
2 parents a98d3b4 + f570d9b commit 6410b4a
Show file tree
Hide file tree
Showing 8 changed files with 1,017 additions and 1,032 deletions.
Binary file added build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.4.0
- added linux support

# 1.3.1
- fixed danger zone rank names (thanks @TheEnderOfficial)

Expand Down
6 changes: 3 additions & 3 deletions html/js/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,21 +508,21 @@ async function updateAccounts(force = false) {
let row = FindOrCreateRow(login, tr => {
tr.querySelector('.copy-code').addEventListener('click', e => {
e.preventDefault();
clipboard.writeText(friendCode.encode(account_cache[login].steamid), 'selection');
clipboard.writeText(friendCode.encode(account_cache[login].steamid), 'clipboard');
showToast('Code copied to clipboard', 'success');
});

tr.querySelector('.copy-passwd').addEventListener('click', e => {
e.preventDefault();
clipboard.writeText(account_cache[login].password, 'selection');
clipboard.writeText(account_cache[login].password, 'clipboard');
showToast('Password copied to clipboard', 'success');
});

tr.querySelector('.copy-steamguard').addEventListener('click', async e => {
e.preventDefault();
try {
let code = await ipcRenderer.invoke('steamtotp', { secret: account_cache[login].sharedSecret });
clipboard.writeText(code, 'selection');
clipboard.writeText(code, 'clipboard');
showToast('SteamGuard Code copied to clipboard', 'success');
}
catch (e) {
Expand Down
Binary file added icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const Protos = require('./helpers/protos.js')([{
]
}]);

const browserWindowOptions = {};

if (process.platform === "linux") {
browserWindowOptions.icon = path.join(`${__dirname}/icons/icon.png`);
}

const IS_PORTABLE = process.env.PORTABLE_EXECUTABLE_DIR != null;
const USER_DATA = IS_PORTABLE ? path.join(process.env.PORTABLE_EXECUTABLE_DIR, process.env.PORTABLE_EXECUTABLE_APP_FILENAME + '-data') : app.getPath('userData');
const SETTINGS_PATH = path.join(USER_DATA, 'settings.json');
Expand Down Expand Up @@ -72,6 +78,7 @@ async function openDB() {
let pass = await new Promise((resolve, reject) => {
passwordPromptResponse = null;
let promptWindow = new BrowserWindow({
...browserWindowOptions,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true,
Expand Down Expand Up @@ -162,6 +169,7 @@ var mainWindowCreated = false;
function createWindow () {

win = new BrowserWindow({
...browserWindowOptions,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true,
Expand Down Expand Up @@ -225,6 +233,7 @@ ipcMain.handle('encryption:setup', async () => {
let pass = await new Promise((resolve, reject) => {
passwordPromptResponse = null;
let promptWindow = new BrowserWindow({
...browserWindowOptions,
parent: win,
modal: true,
webPreferences: {
Expand Down Expand Up @@ -290,6 +299,7 @@ ipcMain.handle('encryption:remove', async () => {
let pass = await new Promise((resolve, reject) => {
passwordPromptResponse = null;
let promptWindow = new BrowserWindow({
...browserWindowOptions,
parent: win,
modal: true,
webPreferences: {
Expand Down
Loading

0 comments on commit 6410b4a

Please sign in to comment.