Plano de fundo rotatório no Gnome
Publicado por Francisco Souza (última atualização em 30/03/2010)
[ Hits: 5.550 ]
Homepage: http://www.franciscosouza.net
Download transitioning_generator.py
Script Python que gera o XML para plano de fundo rotatório.
Para utilizá-lo, basta executá-lo em um diretório com os arquivos .JPG que você deseja que componham o XML do plano de fundo rotatório.
#!/usr/bin/env python #-*- coding:utf-8 -*- import os import xml.etree.cElementTree as ElementTree if __name__ == '__main__': curdir = os.path.dirname(os.path.abspath(__file__)) itens = os.listdir(curdir) root = ElementTree.Element('background') time_info = ElementTree.SubElement(root, 'starttime') year = ElementTree.SubElement(time_info, 'year') year.text = '2010' month = ElementTree.SubElement(time_info, 'month') month.text = '01' day = ElementTree.SubElement(time_info, 'day') day.text = '01' hour = ElementTree.SubElement(time_info, 'hour') hour.text = '00' minute = ElementTree.SubElement(time_info, 'minute') minute.text = '00' second = ElementTree.SubElement(time_info, 'second') images = [item for item in itens if item.lower().endswith('jpg')] image_count = len(images) cur_index = 0 while cur_index < image_count: static = ElementTree.SubElement(root, 'static') duration = ElementTree.SubElement(static, 'duration') duration.text = '895.0' image_file = ElementTree.SubElement(static, 'file') image_file.text = os.path.join(curdir, images[cur_index]) transiction = ElementTree.SubElement(root, 'transiction') transiction_duration = ElementTree.SubElement(transiction, 'duration') transiction_duration.text = '5.0' from_file = ElementTree.SubElement(transiction, 'from') from_file.text = os.path.join(curdir, images[cur_index]) to_file = ElementTree.SubElement(transiction, 'to') if (cur_index + 1 == image_count): to_file.text = os.path.join(curdir, images[0]) else: to_file.text = os.path.join(curdir, images[cur_index + 1]) cur_index += 1 bg_file = open('bg_file.xml', 'w') ElementTree.ElementTree(root).write(bg_file) bg_file.close()
Mudar wallpaper por um aleatorio
Gerador de cartão de crédito com Tkinter
Como agendar um backup automático do PostgreSQL no Cron evitando o problema de senha
Como preparar o Vim/Neovim para corrigir ortografia em português
Dark Web e Malwares na internet, quanto custa?
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Como verificar o hash de um arquivo baixado da Internet e como criar um hash
Debian 12 - IPTABLES - removendo NFTABLES
OverWatch 2 - Abrindo portas do jogo no Iptables.
Como instalar o adaptador wifi USB Intelbras ACtion A1200 no Linux Mint
Como normalizar seus arquivos MP3 para que fiquem no mesmo volume
Instalação do Programa Imposto de Renda Pessoa Física 2023 [RESOLVIDO]... (6)
Instalando e compilando o GCC/G++ erro (4)
[C/C++] BRT - Bulk Renaming Tool
[Shell Script] Criação de Usuarios , Grupo e instalação do servidor de arquivos samba
[Shell Script] Tire screenshots com Scrot facilmente com Zscrot
[Shell Script] DioPSI - Script multidistro para instalar programas
[Shell Script] ARS Vídeos - Cortador de vídeos e webcam shooter