« [mobileconfig]デスクトップ・ピクチャーを変更する | トップページ | [desktoppr]デスクトップ・ピクチャーを変更する(コマンドラインツール) »

[sqlite3]デスクトップ・ピクチャーを変更する(断念)

display_uuidとspace_uuidと紐づいているようなのだが…
今一歩理解出来なかった…断念



/usr/bin/sqlite3 $HOME/Library/Application\ Support/Dock/desktoppicture.db


.tables

-->

data         displays     pictures     preferences  prefs        spaces 



.mode column


select * from data;

-->/System/Library/Desktop Pictures/Solid Colors/Red Orange.png

select * from displays;

-->display_uuid  

select * from pictures;

-->space_id  display_id

select * from preferences;

-->key  data_id  picture_id

select * from prefs;

-->null

select * from spaces;

-->space_uuid




delete from data;


insert into data values('/System/Library/Desktop Pictures/Solid Colors');

insert into data values('/System/Library/Desktop Pictures/Solid Colors/Silver.png');

update data set value = '/System/Library/Desktop Pictures/Solid Colors/Silver.png'


select * from data;



.schema

-->

CREATE TABLE pictures (space_id INTEGER, display_id INTEGER);

CREATE TABLE preferences (key INTEGER, data_id INTEGER, picture_id INTEGER);

CREATE TABLE spaces (space_uuid VARCHAR);

CREATE TABLE displays (display_uuid);

CREATE TABLE data (value);

CREATE TABLE prefs (key INTEGER, data);

CREATE INDEX pictures_index ON pictures (space_id, display_id);

CREATE INDEX preferences_index ON preferences (picture_id, data_id);

CREATE INDEX spaces_index ON spaces (space_uuid);

CREATE INDEX displays_index ON displays (display_uuid);

CREATE INDEX data_index ON data (value);

CREATE INDEX prefs_index ON prefs (key);

CREATE TRIGGER space_deleted AFTER DELETE ON spaces BEGIN DELETE FROM pictures WHERE space_id=OLD.ROWID;END;

CREATE TRIGGER display_deleted AFTER DELETE ON displays BEGIN DELETE FROM pictures WHERE display_id=OLD.ROWID;END;

CREATE TRIGGER picture_deleted AFTER DELETE ON pictures BEGIN DELETE FROM preferences WHERE picture_id=OLD.ROWID; DELETE FROM displays WHERE ROWID=OLD.display_id AND NOT EXISTS (SELECT NULL FROM pictures WHERE display_id=OLD.display_id); DELETE FROM spaces WHERE ROWID=OLD.space_id AND NOT EXISTS (SELECT NULL FROM pictures WHERE space_id=OLD.space_id);END;

CREATE TRIGGER preferences_deleted AFTER DELETE ON preferences BEGIN DELETE FROM data WHERE ROWID=OLD.data_id AND NOT EXISTS (SELECT NULL FROM preferences WHERE data_id=OLD.data_id);END;


.quit


|

« [mobileconfig]デスクトップ・ピクチャーを変更する | トップページ | [desktoppr]デスクトップ・ピクチャーを変更する(コマンドラインツール) »

AppleScript Desktop」カテゴリの記事