This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First you should prepare all themes with default wallpapers using | |
// tdesktop. Go to Settings -> Chat Settings -> Choose from gallery, | |
// choose a wallpaper, go back -> Launch theme editor -> ... -> Export | |
// theme -> Export, and name it `n.tdesktop-theme` where n is an | |
// inremeneted counter. Repeat for all wallpapers. | |
// Specify the last value of `n` here | |
const N: u8 = 1; | |
// Specify the channel where the wallpapers will be sent | |
const CHANNEL: &str = "@defaultwallpapers"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const find = Color.parseHex("#607d8b"); | |
const replace = Color.parseHex("#abcdef"); | |
// ↑ Replace these colors. The alpha channel | |
// is ignored. | |
// Below starts the find and replace logic. | |
const variables = activeTheme.getVariables(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{prelude::*, SeekFrom}; | |
const CHUNK: usize = 512 * 1024 * 1024; | |
fn main() { | |
let path = std::env::args_os().nth(1).unwrap(); | |
let mut file = std::fs::File::open(path).unwrap(); | |
let mut position = file.seek(SeekFrom::End(-(CHUNK as i64))).unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
env::args, | |
fs::{remove_file, File, OpenOptions}, | |
io::{prelude::*, SeekFrom}, | |
thread::sleep, | |
time::Duration, | |
}; | |
const BLOCK_SIZE: usize = 4 * 1024 * 1024; | |
const SECTOR_SIZE: usize = 512; |